Menu
Get Hierarchy
Get account hierarchy for a customer
/customers/{customer-id}/hierarchyUse it in a workflow
- Add a step and choose the Chargebee connector.
- Pick the Get Hierarchy action (under Chargebee API).
- Fill in the fields below, then reference the result from later steps as
{{getHierarchy.response.data}}.
Request
Path parameters
customer-idstringrequiredQuery parameters
hierarchy_operation_typestringrequired<p class="mb-2">Specifies which part of the account hierarchy to retrieve for the customer identified by <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">{customer_id}</code> .</p> * complete_hierarchy - <p class="mb-2">Retrieve all nodes in the account hierarchy.</p> * subordinates - <p class="mb-2">Retrieve all nodes in the account hierarchy that start from the specified customer (identified by <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">{customer_id}</code> ) and include its subordinates. In other words, get nodes in the account hierarchy tree where the root node is the specified customer.</p> * path_to_root - <p class="mb-2">Retrieve nodes from the specified customer (identified by <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">{customer_id}</code> ) to the root of its account hierarchy.</p>
One ofcomplete_hierarchysubordinatespath_to_root
Headers
chargebee-request-origin-devicestringThe device from which the customer has made the request
chargebee-request-origin-userstring (email)The email address of your customer/user. Use this when the email address has only ASCII characters.
chargebee-request-origin-user-encodedstring (email)The Base64-encoded email address of your customer/user. Use this if the email address has UTF-8 characters. When this header is provided, the header chargebee-request-origin-user is ignored.
chargebee-request-origin-ipstringThe IP address of the customer where the request originated
chargebee-business-entity-idstringIf the site has multiple business entities, you can use this custom HTTP header to specify the business entity for which Chargebee should perform the operation.
Response
Returns 200 with an object. Read it in later steps with {{getHierarchy.response.data.<field>}}.
hierarchiesarray<object><p class="mb-2">Resource object representing hierarchy</p>
customer_idstringrequired<p class="mb-2">The <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">id</code> of the customer associated with this <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">hierarchy</code> resource.</p>
parent_idstring<p class="mb-2">The <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">id</code> of the immediate parent for the customer identified by <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">customer_id</code>. If the customer is the root of the hierarchy, this attribute isn't returned.</p>
payment_owner_idstringrequired<p class="mb-2">The <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">id</code> of the customer responsible for paying the invoices for the customer identified by <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">customer_id</code>. This ID must match either <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">customer_id</code> or <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">invoice_owner_id</code> .</p>
invoice_owner_idstringrequired<p class="mb-2">The <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">id</code> of the customer who receives the invoice for charges incurred by the customer identified by <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">customer_id</code>. This ID must match either <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">customer_id</code> or one of its ancestors.</p>
has_childrenbooleanIndicates whether the customer has child accounts in the hierarchy.
children_idsarray<string><p class="mb-2">A list of <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">id</code> s representing the immediate children, if any exist, for the customer identified by <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">customer_id</code> .</p>
{
"hierarchies": null
}
Need more? See the Chargebee guide for connection setup and behaviour shared by every action.