API
API Reference
Customer
Create Customer

Create Customer

Create a new customer in Customerscore.io.

For interactive API documentation, see the Swagger reference (opens in a new tab).

Endpoint

MethodURL
POSThttps://api.customerscore.io/api/v1/customer

Request Body

Both external_id and name are always required when creating a customer.

FieldTypeRequiredDescription
external_idstringYesUnique identifier for the customer in the external system
namestringYesCustomer name
parent_external_idstringNoexternal_id of the parent company. See Setting the parent company

Example Request

curl -X POST "https://api.customerscore.io/api/v1/customer" \
  -H "Content-Type: application/json" \
  -H "customerscore-key: your-generated-key" \
  -d '{
    "external_id": "12345",
    "name": "Acme Corporation"
  }'

Setting the parent company

parent_external_id places the new customer under an existing one in the company hierarchy — the parent/subsidiary tree shown on the Hierarchy tab of a customer's detail.

{
  "external_id": "acme-cz",
  "name": "Acme Czechia",
  "parent_external_id": "acme-group"
}

Unlike the customers upload endpoint, the parent must already exist — this endpoint creates one customer at a time. The link is validated before the customer is created, so a request that fails with 400 leaves nothing behind:

  • parent_external_id matches no customer in your account
  • it is the external_id of the customer being created
  • the parent's own chain is already 10 levels deep

To build a whole group in one call, use the customers upload endpoint, which resolves parents after creating every customer in the payload.

Webhook

A successful create fires the customer.created webhook (with data.source = API) to every webhook in your account subscribed to that event.

Response Codes

CodeDescription
200The customer has been successfully created
400Bad request - malformed body, or an unusable parent_external_id
401Unauthorized - Missing customerscore-key in the header
403Forbidden - Invalid key
405Method Not Allowed - Only POST method is allowed
406Not Acceptable