Create a customer
The customer is written to the accounting platform first. With an external_id that a customer already carries, that customer is updated and the answer is 200; otherwise a customer is created and the answer is 201. An update replaces what the body states and keeps a choice from the platform's own lists (vat_zone_ref, payment_terms_ref, layout_ref, customer_group_ref) that the body leaves out. One create runs at a time under an external_id: a second while the first is still running is answered 409 CREATE_IN_PROGRESS with Retry-After, and the same request after that interval answers the customer the first created. A create under an external_id is safe to send again after a 502: where the first request made the customer, the same request, with the same body and within the hour, is answered that customer. A create with no external_id sent again makes a second customer. Where the platform made the customer and the create did not finish, the answer is 502 CREATE_UNFINISHED with the customer's record_id: the customer is in the catalog, and the same request again updates it.
Authorization
bearerAuth An API key minted by an admin under Settings → Developers. It is bound to one company and has a scope: read, or read_write. A request without one, or with one that is not ours, is answered 401 and metered by its client address (x-rate-limits).
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/customers" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "country_key": "string", "is_person": true, "send_method": "email" }'{ "object": "customer", "id": "string", "external_id": "string", "name": "string", "country_key": "string", "is_person": true, "send_method": "email", "street": "string", "zip_code": "string", "city": "string", "phone": "string", "email": "string", "webpage": "string", "att_person": "string", "vat_number": "string", "se_number": "string", "p_number": "string", "ean_number": "string", "use_cvr": true, "company_type_key": "string", "preferred_invoice_language_key": "string", "preferred_invoice_currency_key": "string", "external_reference": "string", "payment_condition_type": "string", "payment_condition_number_of_days": -9007199254740991, "invoice_mail_out_option_key": "string", "payment_mean": "string", "vat_zone_ref": "string", "payment_terms_ref": "string", "layout_ref": "string", "customer_group_ref": "string", "updated_at": "string"}Change the fields of a customer that the body states PATCH
A field the body leaves out stays as it is; a field stated as `null` is cleared. The change is written to the accounting platform first. A body that states only `external_id` asks the platform nothing.
Delete a draft invoice DELETE
The draft goes with its lines and the work registered on them. Refused with `INVOICE_ALREADY_ISSUED` (409) once the invoice is issued, and with `INVOICE_IS_OCCURRENCE` (409) for an occurrence of a recurring series.