The customer behind one order
GET/v1/orders/{id}/customer
scope customers.read
The endpoint to reach for when you are about to raise an invoice: you are holding an order id and you need the buyer AS THEY WERE FOR THAT SALE. A customer who has moved has two orders at two addresses, and each invoice must carry its own — GET /v1/customers/{id} gives you their latest, this gives you that order's. An order with no buyer account on it is customer_not_found (404).
Response#
| Field | Type | Description |
|---|---|---|
id | integer | The buyer id. |
name | string | The buyer's account name. |
email | string | Their account email. |
phone | string|null | Their account phone. |
billing | object|null | The address to invoice at. null when the order carries no address — old orders and a handful of edge cases. |
billing. | string|null | Street and number. null when the buyer has since deleted the address the order pointed at — see is_live. Everything else in this block still stands, because it was snapshotted at checkout. |
billing. | string | Snapshotted at checkout. This is the city the parcel was actually sent to. |
billing. | string | County, judet or equivalent. Snapshotted at checkout. |
billing. | string|null | Snapshotted at checkout, falling back to the address record for the few orders carrying none. |
billing. | string | ISO 3166-1 alpha-2, e.g. RO. |
billing. | string|null | The country name in Romanian, for printing. null alongside a null address_line. |
billing. | boolean | The buyer ordered as a BUSINESS and must be invoiced as one — in Romania that means the invoice carries the company name and CUI, not the person's. Branch on this rather than on whether company happens to be populated. |
billing. | object|null | The company to invoice, or null for a private buyer. |
billing. | string | Registered company name. |
billing. | string|null | VAT number — the Romanian CUI/CIF, e.g. RO12345678. |
billing. | string|null | Trade register number, e.g. J16/123/2020. |
billing. | boolean | READ THIS ONE. true means address_line was read from an address the buyer still controls and can edit, so it is their CURRENT street, not necessarily the one at the time of sale. Only the city, county, postcode and country are frozen. If your invoices must be reproducible, store the block when you issue the invoice rather than re-fetching it later. false means the address was deleted and address_line is null. |
billing. | boolean | The parcel went to a locker. The address here is still the buyer's own — this is a delivery detail, not a billing one. |
Example
{
"id": 9000001,
"name": "John Doe",
"email": "[email protected]",
"phone": "+40700000000",
"billing": {
"address_line": "Str. Exemplu 12",
"city": "Brasov",
"county": "Brasov",
"postal_code": "500002",
"country_code": "RO",
"country": "România",
"is_company": true,
"company": {
"name": "Example Bike Shop SRL",
"vat_code": "RO12345678",
"registration_no": "J16/123/2020"
},
"is_live": true,
"delivered_to_locker": false
}
}