API Version
Product Catalog
Library

When a customer belongs to an account hierarchy, the hierarchy resource represents the customer's position within that hierarchy. The hierarchy provides details about the customer's parent, children, invoice owner, and payment owner.

Note
  • A customer can have a maximum of 250 direct children.
  • The hierarchy allows a maximum of 5 levels from the root node to the lowest child node.

Sample hierarchy [ JSON ]

{ "object": "hierarchy", "customer_id": "test_AwBq83Tr3XLU0AfLB", "parent_id": "test_AwBq83Tr3XL9WAfIB", "children_ids": [ "test_AwBq83Tr3XLprAfNq", "test_Azz5ePTp3DWPk4Qh" ], "payment_owner_id": "test_AwBq83Tr3XL9WAfIB", "invoice_owner_id": "test_AwBq83Tr3XL9WAfIB" }

API Index URL GET

https://{site}.chargebee.com/api/v2/hierarchies

Model Class

customer_id
string, max chars=50
The id of the customer associated with this hierarchy resource.
parent_id
optional, string, max chars=50
The id of the immediate parent for the customer identified by customer_id. If the customer is the root of the hierarchy, this attribute isn't returned.
payment_owner_id
string, max chars=50
The id of the customer responsible for paying the invoices for the customer identified by customer_id. This ID must match either customer_id or invoice_owner_id.
invoice_owner_id
string, max chars=50
The id of the customer who receives the invoice for charges incurred by the customer identified by customer_id. This ID must match either customer_id or one of its ancestors.
has_children
optional, boolean
Indicates whether the customer has child accounts in the hierarchy.
children_ids
optional, list of string
A list of ids representing the immediate children, if any exist, for the customer identified by customer_id.

This is a list of the event types we currently support. We will continue to add more events moving forward. All events follow a uniform pattern - <resource>_<event_name>. The resources that will be present in the event content are provided beneath each event type's description.

Note: If consolidated invoicing is enabled, the attributes invoice.subscription_id and credit_note.subscription_id should not be used (as it will not be present if the invoice / credit note has lines from multiple subscriptions). Instead to know the related subscriptions, their line_items' subscription_id attribute should be referred.

customer_id customer_id
string, max chars=50
The id of the customer associated with this hierarchy resource.
parent_id parent_id
optional, string, max chars=50
The id of the immediate parent for the customer identified by customer_id. If the customer is the root of the hierarchy, this attribute isn't returned.
payment_owner_id payment_owner_id
string, max chars=50
The id of the customer responsible for paying the invoices for the customer identified by customer_id. This ID must match either customer_id or invoice_owner_id.
invoice_owner_id invoice_owner_id
string, max chars=50
The id of the customer who receives the invoice for charges incurred by the customer identified by customer_id. This ID must match either customer_id or one of its ancestors.
has_children has_children
optional, boolean
Indicates whether the customer has child accounts in the hierarchy.
children_ids children_ids
optional, list of string
A list of ids representing the immediate children, if any exist, for the customer identified by customer_id.