Introducing the Better Auth Chargebee plugin: Use it to handle subscriptions, billing, and auth seamlessly.Try now
ChargebeeAPI

Link a customer to an account hierarchy

Idempotency Supported

Establish a hierarchical relationship between customers. The path parameter customer_id identifies the child in this relationship.

Note For the use_default_hierarchy_settings, parent_account_access, and child_account_access parameters below, the term "parent" usually refers to the customer with the ID payment_owner_id. However, if the payment_owner_id is the same as the child's ID ({customer_id}), the "parent" is identified by parent_id.

Sample Request

Sample Result[JSON]

URL Format

POST https://[site].chargebee.com/api/v2/customers/{customer-id}/relationships

Input Parameters

parent_id
optional, string, max chars=50

ID of the customer intended to be set as the immediate parent of the customer identified by customer_id .

payment_owner_id
optional, 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
optional, 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.

use_default_hierarchy_settings
optional, boolean, default=true

Decides if Chargebee should apply settings from the Chargebee Billing UI or from this API request.

  • If set to true: Chargebee uses settings configured in the Chargebee Billing UI.
  • If set to false: Settings provided in the parent_account_access and child_account_access parameters are applied.
parent_account_access
Parameters for parent_account_access
pass parameters as parent_account_access[<param name>]
child_account_access
Parameters for child_account_access
pass parameters as child_account_access[<param name>]

Returns

Customer object
Resource object representing customer