AlphaCount Developers
API referenceCustomers

Create or update a customer

PUT
/customers/by-ref/{source}/{external_ref}

Creates the customer you know under {source}/{external_ref}, or replaces its fields. A PUT replaces: a field you leave out is emptied. Answers 201 when it created the customer, 200 when it updated it. Scope partner:customers:write.

Authorization

apiKey partner:customers:write
headerAuthorizationBearer <ab_…>

An API key from Integrations → Connect AI assistants (MCP) → New access, bound to exactly one company. Each operation names the scope the key must carry.

Scope: partner:customers:write

Path Parameters

source*Source
Match^[a-z0-9][a-z0-9_-]{0,49}$
external_ref*External Ref
Match^[A-Za-z0-9][A-Za-z0-9._:@+-]{0,254}$

Header Parameters

AlphaCount-Version?string

The API version to use. Default: the current one.

Request Body

application/json
  1. body

PUT /customers/by-ref/{source}/{external_ref}. Replaces every field listed here; fields the partner API does not own (customer number, tags, phone, booking defaults) stay as they are.

city*City
Length1 <= length <= 100
contact_name?|null
country_code*Country Code
Length2 <= length <= 2
customer_type?Customer Type
Default"business"
Value in"business""private"
email*Email
Lengthlength <= 255
house_number?|null
leitweg_id?|null
name*Name
Length1 <= length <= 255
street*Street
Length1 <= length <= 255
vat_id?|null
zip*Zip
Length1 <= length <= 10

Response Body

OK

application/json
  1. response
city*string|null
contact_name*string|null
country_code*|

ISO 3166-1 alpha-2.

customer_type*Customer Type
Value in"business""private"
email*string|null
external_ref*|

Your id of the customer.

external_source*|

Your system's name, as in the path.

house_number*string|null
id*Id

AlphaCount's id of the customer.

kundennummer*|

Customer number in the company's books (debtor number).

leitweg_id*|

Routing id of a public-sector buyer (XRechnung).

name*Name
street*string|null
vat_id*string|null
zip*string|null
Example Request
curl -X PUT 'https://app.alphacount.ai/api/partner/v1/customers/by-ref/string/string' \  -H 'Authorization: Bearer ab_...' \  -H 'Content-Type: application/json' \  -d '{  "city": "Köln",  "country_code": "DE",  "email": "buchhaltung@musterschule.example",  "name": "Musterschule",  "street": "Schulweg",  "zip": "50667"}'
Example Response
{  "city": "Köln",  "contact_name": null,  "country_code": "DE",  "customer_type": "business",  "email": "buchhaltung@musterschule.example",  "external_ref": "org-17",  "external_source": "alphalearn",  "house_number": null,  "id": "00000000-0000-4000-8000-000000000001",  "kundennummer": "10001",  "leitweg_id": null,  "name": "Musterschule",  "street": "Schulweg",  "vat_id": null,  "zip": "50667"}