Orders
GET /v1/orders
Section titled “GET /v1/orders”| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
status | query | string | No | draft | confirmed | partially_invoiced | invoiced | cancelled |
customerId | query | string | No | Filter by customer |
limit | query | integer | No | Page size, 1-200 (default 50) |
cursor | query | string | No | Opaque cursor from meta.nextCursor |
curl https://api.rieckflow.com/v1/orders \ -H "Authorization: Bearer $RIECK_API_KEY"const svar = await rieck.request("GET", "/v1/orders");{ "data": [ {} ], "meta": { "nextCursor": null }}remainingOere is what is left to invoice; unpaidOere is what is left to PAY across the order’s invoices — an order can be fully invoiced and still have every krone outstanding.application/jsonPossible errors 5
| HTTP | Code | Meaning |
|---|---|---|
| 400 | invalid_cursor | The cursor is malformed, expired or belongs to another list shape. |
| 401 | invalid_api_key | The API key is missing, invalid, expired or revoked. |
| 403 | api_not_included | The organisation’s plan does not include API access. |
| 403 | insufficient_scope | The key does not have the required scope. |
| 429 | rate_limited | The organisation’s rate budget is exhausted. |
POST /v1/orders
Section titled “POST /v1/orders”Creates a DRAFT with the order’s own numbering series (never an invoice number). Lines are frozen when the order is confirmed; to change a confirmed order, create a new one. An order confirmation never collects money — a deposit is a real invoice, issued separately.
Request body fields 20
| Field | Type | Required | Description |
|---|---|---|---|
customerId | string | Yes | The customer this resource belongs to. |
heading | string | No | Custom document heading. |
customerReference | string | No | The customer’s reference printed on the invoice. |
senderReference | string | No | Your reference printed on the invoice. |
message | string | No | Free-text message printed in the document footer. |
deliveryDate | string | No | Field in the request payload. |
departmentCode | string | No | Field in the request payload. |
lines | object[] | Yes | Invoice or subscription line items. |
lines[].itemNumber | string | No | Your own item number printed on the invoice. |
lines[].description | string | Yes | Human-readable description. |
lines[].descriptionDetails | string | No | Optional detail printed below the line description. |
lines[].quantity | number | Yes | Positive quantity for this line. |
lines[].unitPriceOere | integer | Yes | Unit price in integer øre. |
lines[].vatRateBps | integer | No | VAT rate in basis points. 2500 means 25%. |
lines[].vatExemptionReason | string | No | Required legal reason when the VAT rate is zero. |
lines[].discount | object | No | Optional line-level percentage or amount discount. |
lines[].discount.type | string | Yes | Resource-specific type. |
lines[].discount.value | integer | Yes | Field in the request payload. |
lines[].accountId | string | No | Field in the request payload. |
lines[].unit | string | No | Field in the request payload. |
curl -X POST https://api.rieckflow.com/v1/orders \ -H "Authorization: Bearer $RIECK_API_KEY" \ -H "Idempotency-Key: order-2041" \ -H "Content-Type: application/json" \ -d '{ "customerId": "9b2f1c1e-…", "lines": [ { "description": "Consulting", "quantity": 1, "unitPriceOere": 125000, "vatRateBps": 2500 } ], "customerReference": "crm-9001", "senderReference": "crm-9001" }'const svar = await rieck.request("POST", "/v1/orders", { body: { "customerId": "9b2f1c1e-…", "lines": [ { "description": "Consulting", "quantity": 1, "unitPriceOere": 125000, "vatRateBps": 2500 } ], "customerReference": "crm-9001", "senderReference": "crm-9001" },});{ "data": {}}Possible errors 9
| HTTP | Code | Meaning |
|---|---|---|
| 400 | invalid_idempotency_key | Idempotency-Key is missing or malformed. |
| 400 | invalid_request | The request body or parameter failed validation. |
| 401 | invalid_api_key | The API key is missing, invalid, expired or revoked. |
| 403 | api_not_included | The organisation’s plan does not include API access. |
| 403 | insufficient_scope | The key does not have the required scope. |
| 409 | idempotency_conflict | The same key was used with a different request. |
| 409 | idempotency_in_progress | The same operation is currently being processed. Retry later. |
| 413 | payload_too_large | The JSON or uploaded file exceeds this endpoint’s size limit. |
| 429 | rate_limited | The organisation’s rate budget is exhausted. |
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)$" }, "heading": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 60 }, { "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" } ] }, "deliveryDate": { "anyOf": [ { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" }, { "type": "null" } ] }, "departmentCode": { "anyOf": [ { "type": "string", "pattern": "^\\d{1,2}$" }, { "type": "null" } ] }, "lines": { "minItems": 1, "maxItems": 100, "type": "array", "items": { "type": "object", "properties": { "itemNumber": { "type": "string", "minLength": 1, "maxLength": 60 }, "description": { "type": "string", "minLength": 1, "maxLength": 500 }, "descriptionDetails": { "type": "string", "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 } } }, "required": [ "customerId", "lines" ], "additionalProperties": false}POST /v1/orders/from-quote
Section titled “POST /v1/orders/from-quote”The quote must be accepted. Lines are COPIED, not shared — the quote stays a frozen record of what was offered. One quote becomes exactly one order: repeating the call — or calling for a quote the portal already converted — returns the existing order with 200 instead of creating a second one.
Request body fields 1
| Field | Type | Required | Description |
|---|---|---|---|
quoteId | string | Yes | Field in the request payload. |
curl -X POST https://api.rieckflow.com/v1/orders/from-quote \ -H "Authorization: Bearer $RIECK_API_KEY" \ -H "Idempotency-Key: order-2041" \ -H "Content-Type: application/json" \ -d '{ "quoteId": "9b2f1c1e-…" }'const svar = await rieck.request("POST", "/v1/orders/from-quote", { body: { "quoteId": "9b2f1c1e-…" },});{ "data": {}}Possible errors 9
| HTTP | Code | Meaning |
|---|---|---|
| 400 | invalid_idempotency_key | Idempotency-Key is missing or malformed. |
| 400 | invalid_request | The request body or parameter failed validation. |
| 401 | invalid_api_key | The API key is missing, invalid, expired or revoked. |
| 403 | api_not_included | The organisation’s plan does not include API access. |
| 403 | insufficient_scope | The key does not have the required scope. |
| 409 | idempotency_conflict | The same key was used with a different request. |
| 409 | idempotency_in_progress | The same operation is currently being processed. Retry later. |
| 413 | payload_too_large | The JSON or uploaded file exceeds this endpoint’s size limit. |
| 429 | rate_limited | The organisation’s rate budget is exhausted. |
Request body — fuldt JSON Schema
{ "type": "object", "properties": { "quoteId": { "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)$" } }, "required": [ "quoteId" ], "additionalProperties": false}GET /v1/orders/{orderId}
Section titled “GET /v1/orders/{orderId}”| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
orderId | path | string | Yes |
curl https://api.rieckflow.com/v1/orders/9b2f1c1e-… \ -H "Authorization: Bearer $RIECK_API_KEY"const svar = await rieck.request("GET", "/v1/orders/9b2f1c1e-…");{ "data": {}}invoicedQuantity and remainingQuantity, derived from the invoicing rows — never a counter.application/jsonPossible errors 4
| HTTP | Code | Meaning |
|---|---|---|
| 401 | invalid_api_key | The API key is missing, invalid, expired or revoked. |
| 403 | api_not_included | The organisation’s plan does not include API access. |
| 403 | insufficient_scope | The key does not have the required scope. |
| 429 | rate_limited | The organisation’s rate budget is exhausted. |
DELETE /v1/orders/{orderId}
Section titled “DELETE /v1/orders/{orderId}”Drafts only, and only drafts not born from a quote (422 order_not_deletable otherwise) — use cancel.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
orderId | path | string | Yes |
curl -X DELETE https://api.rieckflow.com/v1/orders/9b2f1c1e-… \ -H "Authorization: Bearer $RIECK_API_KEY" \ -H "Idempotency-Key: order-2041"const svar = await rieck.request("DELETE", "/v1/orders/9b2f1c1e-…");Possible errors 7
| HTTP | Code | Meaning |
|---|---|---|
| 400 | invalid_idempotency_key | Idempotency-Key is missing or malformed. |
| 401 | invalid_api_key | The API key is missing, invalid, expired or revoked. |
| 403 | api_not_included | The organisation’s plan does not include API access. |
| 403 | insufficient_scope | The key does not have the required scope. |
| 409 | idempotency_conflict | The same key was used with a different request. |
| 409 | idempotency_in_progress | The same operation is currently being processed. Retry later. |
| 429 | rate_limited | The organisation’s rate budget is exhausted. |
POST /v1/orders/{orderId}/confirm
Section titled “POST /v1/orders/{orderId}/confirm”One step, like the portal: freezes the content, seals the confirmation PDF (write-once) and sends it to the customer (e-mail, then Digital Post / letter when configured). Repeating the call on a confirmed order does not re-confirm — it RESENDS.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
orderId | path | string | Yes |
curl -X POST https://api.rieckflow.com/v1/orders/9b2f1c1e-…/confirm \ -H "Authorization: Bearer $RIECK_API_KEY" \ -H "Idempotency-Key: order-2041"const svar = await rieck.request("POST", "/v1/orders/9b2f1c1e-…/confirm");{ "data": {}}meta.delivery says what actually happened: channel is email | digital_post | letter | null. null means the order IS confirmed but the paper did not go out — fetch it from /pdf and send it yourself.application/jsonPossible errors 7
| HTTP | Code | Meaning |
|---|---|---|
| 400 | invalid_idempotency_key | Idempotency-Key is missing or malformed. |
| 401 | invalid_api_key | The API key is missing, invalid, expired or revoked. |
| 403 | api_not_included | The organisation’s plan does not include API access. |
| 403 | insufficient_scope | The key does not have the required scope. |
| 409 | idempotency_conflict | The same key was used with a different request. |
| 409 | idempotency_in_progress | The same operation is currently being processed. Retry later. |
| 429 | rate_limited | The organisation’s rate budget is exhausted. |
POST /v1/orders/{orderId}/invoice
Section titled “POST /v1/orders/{orderId}/invoice”Creates an invoice DRAFT from the order. Send lines with orderLineId + quantity to invoice a part; an empty body invoices the whole remainder. Quantities are validated in the database against the derived remainder (422 quantity_exceeds_remaining). Can be called repeatedly until status is invoiced. The confirmation PDF is attached to every invoice the order produces. Issue the draft with POST /v1/invoices/{id}/issue.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
orderId | path | string | Yes |
Request body fields 4
| Field | Type | Required | Description |
|---|---|---|---|
lines | object[] | No | Invoice or subscription line items. |
lines[].orderLineId | string | Yes | Field in the request payload. |
lines[].quantity | number | Yes | Positive quantity for this line. |
paymentTermsDays | integer | No | Number of days from issue date until payment is due. |
curl -X POST https://api.rieckflow.com/v1/orders/9b2f1c1e-…/invoice \ -H "Authorization: Bearer $RIECK_API_KEY" \ -H "Idempotency-Key: order-2041" \ -H "Content-Type: application/json" \ -d '{ "lines": [ { "orderLineId": "9b2f1c1e-…", "quantity": 1 } ] }'const svar = await rieck.request("POST", "/v1/orders/9b2f1c1e-…/invoice", { body: { "lines": [ { "orderLineId": "9b2f1c1e-…", "quantity": 1 } ] },});{ "data": {}}data.invoiceId (also in Location) and data.order with the new status and remaining quantities.application/jsonPossible errors 9
| HTTP | Code | Meaning |
|---|---|---|
| 400 | invalid_idempotency_key | Idempotency-Key is missing or malformed. |
| 400 | invalid_request | The request body or parameter failed validation. |
| 401 | invalid_api_key | The API key is missing, invalid, expired or revoked. |
| 403 | api_not_included | The organisation’s plan does not include API access. |
| 403 | insufficient_scope | The key does not have the required scope. |
| 409 | idempotency_conflict | The same key was used with a different request. |
| 409 | idempotency_in_progress | The same operation is currently being processed. Retry later. |
| 413 | payload_too_large | The JSON or uploaded file exceeds this endpoint’s size limit. |
| 429 | rate_limited | The organisation’s rate budget is exhausted. |
Request body — fuldt JSON Schema
{ "type": "object", "properties": { "lines": { "default": [], "maxItems": 100, "type": "array", "items": { "type": "object", "properties": { "orderLineId": { "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)$" }, "quantity": { "type": "number", "exclusiveMinimum": 0 } }, "required": [ "orderLineId", "quantity" ], "additionalProperties": false } }, "paymentTermsDays": { "anyOf": [ { "type": "integer", "minimum": 0, "maximum": 365 }, { "type": "null" } ] } }, "additionalProperties": false}POST /v1/orders/{orderId}/cancel
Section titled “POST /v1/orders/{orderId}/cancel”Closes what has not been invoiced. Invoices already produced remain. A fully invoiced order cannot be cancelled (422 order_not_cancellable) — the correction is a credit note. Idempotent.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
orderId | path | string | Yes |
curl -X POST https://api.rieckflow.com/v1/orders/9b2f1c1e-…/cancel \ -H "Authorization: Bearer $RIECK_API_KEY" \ -H "Idempotency-Key: order-2041"const svar = await rieck.request("POST", "/v1/orders/9b2f1c1e-…/cancel");{ "data": {}}Possible errors 7
| HTTP | Code | Meaning |
|---|---|---|
| 400 | invalid_idempotency_key | Idempotency-Key is missing or malformed. |
| 401 | invalid_api_key | The API key is missing, invalid, expired or revoked. |
| 403 | api_not_included | The organisation’s plan does not include API access. |
| 403 | insufficient_scope | The key does not have the required scope. |
| 409 | idempotency_conflict | The same key was used with a different request. |
| 409 | idempotency_in_progress | The same operation is currently being processed. Retry later. |
| 429 | rate_limited | The organisation’s rate budget is exhausted. |
GET /v1/orders/{orderId}/invoices
Section titled “GET /v1/orders/{orderId}/invoices”| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
orderId | path | string | Yes |
curl https://api.rieckflow.com/v1/orders/9b2f1c1e-…/invoices \ -H "Authorization: Bearer $RIECK_API_KEY"const svar = await rieck.request("GET", "/v1/orders/9b2f1c1e-…/invoices");{ "data": {}}Possible errors 4
| HTTP | Code | Meaning |
|---|---|---|
| 401 | invalid_api_key | The API key is missing, invalid, expired or revoked. |
| 403 | api_not_included | The organisation’s plan does not include API access. |
| 403 | insufficient_scope | The key does not have the required scope. |
| 429 | rate_limited | The organisation’s rate budget is exhausted. |
GET /v1/orders/{orderId}/timeline
Section titled “GET /v1/orders/{orderId}/timeline”| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
orderId | path | string | Yes |
curl https://api.rieckflow.com/v1/orders/9b2f1c1e-…/timeline \ -H "Authorization: Bearer $RIECK_API_KEY"const svar = await rieck.request("GET", "/v1/orders/9b2f1c1e-…/timeline");{ "data": {}}kind: created, confirmed, sent, resent, invoiced, invoice_released, cancelled.application/jsonPossible errors 4
| HTTP | Code | Meaning |
|---|---|---|
| 401 | invalid_api_key | The API key is missing, invalid, expired or revoked. |
| 403 | api_not_included | The organisation’s plan does not include API access. |
| 403 | insufficient_scope | The key does not have the required scope. |
| 429 | rate_limited | The organisation’s rate budget is exhausted. |
GET /v1/orders/{orderId}/pdf
Section titled “GET /v1/orders/{orderId}/pdf”Exists only after confirmation (404 order_pdf_not_found for a draft). Sealed once; a resend never redraws it.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
orderId | path | string | Yes |
curl https://api.rieckflow.com/v1/orders/9b2f1c1e-…/pdf \ -H "Authorization: Bearer $RIECK_API_KEY"const svar = await rieck.request("GET", "/v1/orders/9b2f1c1e-…/pdf");Possible errors 4
| HTTP | Code | Meaning |
|---|---|---|
| 401 | invalid_api_key | The API key is missing, invalid, expired or revoked. |
| 403 | api_not_included | The organisation’s plan does not include API access. |
| 403 | insufficient_scope | The key does not have the required scope. |
| 429 | rate_limited | The organisation’s rate budget is exhausted. |