Create Customer
Create a new customer in Customerscore.io.
For interactive API documentation, see the Swagger reference (opens in a new tab).
Endpoint
| Method | URL |
|---|---|
| POST | https://api.customerscore.io/api/v1/customer |
Request Body
Both external_id and name are always required when creating a customer.
| Field | Type | Required | Description |
|---|---|---|---|
external_id | string | Yes | Unique identifier for the customer in the external system |
name | string | Yes | Customer name |
parent_external_id | string | No | external_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_idmatches no customer in your account- it is the
external_idof 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
| Code | Description |
|---|---|
| 200 | The customer has been successfully created |
| 400 | Bad request - malformed body, or an unusable parent_external_id |
| 401 | Unauthorized - Missing customerscore-key in the header |
| 403 | Forbidden - Invalid key |
| 405 | Method Not Allowed - Only POST method is allowed |
| 406 | Not Acceptable |