Klanten
Beheer klantgegevens. Klanten worden gekoppeld aan orders als afleveradres.
Endpoints
| Methode | Pad | Beschrijving |
|---|---|---|
GET | /customers | Alle klanten ophalen |
POST | /customers | Klant aanmaken |
GET | /customers/:id | Specifieke klant ophalen |
PUT | /customers/:id | Klant bijwerken |
DELETE | /customers/:id | Klant verwijderen |
Alle klanten ophalen
GET /customers
Response 200 OK
[
{
"id": 5,
"address_id": null,
"name": "Bedrijf BV",
"attention": "T.a.v. Jan Janssen",
"address": "Hoofdstraat 1",
"zipcode": "1234 AB",
"town": "Amsterdam",
"country": "NL",
"phone": "020-1234567",
"website": "https://bedrijf.nl"
}
]
Klant aanmaken
POST /customers
Request
{
"name": "Bedrijf BV",
"attention": "T.a.v. Jan Janssen",
"address": "Hoofdstraat 1",
"zipcode": "1234 AB",
"town": "Amsterdam",
"country": "NL",
"phone": "020-1234567",
"website": "https://bedrijf.nl"
}
| Veld | Type | Verplicht | Beschrijving |
|---|---|---|---|
name | string | ✅ | Bedrijfsnaam |
attention | string | Nee | T.a.v. / contactpersoon |
address | string | Nee | Adres |
zipcode | string | Nee | Postcode |
town | string | Nee | Plaats |
country | string | Nee | Land (ISO code) |
phone | string | Nee | Telefoonnummer |
website | string | Nee | Website URL |
Response 204 No Content
Specifieke klant ophalen
GET /customers/:id
Response 200 OK
Retourneert hetzelfde formaat als in de lijst, inclusief address_type.
Klant bijwerken
PUT /customers/:id
Request
{
"name": "Bedrijf BV (nieuw)",
"attention": "T.a.v. Piet Pietersen",
"address": "Nieuwstraat 2",
"zipcode": "5678 CD",
"town": "Rotterdam",
"country": "NL",
"phone": "010-7654321",
"website": "https://bedrijf-nieuw.nl"
}
Response 204 No Content
Klant verwijderen
DELETE /customers/:id