Klanten

Beheer klantgegevens. Klanten worden gekoppeld aan orders als afleveradres.

Endpoints

MethodePadBeschrijving
GET/customersAlle klanten ophalen
POST/customersKlant aanmaken
GET/customers/:idSpecifieke klant ophalen
PUT/customers/:idKlant bijwerken
DELETE/customers/:idKlant 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"
}
VeldTypeVerplichtBeschrijving
namestringBedrijfsnaam
attentionstringNeeT.a.v. / contactpersoon
addressstringNeeAdres
zipcodestringNeePostcode
townstringNeePlaats
countrystringNeeLand (ISO code)
phonestringNeeTelefoonnummer
websitestringNeeWebsite 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

Response 204 No Content