Examples
Complete curl examples for the EenFactuurMaken.nl REST API. Create, check, issue and email an invoice, mark it paid, credit it, send reminders and fetch VAT figures.
All examples use curl and jq. First put your key in a variable:
export EENFACTUURMAKEN_API_KEY=efm_your_key
export API=https://eenfactuurmaken.nl/api/v1Create 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.
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 $INVOICEDates, 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
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
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
curl -s -X POST "$API/invoices/$INVOICE/send" \
-H "Authorization: Bearer $EENFACTUURMAKEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "attachUbl": true }' | jq .statusWithout 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
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.xmlMarking as paid
Connect your own payment provider or bank: as soon as a payment comes in, mark the invoice.
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 .statusFinding an invoice by number, for example from the description of a bank payment:
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.
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:
CREDIT=$(curl -s -X POST "$API/invoices/$INVOICE/credit-note" \
-H "Authorization: Bearer $EENFACTUURMAKEN_API_KEY" | jq -r .id)Partially: replace the lines (positive amounts) and issue it:
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 .numberCrediting an invoice made outside EenFactuurMaken.nl: POST /invoices with "kind": "credit_note", "creditedInvoiceNumber" and "creditedInvoiceDate".
Reminders for overdue invoices
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)"'
doneWith Pro, EenFactuurMaken.nl can also do this automatically.
VAT figures for your return
curl -s "$API/stats?year=2026&quarter=3" \
-H "Authorization: Bearer $EENFACTUURMAKEN_API_KEY" | jq .vat.selectedYou get turnover and VAT per box (1a, 1b, 1c, 1e, 3a, 3b) plus exempt and KOR turnover. See VAT return.
Keeping track of changes
EenFactuurMaken.nl doesn't have webhooks (yet). To find out which invoices are new or paid, fetch the list periodically, newest first:
curl -s "$API/invoices?sort=-createdAt&pageSize=50" \
-H "Authorization: Bearer $EENFACTUURMAKEN_API_KEY"Stay within the rate limits: once every few minutes is plenty.
Last updated on 13 October 2026
Stuck?
Email us at support@eenfactuurmaken.nl. Tell us what you tried and what happened, and we will help you out.