Zum Hauptinhalt springen
PUT
cURL
Establishes a parent-child relationship between two customers. This is used to model organizational structures such as a company with departments, a clinic with specialized units, or a retail chain with individual stores.

Validation

The following rules are enforced when assigning a parent customer:
  • The parent and child customer must belong to the same tenant
  • A customer cannot be its own parent
  • Circular references are not permitted (e.g., A → B → A)
  • The hierarchy supports a maximum of 3 levels (root → child → grandchild)
  • The parent customer must be active (not archived)
If any validation rule is violated, the API returns a 400 Bad Request with a descriptive error message.

Feature Flag

This endpoint requires the customer.hierarchy feature to be enabled. If the feature is not active, a 501 Not Implemented response is returned.

Webhooks

A successful assignment dispatches the customer.parent.assigned webhook event, which includes the full customer and parent customer payloads.

Autorisierungen

Authorization
string
header
erforderlich

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Pfadparameter

customerId
string<uuid>
erforderlich

The ID of the customer to assign a parent to

Body

application/json

The parent customer assignment

parentCustomerId
string<uuid>
erforderlich

The ID of the customer to set as parent

Beispiel:

"00000000-0000-0000-0000-000000000000"

Antwort

Parent customer assigned successfully

id
string<uuid>

The ID of the customer

parentCustomerId
string<uuid>

The ID of the assigned parent customer

parentCustomerName
string

The name of the assigned parent customer