Create a new distributor organization (Owner only)
Body
Required
-
Organization name (cannot be empty)
Minimum length is
1. -
Organization description
-
Optional. Attributes the new organization to an ancestor org (its custom_data.createdBy) instead of the caller's own org — used to preserve hierarchical ownership when an upper tier creates an entity on behalf of a lower one. Honored only for reseller creation (owner only; target must be a distributor) and customer creation (owner or distributor; target must be a reseller or distributor) within the caller's hierarchy. Empty = owned by the caller's organization. When set, the created_by snapshot in responses shows the attributed org and carries on_behalf_of: true.
-
Custom organization data (vat field is required)
Additional properties are allowed.
curl \
--request POST 'https://collect.your-domain.com/api/distributors' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"name":"ACME Distribution SpA","description":"Main distributor for Italian and Swiss markets","created_by_organization_id":"eeex9cffzsd7","custom_data":{"vat":"IT12345678901","email":"contact@acme-distribution.com","contactPerson":"John Smith","region":"Italy"}}'
{
"name": "ACME Distribution SpA",
"description": "Main distributor for Italian and Swiss markets",
"created_by_organization_id": "eeex9cffzsd7",
"custom_data": {
"vat": "IT12345678901",
"email": "contact@acme-distribution.com",
"contactPerson": "John Smith",
"region": "Italy"
}
}
{
"code": 201,
"message": "distributor created successfully",
"data": {
"id": "4405ffd0-0aca-44ef-bae2-c8545bce94f4",
"logto_id": "akkbs6x2wo82",
"name": "ACME Distribution SpA",
"description": "Main distributor for Italian and Swiss markets",
"custom_data": {
"email": "contact@acme-distribution.com",
"contactPerson": "John Smith",
"region": "Italy"
},
"suspended_at": "2026-05-04T09:42:00Z",
"suspended_by_org_id": "string",
"rebranding_enabled": false,
"rebranding_org_id": "string",
"created_by": {
"user_id": "aa15fcvgzw1y",
"username": "owner",
"name": "Nethesis Owner",
"email": "owner@nethesis.it",
"organization_id": "2wl3iixbc8ua",
"organization_name": "Owner",
"on_behalf_of": true
},
"promoted_from": {
"level": "reseller",
"at": "2026-07-30T10:00:00Z",
"detached_from_organization_id": "akkbs6x2wo82",
"by": {
"user_id": "aa15fcvgzw1y",
"username": "owner",
"name": "Nethesis Owner",
"email": "owner@nethesis.it",
"organization_id": "2wl3iixbc8ua",
"organization_name": "Owner",
"on_behalf_of": true
}
}
}
}
{
"code": 400,
"message": "validation failed",
"data": {
"type": "validation_error",
"errors": [
{
"key": "username",
"message": "required",
"value": "string"
}
]
}
}
{
"code": 401,
"message": "invalid token",
"data": {}
}
{
"code": 403,
"message": "insufficient permissions",
"data": {}
}
{
"code": 400,
"message": "validation failed",
"data": {
"type": "validation_error",
"errors": [
{
"key": "username",
"message": "required",
"value": "string"
}
]
}
}