Create customer

POST /customers

Create a new customer organization (Owner + Distributor + Reseller)

application/json

Body Required

  • name string Required

    Organization name (cannot be empty)

    Minimum length is 1.

  • description string

    Organization description

  • custom_data object Required

    Custom organization data (vat field is required)

    Additional properties are allowed.

    Hide custom_data attribute Show custom_data attribute object
    • vat string Required

      VAT number (required, cannot be empty)

      Minimum length is 1.

Responses

  • 201 application/json

    Customer created successfully

    Hide response attributes Show response attributes object
    • code integer
    • message string
    • data object
      Hide data attributes Show data attributes object
      • id string

        Organization ID

      • name string

        Organization name

      • description string

        Organization description

      • custom_data object

        Custom organization data

        Additional properties are allowed.

      • branding object
        Hide branding attributes Show branding attributes object
        • logo_url string

          Organization logo URL

        • dark_logo_url string

          Organization dark theme logo URL

  • 400 application/json

    Bad request - validation error

    Hide response attributes Show response attributes object
    • code integer

      HTTP error code

    • message string

      Error message

    • data object
      Hide data attributes Show data attributes object
      • type string

        Type of error

        Values are validation_error or external_api_error.

      • errors array[object]
        Hide errors attributes Show errors attributes object
        • key string

          Field name that failed validation

        • message string

          Error code or message

        • value string

          Value that failed validation

      • details

        Additional error details

  • 401 application/json

    Unauthorized - invalid or missing token

    Hide response attributes Show response attributes object
    • code integer
    • message string
    • data object | null
  • 403 application/json

    Forbidden - insufficient permissions

    Hide response attributes Show response attributes object
    • code integer
    • message string
    • data object | null
  • 422 application/json

    Unprocessable entity - business logic error

    Hide response attributes Show response attributes object
    • code integer

      HTTP error code

    • message string

      Error message

    • data object
      Hide data attributes Show data attributes object
      • type string

        Type of error

        Values are validation_error or external_api_error.

      • errors array[object]
        Hide errors attributes Show errors attributes object
        • key string

          Field name that failed validation

        • message string

          Error code or message

        • value string

          Value that failed validation

      • details

        Additional error details

POST /customers
curl \
 --request POST 'https://api.your-domain.com/api/customers' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"name":"ACME Distribution SpA","description":"Main distributor for Italian and Swiss markets","custom_data":{"vat":"IT12345678901","email":"contact@acme-distribution.com","region":"Italy","contactPerson":"John Smith"}}'
Request examples
{
  "name": "ACME Distribution SpA",
  "description": "Main distributor for Italian and Swiss markets",
  "custom_data": {
    "vat": "IT12345678901",
    "email": "contact@acme-distribution.com",
    "region": "Italy",
    "contactPerson": "John Smith"
  }
}
Response examples (201)
{
  "code": 201,
  "message": "customer created successfully",
  "data": {
    "id": "org_123456789",
    "name": "ACME Distribution SpA",
    "description": "Main distributor for Italian and Swiss markets",
    "custom_data": {
      "email": "contact@acme-distribution.com",
      "region": "Italy",
      "contactPerson": "John Smith"
    },
    "branding": {
      "logo_url": "https://cdn.example.com/logos/org-console.png",
      "dark_logo_url": "https://cdn.example.com/logos/org-console-dark.png"
    }
  }
}
Response examples (400)
{
  "code": 400,
  "message": "validation failed",
  "data": {
    "type": "validation_error",
    "errors": [
      {
        "key": "username",
        "message": "required",
        "value": "string"
      }
    ]
  }
}
Response examples (401)
{
  "code": 401,
  "message": "invalid token",
  "data": {}
}
Response examples (403)
{
  "code": 403,
  "message": "insufficient permissions",
  "data": {}
}
Response examples (422)
{
  "code": 400,
  "message": "validation failed",
  "data": {
    "type": "validation_error",
    "errors": [
      {
        "key": "username",
        "message": "required",
        "value": "string"
      }
    ]
  }
}