Direct naar inhoud

API-referentie

Klanten

Klanten zoeken, aanmaken, bijwerken en verwijderen, inclusief instellingen voor automatisch factureren.

Basis-URL: https://factora.one/api/v1

Overzicht

Pakketfeature customers. Een klantnaam is uniek binnen de organisatie. Aanmaken telt mee voor de klantlimiet van het pakket.

Klantvelden

VeldTypeRegels
namestringVerplicht bij aanmaken, max. 255, uniek binnen de organisatie
emailstringGeldig e-mailadres, max. 255
phonestringMax. 50
addressstringMax. 255
zipcodestringMax. 20
city, countrystringMax. 100
vat_number, coc_numberstringMax. 50
is_activebooleanStandaard true
portal_access_enabledbooleanToegang tot het klantenportaal
automatic_invoicing_enabledbooleanAutomatisch periodiek factureren
automatic_invoicing_intervalinteger1–999
automatic_invoicing_interval_unitstringweek, month, quarter of year
automatic_invoicing_dayinteger1–31 (bij week: 1–7); verplicht als automatisch factureren aan staat
automatic_invoicing_monthinteger1–12; verplicht bij year
automatic_invoicing_next_datedateVolgende factuurdatum
automatic_invoicing_auto_sendbooleanStandaard false

Endpoints

GET/customers

Klanten opvragen

Gepagineerde lijst, alfabetisch op naam.

Pakketfeature
customers
Recht (app-login)
customers.view

Queryparameters

  • searchstring

    Zoekt in naam, e-mail en plaats

  • per_pageinteger

    1–100, standaard 50

  • pageinteger

    Paginanummer

curl "https://factora.one/api/v1/customers?search=jansen" \
  -H "Authorization: Bearer $FACTORA_API_KEY" \
  -H "Accept: application/json"

200 Voorbeeldantwoord

{
  "data": {
    "current_page": 1,
    "data": [
      {
        "id": "9d3c6f1b-2a8e-4d1f-8b62-3e7f9c8d5a21",
        "name": "Jansen Bouw",
        "email": "info@jansenbouw.nl",
        "phone": "010-1234567",
        "address": "Hoofdstraat 1",
        "zipcode": "3011 AB",
        "city": "Rotterdam",
        "country": "NL",
        "vat_number": "NL123456789B01",
        "coc_number": "12345678",
        "is_active": true,
        "portal_access_enabled": false,
        "portal_last_login_at": null,
        "automatic_invoicing_enabled": false,
        "automatic_invoicing_interval": 1,
        "automatic_invoicing_interval_unit": "month",
        "automatic_invoicing_day": null,
        "automatic_invoicing_month": null,
        "automatic_invoicing_next_date": null,
        "automatic_invoicing_auto_send": false,
        "created_at": "2026-11-12T08:14:03.000000Z",
        "updated_at": "2026-11-12T08:14:03.000000Z"
      }
    ],
    "first_page_url": "https://factora.one/api/v1/customers?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://factora.one/api/v1/customers?page=1",
    "next_page_url": null,
    "path": "https://factora.one/api/v1/customers",
    "per_page": 50,
    "prev_page_url": null,
    "to": 1,
    "total": 1
  }
}
GET/customers/{id}

Klant tonen

Eén klant.

Pakketfeature
customers
Recht (app-login)
customers.view

Mogelijke fouten

  • 404Klant bestaat niet in deze organisatie
curl "https://factora.one/api/v1/customers/<id>" \
  -H "Authorization: Bearer $FACTORA_API_KEY" \
  -H "Accept: application/json"

200 Voorbeeldantwoord

{
  "data": {
    "id": "9d3c6f1b-2a8e-4d1f-8b62-3e7f9c8d5a21",
    "name": "Jansen Bouw",
    "email": "info@jansenbouw.nl",
    "phone": "010-1234567",
    "address": "Hoofdstraat 1",
    "zipcode": "3011 AB",
    "city": "Rotterdam",
    "country": "NL",
    "vat_number": "NL123456789B01",
    "coc_number": "12345678",
    "is_active": true,
    "portal_access_enabled": false,
    "portal_last_login_at": null,
    "automatic_invoicing_enabled": false,
    "automatic_invoicing_interval": 1,
    "automatic_invoicing_interval_unit": "month",
    "automatic_invoicing_day": null,
    "automatic_invoicing_month": null,
    "automatic_invoicing_next_date": null,
    "automatic_invoicing_auto_send": false,
    "created_at": "2026-11-12T08:14:03.000000Z",
    "updated_at": "2026-11-12T08:14:03.000000Z"
  }
}
POST/customers

Klant aanmaken

Maakt een klant aan. Zie de tabel klantvelden voor alle velden.

Pakketfeature
customers
Recht (app-login)
customers.manage

Mogelijke fouten

  • 422Validatiefout (bijv. naam bestaat al) of klantlimiet van het pakket bereikt
curl -X POST "https://factora.one/api/v1/customers" \
  -H "Authorization: Bearer $FACTORA_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Jansen Bouw",
    "email": "info@jansenbouw.nl",
    "phone": "010-1234567",
    "address": "Hoofdstraat 1",
    "zipcode": "3011 AB",
    "city": "Rotterdam",
    "country": "NL",
    "portal_access_enabled": false
  }'

201 Voorbeeldantwoord

{
  "data": {
    "id": "9d3c6f1b-2a8e-4d1f-8b62-3e7f9c8d5a21",
    "name": "Jansen Bouw",
    "email": "info@jansenbouw.nl",
    "phone": "010-1234567",
    "address": "Hoofdstraat 1",
    "zipcode": "3011 AB",
    "city": "Rotterdam",
    "country": "NL",
    "vat_number": "NL123456789B01",
    "coc_number": "12345678",
    "is_active": true,
    "portal_access_enabled": false,
    "portal_last_login_at": null,
    "automatic_invoicing_enabled": false,
    "automatic_invoicing_interval": 1,
    "automatic_invoicing_interval_unit": "month",
    "automatic_invoicing_day": null,
    "automatic_invoicing_month": null,
    "automatic_invoicing_next_date": null,
    "automatic_invoicing_auto_send": false,
    "created_at": "2026-11-12T08:14:03.000000Z",
    "updated_at": "2026-11-12T08:14:03.000000Z"
  }
}
PATCH/customers/{id}

Klant bijwerken

Werkt alleen de meegestuurde velden bij.

Pakketfeature
customers
Recht (app-login)
customers.manage
curl -X PATCH "https://factora.one/api/v1/customers/<id>" \
  -H "Authorization: Bearer $FACTORA_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "automatic_invoicing_enabled": true,
    "automatic_invoicing_interval": 1,
    "automatic_invoicing_interval_unit": "month",
    "automatic_invoicing_day": 1,
    "automatic_invoicing_next_date": "2026-12-01"
  }'

200 Voorbeeldantwoord

{
  "data": {
    "id": "9d3c6f1b-2a8e-4d1f-8b62-3e7f9c8d5a21",
    "name": "Jansen Bouw",
    "email": "info@jansenbouw.nl",
    "phone": "010-1234567",
    "address": "Hoofdstraat 1",
    "zipcode": "3011 AB",
    "city": "Rotterdam",
    "country": "NL",
    "vat_number": "NL123456789B01",
    "coc_number": "12345678",
    "is_active": true,
    "portal_access_enabled": false,
    "portal_last_login_at": null,
    "automatic_invoicing_enabled": true,
    "automatic_invoicing_interval": 1,
    "automatic_invoicing_interval_unit": "month",
    "automatic_invoicing_day": 1,
    "automatic_invoicing_month": null,
    "automatic_invoicing_next_date": "2026-12-01",
    "automatic_invoicing_auto_send": false,
    "created_at": "2026-11-12T08:14:03.000000Z",
    "updated_at": "2026-11-12T08:14:03.000000Z"
  }
}
DELETE/customers/{id}

Klant verwijderen

Kan alleen zonder open facturen, open offertes, klantabonnementen en actieve portaaltoegang. Anders 422 met blockers.

Pakketfeature
customers
Recht (app-login)
customers.manage

Mogelijke fouten

  • 422Verwijderen geblokkeerd; blockers bevat bijv. ["2 open facturen", "actieve klantenportaaltoegang"]
curl -X DELETE "https://factora.one/api/v1/customers/<id>" \
  -H "Authorization: Bearer $FACTORA_API_KEY" \
  -H "Accept: application/json"

200 Voorbeeldantwoord

{
  "message": "Klant verwijderd."
}