Skip to content

Examples

Complete curl examples for the EenFactuurMaken.nl REST API. Create and issue an invoice, email it, mark it paid, credit it, send reminders and keep your system in sync.

All examples use curl and jq. First put your key in a variable:

bash
export EENFACTUURMAKEN_API_KEY=efm_your_key
export API=https://eenfactuurmaken.nl/api/v1

Create and issue in one go

Already know the invoice is right, for example because it comes from your web shop? Then create and issue it in one request with "issue": true. With an externalId and an Idempotency-Key, retrying is safe:

bash
curl -s -X POST "$API/invoices" \
  -H "Authorization: Bearer $EENFACTUURMAKEN_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "externalId": "order-1042",
    "customerExternalId": "cus_9",
    "issue": true,
    "lines": [ { "description": "Annual subscription", "quantity": "1", "unitPriceCents": 12000, "vatRate": "21" } ]
  }' | jq '{id, number, status, totalCents}'

You get the issued invoice back. If something goes wrong (the checks, your monthly limit, a number that's taken), nothing has been created. The full approach is under Integrate with your SaaS.

Create and send an invoice

1. Create a draft

With a new customer included (it's created at the same time). Use customerId for an existing customer.

bash
INVOICE=$(curl -s -X POST "$API/invoices" \
  -H "Authorization: Bearer $EENFACTUURMAKEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "customer": {
      "type": "business",
      "name": "Bakkerij De Gouden Korst",
      "email": "administratie@goudenkorst.nl",
      "addressLine1": "Dorpsstraat 1",
      "postalCode": "1234 AB",
      "city": "Utrecht",
      "country": "NL",
      "kvkNumber": "12345678"
    },
    "reference": "Website 2026",
    "lines": [
      { "description": "Web design", "quantity": "12", "unit": "HUR", "unitPriceCents": 8500, "vatRate": "21" },
      { "description": "Hosting (year)", "quantity": "1", "unitPriceCents": 12000, "vatRate": "21" }
    ]
  }' | jq -r .id)
echo $INVOICE

Dates, payment term, language and VAT treatment come from the customer and your settings. The response is the complete invoice object, with totalCents (here 137940) and compliance.

2. Check it

bash
curl -s "$API/invoices/$INVOICE/compliance" \
  -H "Authorization: Bearer $EENFACTUURMAKEN_API_KEY" | jq '.[] | select(.level=="error")'

No output means: no errors. See Invoice checks for all codes.

3. Issue it

bash
curl -s -X POST "$API/invoices/$INVOICE/issue" \
  -H "Authorization: Bearer $EENFACTUURMAKEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}' | jq '{number, status, publicUrl}'

You can pass "number" for your own number, or "issueDate" for a different invoice date. This can't be undone.

4. Email it

bash
curl -s -X POST "$API/invoices/$INVOICE/send" \
  -H "Authorization: Bearer $EENFACTUURMAKEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "attachUbl": true }' | jq .status

Without to, the email goes to the customer's email address (and cc). You can pass to, cc, subject and message (placeholders like {number} work). See Sending by email.

5. Download the PDF and UBL

bash
curl -s "$API/invoices/$INVOICE/pdf?download=1" \
  -H "Authorization: Bearer $EENFACTUURMAKEN_API_KEY" -o invoice.pdf
curl -s "$API/invoices/$INVOICE/ubl" \
  -H "Authorization: Bearer $EENFACTUURMAKEN_API_KEY" -o invoice.xml

Marking as paid

Connect your own payment provider or bank: as soon as a payment comes in, mark the invoice.

bash
curl -s -X POST "$API/invoices/$INVOICE/mark-paid" \
  -H "Authorization: Bearer $EENFACTUURMAKEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "paidAt": "2026-10-20" }' | jq .status

Finding an invoice by number, for example from the description of a bank payment:

bash
curl -s "$API/invoices?q=2026-0042&kind=invoice" \
  -H "Authorization: Bearer $EENFACTUURMAKEN_API_KEY" | jq '.data[] | {id, number, totalCents, displayStatus}'

Made a mistake? POST /invoices/{id}/mark-unpaid reverts it.

Reverse charge and EU customers

Pass vatTreatment (and for EU and foreign customers supplyType). The customer then needs a VAT number.

bash
curl -s -X POST "$API/invoices" \
  -H "Authorization: Bearer $EENFACTUURMAKEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "customer": { "name": "Muster GmbH", "country": "DE", "vatNumber": "DE123456789",
                  "addressLine1": "Hauptstraße 5", "postalCode": "10115", "city": "Berlin" },
    "vatTreatment": "intra_eu",
    "supplyType": "services",
    "locale": "de",
    "lines": [ { "description": "Beratung", "quantity": "8", "unit": "HUR", "unitPriceCents": 9500 } ]
  }' | jq '{id, vatTreatment, vatTotalCents, totalCents}'

Values for vatTreatment: standard, reverse_charge, intra_eu, export, kor, exempt (with vatExemptionReason). See Choosing a VAT treatment.

Crediting

Credit the full invoice, as a draft:

bash
CREDIT=$(curl -s -X POST "$API/invoices/$INVOICE/credit-note" \
  -H "Authorization: Bearer $EENFACTUURMAKEN_API_KEY" | jq -r .id)

To give the credit note your own id, send a body: -H "Content-Type: application/json" -d '{"externalId": "refund-1042"}'.

Partially: replace the lines (positive amounts) and issue it:

bash
curl -s -X PATCH "$API/invoices/$CREDIT" \
  -H "Authorization: Bearer $EENFACTUURMAKEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "lines": [ { "description": "Web design discount", "quantity": "1", "unitPriceCents": 20000, "vatRate": "21" } ] }'

curl -s -X POST "$API/invoices/$CREDIT/issue" \
  -H "Authorization: Bearer $EENFACTUURMAKEN_API_KEY" \
  -H "Content-Type: application/json" -d '{}' | jq .number

Crediting an invoice made outside EenFactuurMaken.nl: POST /invoices with "kind": "credit_note", "creditedInvoiceNumber" and "creditedInvoiceDate".

Create a quote and turn it into an invoice

A quote (/quotes) is separate from your invoices: free on every plan, with its own number series (default OFF{YYYY}-{SEQ:4}) and no UBL. Create a draft, email it (a draft is finalised first) and convert it once your customer agrees:

bash
QUOTE=$(curl -s -X POST "$API/quotes" \
  -H "Authorization: Bearer $EENFACTUURMAKEN_API_KEY" -H "Content-Type: application/json" \
  -d '{"customerId":"…","validUntil":"2026-10-31","lines":[{"description":"Web design","quantity":"40","unit":"HUR","unitPriceCents":8500,"vatRate":"21"}]}' | jq -r .id)

curl -s -X POST "$API/quotes/$QUOTE/send" -H "Authorization: Bearer $EENFACTUURMAKEN_API_KEY"

# Customer agreed: the quote becomes "accepted" and you get a draft invoice back
curl -s -X POST "$API/quotes/$QUOTE/accept" \
  -H "Authorization: Bearer $EENFACTUURMAKEN_API_KEY" | jq '{quote: .quote.status, invoice: .invoice.id}'

The draft invoice gets the customer, lines, currency, VAT treatment, language and notes of the quote, with the quote reference (or "Quote OFF2026-0001") as its reference. That invoice counts towards your monthly limit; when it's used up you get 402 plan_limit_reached and the quote stays as it was. If your customer passes, use POST /quotes/{id}/decline (and /reopen to undo that).

Reminders for overdue invoices

bash
for id in $(curl -s "$API/invoices?status=overdue&pageSize=100" \
  -H "Authorization: Bearer $EENFACTUURMAKEN_API_KEY" | jq -r '.data[].id'); do
  curl -s -X POST "$API/invoices/$id/remind" \
    -H "Authorization: Bearer $EENFACTUURMAKEN_API_KEY" | jq -r '"\(.number): \(.reminderCount) reminder(s)"'
done

With Pro, EenFactuurMaken.nl can also do this automatically.

VAT figures for your return

bash
curl -s "$API/stats?year=2026&quarter=3" \
  -H "Authorization: Bearer $EENFACTUURMAKEN_API_KEY" | jq .vat.selected

You get turnover and VAT per box (1a, 1b, 1c, 1e, 3a, 3b) plus exempt and KOR turnover. See VAT return.

Keeping in sync

With Pro you don't have to keep asking what changed: webhooks send a message to your own URL as soon as an invoice is issued, sent, paid or cancelled.

Without webhooks, or as a check next to them, fetch the list periodically. For example the invoices that have been paid, or the newest ones:

bash
curl -s "$API/invoices?status=paid&sort=-createdAt&pageSize=50" \
  -H "Authorization: Bearer $EENFACTUURMAKEN_API_KEY" | jq '.data[] | {id, number, externalId, paidAt}'
curl -s "$API/invoices?sort=-createdAt&pageSize=50" \
  -H "Authorization: Bearer $EENFACTUURMAKEN_API_KEY"

Even with webhooks it's wise to do this now and then: we send no webhooks while our support team helps you, and what you missed while you weren't on Pro isn't sent afterwards. Stay within the rate limits: once every few minutes is plenty.

Last updated on 29 October 2026

Stuck?

Email us at support@eenfactuurmaken.nl. Tell us what you tried and what happened, and we will help you out.

support@eenfactuurmaken.nl