← API documentatie

Klanten API

Inhoud
GET /customers

Klanten ophalen

Geeft een gepagineerde lijst van uw klanten. Zoek met query op naam of e-mailadres.

Parameter Beschrijving
query Zoekterm voor naam of e-mailadres.
page, page_size Paginering, standaard 15 per pagina.
Verzoek
curl "https://financial.gyvex.com/api/customers?query=doe&page_size=25" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer UW_API_SLEUTEL"
GET /customers/{customer}

Klant ophalen

Geeft een klant terug. Gebruik de slug van de klant in de URL.

Verzoek
curl "https://financial.gyvex.com/api/customers/john-doe" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer UW_API_SLEUTEL"
POST /customer/store

Klant aanmaken

Maakt een nieuwe klant aan. Alleen name is verplicht. Een e-mailadres moet uniek zijn binnen uw klanten.

VeldVerplichtBeschrijving
nameJaNaam, maximaal 255 tekens.
emailNeeGeldig e-mailadres, uniek per klant.
phoneNeeTelefoonnummer.
company_nameNeeBedrijfsnaam.
vat_numberNeeBtw-nummer.
billing_addressNeeFactuuradres.
zip_code, city, countryNeePostcode, plaats en land.
notesNeeInterne notities.
Verzoek
curl -X POST "https://financial.gyvex.com/api/customer/store" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer UW_API_SLEUTEL" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "John Doe",
    "email": "john.doe@example.com",
    "phone": "+31612345678",
    "company_name": "Doe Enterprises",
    "vat_number": "NL123456789B01",
    "billing_address": "Voorbeeldstraat 1",
    "zip_code": "1234 AB",
    "city": "Amsterdam",
    "country": "Nederland"
  }'

Bij succes ontvangt u status 201 met de nieuwe klant en zijn id, die u daarna als customer_id gebruikt bij facturen en offertes.

PUT /customer/{customer}/update

Klant bijwerken

Werkt een klant bij. Alleen de meegestuurde velden worden gewijzigd. Gebruik de slug van de klant in de URL.

Parameter Beschrijving
name, email Alleen meegestuurde velden worden gewijzigd.
phone, company_name, vat_number Zie het aanmaken van een klant.
billing_address, zip_code, city, country Adresvelden geeft u samen mee.
customer_type consumer of business.
Verzoek
curl -X PUT "https://financial.gyvex.com/api/customer/john-doe/update" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer UW_API_SLEUTEL" \
  -H "Content-Type: application/json" \
  -d '{"phone": "+31698765432"}'
DELETE /customer/{customer}

Klant verwijderen

Verwijdert een klant. Een klant met facturen of offertes kan niet worden verwijderd (status 409). Bij succes volgt status 204.

Verzoek
curl -X DELETE "https://financial.gyvex.com/api/customer/john-doe" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer UW_API_SLEUTEL"

Hulp nodig bij uw koppeling?

Maak een ticket aan via "Mijn Gyvex" in uw dashboard. Met Premium krijgt u priority support, met reactie binnen 24 uur.