askledgerDocs
REST-APIContacts
Documentatie

Create a supplier

POST
/ledgers/{ledgerId}/suppliers

Create a supplier (purchase contact) in the accounting package, optionally with its IBAN and VAT number. This is a permanent change. First check with search-contacts (query, kvk or iban) that the supplier does not already exist; to complete or rename an existing supplier use update-supplier instead. The IBAN must have valid check digits (error invalid_iban), the VAT number a valid format and checksum (invalid_vat_number), and a KvK number must be in the KvK register under a name that fits (kvk_name_mismatch). The user must confirm before the supplier is created; possible duplicates are shown to them. If the result has created=false and a confirmation object, nothing was created yet: show confirmation.summary to the user verbatim and ask whether to create the supplier. Only after the user explicitly says yes in the chat, call create-supplier again with exactly the same arguments plus confirmationToken. Never confirm on the user's behalf and never reuse a token for other arguments. Pass the returned remoteId as supplierId to create-purchase-entry right away; its contact id (con_…) follows after the next sync, usually within a few minutes.

A write: over REST only LedgerSuite products with askledger:purchase-write can call it, after their user approved the write in the product (no confirmation is asked). Other callers get 403 confirmation_required and use the MCP tool, which asks the user to confirm. Purchase entries: 409 duplicate when the package already has the booking (same supplier and invoice number); nothing was booked then. Send an Idempotency-Key to make retries safe.

Requires the ledger:write scope (Wijzigen in Exact). Same operation as the MCP tool create-supplier.

Authorization

bearer
headerAuthorizationBearer <token>

A company group API key (al_live_…, created at /dashboard/api), an OAuth access token from the same authorization flow MCP clients use, or (other LedgerSuite products, /administrations routes only) a LedgerSuite client_credentials token.

Path Parameters

ledgerId*string

Ledger (administration) id, from list-ledgers

Length1 <= length

Header Parameters

Idempotency-Key?string

Unique per write (e.g. your own id for it), at most 255 characters. A retry with the same key and body gets the first response again (header Idempotent-Replayed: true) instead of a second write; the same key with another body answers 422 idempotency_key_reused, and a retry while the first request still runs 409 idempotency_in_progress. Kept for 7 days.

Lengthlength <= 255

Request Body

application/json
  1. body
name*string

Company or person name

Length1 <= length <= 255
email?string

Email address

Match^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
Formatemail
kvk?string

Dutch Chamber of Commerce (KvK) number, 8 digits

Match^\d{8}$
addressLine1?string

Street and house number, e.g. from search-kvk visitingAddress (the part before the comma)

Length1 <= length <= 100
postcode?string

Postcode, e.g. 1234 AB

Length1 <= length <= 20
city?string

City

Length1 <= length <= 50
country?string

ISO 3166-1 alpha-2 country code; defaults to NL when an address is given

Match^[A-Z]{2}$
iban?string

IBAN of the supplier, e.g. from its invoice

Length1 <= length <= 34
vatNumber?string

VAT number with country prefix, e.g. NL123456789B01

Length4 <= length <= 20

Response Body

OK

application/json
  1. response
created*boolean
message*string
confirmation*|null
contact*|null
curl -X POST "https://example.com/ledgers/string/suppliers" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{  "created": true,  "message": "string",  "confirmation": {    "token": "string",    "summary": "string",    "expiresInSeconds": 0  },  "contact": {    "ledgerId": "string",    "remoteId": "string",    "code": "string",    "name": "string",    "email": "string",    "kvk": "string",    "ibanSaved": true  }}