---
title: "Examples · EenFactuurMaken.nl"
description: "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."
url: "https://eenfactuurmaken.nl/en/docs/api/guides"
markdown_url: "https://eenfactuurmaken.nl/en/docs/api/guides.md"
language: "en-GB"
---

# 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](https://jqlang.org). First put your key in a variable:

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

## 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](https://eenfactuurmaken.nl/en/docs/invoices/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](https://eenfactuurmaken.nl/en/docs/invoices/sending).

### 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](https://eenfactuurmaken.nl/en/docs/vat/treatments).

## 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)
```

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"`.

## 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](https://eenfactuurmaken.nl/en/docs/reminders#automatic).

## 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](https://eenfactuurmaken.nl/en/docs/vat/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:

```bash
curl -s "$API/invoices?sort=-createdAt&pageSize=50" \
  -H "Authorization: Bearer $EENFACTUURMAKEN_API_KEY"
```

Stay within the [rate limits](https://eenfactuurmaken.nl/en/docs/api/errors#rate-limits): once every few minutes is plenty.

Last updated on 13 October 2026
