Invoices
GET /v1/invoices
Section titled “GET /v1/invoices”List invoices
Scope: invoices:read
| Query | |
|---|---|
status | draft | issued | paid | overdue | collections |
customerId | Filter by customer |
externalReference | Exact match on your own reference |
limit | Page size, 1-200 (default 50) |
cursor | Opaque cursor from meta.nextCursor |
curl https://app.rieck.nu/api/v1/invoices \ -H "Authorization: Bearer $RIECK_API_KEY"const svar = await rieck.request("GET", "/v1/invoices");POST /v1/invoices
Section titled “POST /v1/invoices”Create invoice (one-call shortcut)
Creates a draft — or with ?issue=true / ?send=true the whole chain (inline customer does find-or-create and requires customers:write). Issue = number + hash-locked PDF, atomically.
Scope: invoices:write
| Query | |
|---|---|
issue | true = issue in the same transaction |
send | true = issue and send (send outcome in meta.send — never rolls back the invoice) |
curl -X POST https://app.rieck.nu/api/v1/invoices \ -H "Authorization: Bearer $RIECK_API_KEY" \ -H "Idempotency-Key: order-2041" \ -d '{ "lines": [ { "description": "Consulting", "quantity": 1, "unitPriceOere": 125000, "vatRateBps": 2500, "accountId": "9b2f1c1e-…" } ], "customer": { "type": "person", "name": "Acme ApS", "cvr": "12345678", "email": "ap@acme.example", "phone": "+45 70 12 34 56" }, "dueDate": "2026-08-15" }'const svar = await rieck.request("POST", "/v1/invoices", { body: { "lines": [ { "description": "Consulting", "quantity": 1, "unitPriceOere": 125000, "vatRateBps": 2500, "accountId": "9b2f1c1e-…" } ], "customer": { "type": "person", "name": "Acme ApS", "cvr": "12345678", "email": "ap@acme.example", "phone": "+45 70 12 34 56" }, "dueDate": "2026-08-15" },});Request body — fuldt JSON Schema
{ "type": "object", "properties": { "customerId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "customer": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "person", "company" ] }, "name": { "type": "string", "minLength": 1, "maxLength": 200 }, "cvr": { "anyOf": [ { "type": "string", "pattern": "^\\d{8}$" }, { "type": "null" } ] }, "address": { "anyOf": [ { "type": "object", "properties": { "street": { "type": "string", "maxLength": 200 }, "postalCode": { "type": "string", "maxLength": 10 }, "city": { "type": "string", "maxLength": 100 }, "country": { "type": "string", "maxLength": 100 } }, "additionalProperties": false }, { "type": "null" } ] }, "email": { "anyOf": [ { "type": "string", "maxLength": 254 }, { "type": "null" } ] }, "phone": { "anyOf": [ { "type": "string", "maxLength": 30 }, { "type": "null" } ] }, "contactPerson": { "anyOf": [ { "type": "string", "maxLength": 200 }, { "type": "null" } ] }, "language": { "anyOf": [ { "type": "string", "enum": [ "da", "en" ] }, { "type": "null" } ] }, "externalReference": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 200 }, { "type": "null" } ] }, "metadata": { "anyOf": [ { "type": "object", "propertyNames": { "type": "string", "minLength": 1, "maxLength": 40 }, "additionalProperties": { "type": "string", "maxLength": 500 } }, { "type": "null" } ] } }, "required": [ "type", "name" ], "additionalProperties": false }, "lines": { "minItems": 1, "maxItems": 100, "type": "array", "items": { "type": "object", "properties": { "description": { "type": "string", "minLength": 1, "maxLength": 500 }, "quantity": { "type": "number", "exclusiveMinimum": 0, "maximum": 999999 }, "unitPriceOere": { "type": "integer", "minimum": 0, "maximum": 100000000000 }, "vatRateBps": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "vatExemptionReason": { "anyOf": [ { "type": "string", "enum": [ "ML13", "OMVENDT", "EU_VARE", "EKSPORT" ] }, { "type": "null" } ] }, "discount": { "anyOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "percent", "amount" ] }, "value": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "type", "value" ], "additionalProperties": false }, { "type": "null" } ] }, "accountId": { "anyOf": [ { "type": "string", "maxLength": 100 }, { "type": "null" } ] }, "unit": { "anyOf": [ { "type": "string", "maxLength": 20 }, { "type": "null" } ] } }, "required": [ "description", "quantity", "unitPriceOere" ], "additionalProperties": false } }, "dueDate": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" }, "paymentTermsDays": { "anyOf": [ { "type": "integer", "minimum": 0, "maximum": 365 }, { "type": "null" } ] }, "customerReference": { "anyOf": [ { "type": "string", "maxLength": 140 }, { "type": "null" } ] }, "senderReference": { "anyOf": [ { "type": "string", "maxLength": 140 }, { "type": "null" } ] }, "message": { "anyOf": [ { "type": "string", "maxLength": 2000 }, { "type": "null" } ] }, "heading": { "anyOf": [ { "type": "string", "maxLength": 60 }, { "type": "null" } ] }, "externalReference": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 200 }, { "type": "null" } ] }, "metadata": { "anyOf": [ { "type": "object", "propertyNames": { "type": "string", "minLength": 1, "maxLength": 40 }, "additionalProperties": { "type": "string", "maxLength": 500 } }, { "type": "null" } ] } }, "required": [ "lines" ], "additionalProperties": false}GET /v1/invoices/{invoiceId}
Section titled “GET /v1/invoices/{invoiceId}”Get invoice with lines
Scope: invoices:read
curl https://app.rieck.nu/api/v1/invoices/9b2f1c1e-… \ -H "Authorization: Bearer $RIECK_API_KEY"const svar = await rieck.request("GET", "/v1/invoices/9b2f1c1e-…");PUT /v1/invoices/{invoiceId}
Section titled “PUT /v1/invoices/{invoiceId}”Replace draft
Full replacement of a DRAFT (issued invoices are immutable).
Scope: invoices:write
curl -X PUT https://app.rieck.nu/api/v1/invoices/9b2f1c1e-… \ -H "Authorization: Bearer $RIECK_API_KEY" \ -H "Idempotency-Key: order-2041" \ -d '{ "customerId": "9b2f1c1e-…", "lines": [ { "description": "Consulting", "quantity": 1, "unitPriceOere": 125000, "vatRateBps": 2500, "accountId": "9b2f1c1e-…" } ], "dueDate": "2026-08-15", "customerReference": "crm-9001", "senderReference": "crm-9001" }'const svar = await rieck.request("PUT", "/v1/invoices/9b2f1c1e-…", { body: { "customerId": "9b2f1c1e-…", "lines": [ { "description": "Consulting", "quantity": 1, "unitPriceOere": 125000, "vatRateBps": 2500, "accountId": "9b2f1c1e-…" } ], "dueDate": "2026-08-15", "customerReference": "crm-9001", "senderReference": "crm-9001" },});Request body — fuldt JSON Schema
{ "type": "object", "properties": { "customerId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "lines": { "minItems": 1, "maxItems": 100, "type": "array", "items": { "type": "object", "properties": { "description": { "type": "string", "minLength": 1, "maxLength": 500 }, "quantity": { "type": "number", "exclusiveMinimum": 0, "maximum": 999999 }, "unitPriceOere": { "type": "integer", "minimum": 0, "maximum": 100000000000 }, "vatRateBps": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "vatExemptionReason": { "anyOf": [ { "type": "string", "enum": [ "ML13", "OMVENDT", "EU_VARE", "EKSPORT" ] }, { "type": "null" } ] }, "discount": { "anyOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "percent", "amount" ] }, "value": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "type", "value" ], "additionalProperties": false }, { "type": "null" } ] }, "accountId": { "anyOf": [ { "type": "string", "maxLength": 100 }, { "type": "null" } ] }, "unit": { "anyOf": [ { "type": "string", "maxLength": 20 }, { "type": "null" } ] } }, "required": [ "description", "quantity", "unitPriceOere" ], "additionalProperties": false } }, "dueDate": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" }, "paymentTermsDays": { "anyOf": [ { "type": "integer", "minimum": 0, "maximum": 365 }, { "type": "null" } ] }, "customerReference": { "anyOf": [ { "type": "string", "maxLength": 140 }, { "type": "null" } ] }, "senderReference": { "anyOf": [ { "type": "string", "maxLength": 140 }, { "type": "null" } ] }, "message": { "anyOf": [ { "type": "string", "maxLength": 2000 }, { "type": "null" } ] }, "heading": { "anyOf": [ { "type": "string", "maxLength": 60 }, { "type": "null" } ] }, "externalReference": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 200 }, { "type": "null" } ] }, "metadata": { "anyOf": [ { "type": "object", "propertyNames": { "type": "string", "minLength": 1, "maxLength": 40 }, "additionalProperties": { "type": "string", "maxLength": 500 } }, { "type": "null" } ] } }, "required": [ "customerId", "lines" ], "additionalProperties": false}DELETE /v1/invoices/{invoiceId}
Section titled “DELETE /v1/invoices/{invoiceId}”Delete draft
Scope: invoices:write
curl -X DELETE https://app.rieck.nu/api/v1/invoices/9b2f1c1e-… \ -H "Authorization: Bearer $RIECK_API_KEY" \ -H "Idempotency-Key: order-2041"const svar = await rieck.request("DELETE", "/v1/invoices/9b2f1c1e-…");POST /v1/invoices/{invoiceId}/issue
Section titled “POST /v1/invoices/{invoiceId}/issue”Issue invoice
Assigns the next number in the unbroken series and locks the PDF.
Scope: invoices:write
curl -X POST https://app.rieck.nu/api/v1/invoices/9b2f1c1e-…/issue \ -H "Authorization: Bearer $RIECK_API_KEY" \ -H "Idempotency-Key: order-2041"const svar = await rieck.request("POST", "/v1/invoices/9b2f1c1e-…/issue");POST /v1/invoices/{invoiceId}/send
Section titled “POST /v1/invoices/{invoiceId}/send”Send invoice to customer
Scope: invoices:write
curl -X POST https://app.rieck.nu/api/v1/invoices/9b2f1c1e-…/send \ -H "Authorization: Bearer $RIECK_API_KEY" \ -H "Idempotency-Key: order-2041"const svar = await rieck.request("POST", "/v1/invoices/9b2f1c1e-…/send");GET /v1/invoices/{invoiceId}/pdf
Section titled “GET /v1/invoices/{invoiceId}/pdf”Invoice PDF (WORM)
Scope: invoices:read
curl https://app.rieck.nu/api/v1/invoices/9b2f1c1e-…/pdf \ -H "Authorization: Bearer $RIECK_API_KEY"const svar = await rieck.request("GET", "/v1/invoices/9b2f1c1e-…/pdf");GET /v1/invoices/{invoiceId}/timeline
Section titled “GET /v1/invoices/{invoiceId}/timeline”Invoice timeline
Scope: invoices:read
curl https://app.rieck.nu/api/v1/invoices/9b2f1c1e-…/timeline \ -H "Authorization: Bearer $RIECK_API_KEY"const svar = await rieck.request("GET", "/v1/invoices/9b2f1c1e-…/timeline");POST /v1/invoices/{invoiceId}/collect
Section titled “POST /v1/invoices/{invoiceId}/collect”Hand over to debt collection
The bridge: creates a collection case from the invoice. §9b prerequisites are enforced.
Scope: cases:write
curl -X POST https://app.rieck.nu/api/v1/invoices/9b2f1c1e-…/collect \ -H "Authorization: Bearer $RIECK_API_KEY" \ -H "Idempotency-Key: order-2041"const svar = await rieck.request("POST", "/v1/invoices/9b2f1c1e-…/collect");