Skip to content

Orders

List orders

orders:read
ParameterInTypeRequiredDescription
statusquerystringNodraft | confirmed | partially_invoiced | invoiced | cancelled
customerIdquerystringNoFilter by customer
limitqueryintegerNoPage size, 1-200 (default 50)
cursorquerystringNoOpaque cursor from meta.nextCursor
Request exampleNo request body
curl https://api.rieckflow.com/v1/orders \
-H "Authorization: Bearer $RIECK_API_KEY"
200 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/json
Possible errors 5
HTTPCodeMeaning
400invalid_cursorThe cursor is malformed, expired or belongs to another list shape.
401invalid_api_keyThe API key is missing, invalid, expired or revoked.
403api_not_includedThe organisation’s plan does not include API access.
403insufficient_scopeThe key does not have the required scope.
429rate_limitedThe organisation’s rate budget is exhausted.

Create order (draft)

orders:write

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
FieldTypeRequiredDescription
customerIdstringYesThe customer this resource belongs to.
headingstringNoCustom document heading.
customerReferencestringNoThe customer’s reference printed on the invoice.
senderReferencestringNoYour reference printed on the invoice.
messagestringNoFree-text message printed in the document footer.
deliveryDatestringNoField in the request payload.
departmentCodestringNoField in the request payload.
linesobject[]YesInvoice or subscription line items.
lines[].itemNumberstringNoYour own item number printed on the invoice.
lines[].descriptionstringYesHuman-readable description.
lines[].descriptionDetailsstringNoOptional detail printed below the line description.
lines[].quantitynumberYesPositive quantity for this line.
lines[].unitPriceOereintegerYesUnit price in integer øre.
lines[].vatRateBpsintegerNoVAT rate in basis points. 2500 means 25%.
lines[].vatExemptionReasonstringNoRequired legal reason when the VAT rate is zero.
lines[].discountobjectNoOptional line-level percentage or amount discount.
lines[].discount.typestringYesResource-specific type.
lines[].discount.valueintegerYesField in the request payload.
lines[].accountIdstringNoField in the request payload.
lines[].unitstringNoField in the request payload.
Request exampleapplication/json
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"
}'
201 Success envelopeapplication/json
Possible errors 9
HTTPCodeMeaning
400invalid_idempotency_keyIdempotency-Key is missing or malformed.
400invalid_requestThe request body or parameter failed validation.
401invalid_api_keyThe API key is missing, invalid, expired or revoked.
403api_not_includedThe organisation’s plan does not include API access.
403insufficient_scopeThe key does not have the required scope.
409idempotency_conflictThe same key was used with a different request.
409idempotency_in_progressThe same operation is currently being processed. Retry later.
413payload_too_largeThe JSON or uploaded file exceeds this endpoint’s size limit.
429rate_limitedThe 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
}

Create order from an accepted quote

orders:write

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
FieldTypeRequiredDescription
quoteIdstringYesField in the request payload.
Request exampleapplication/json
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-…"
}'
201 Success envelopeapplication/json
Possible errors 9
HTTPCodeMeaning
400invalid_idempotency_keyIdempotency-Key is missing or malformed.
400invalid_requestThe request body or parameter failed validation.
401invalid_api_keyThe API key is missing, invalid, expired or revoked.
403api_not_includedThe organisation’s plan does not include API access.
403insufficient_scopeThe key does not have the required scope.
409idempotency_conflictThe same key was used with a different request.
409idempotency_in_progressThe same operation is currently being processed. Retry later.
413payload_too_largeThe JSON or uploaded file exceeds this endpoint’s size limit.
429rate_limitedThe 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 order with lines

orders:read
ParameterInTypeRequiredDescription
orderIdpathstringYes
Request exampleNo request body
curl https://api.rieckflow.com/v1/orders/9b2f1c1e-… \
-H "Authorization: Bearer $RIECK_API_KEY"
200 Each line carries invoicedQuantity and remainingQuantity, derived from the invoicing rows — never a counter.application/json
Possible errors 4
HTTPCodeMeaning
401invalid_api_keyThe API key is missing, invalid, expired or revoked.
403api_not_includedThe organisation’s plan does not include API access.
403insufficient_scopeThe key does not have the required scope.
429rate_limitedThe organisation’s rate budget is exhausted.

Delete draft

orders:write

Drafts only, and only drafts not born from a quote (422 order_not_deletable otherwise) — use cancel.

ParameterInTypeRequiredDescription
orderIdpathstringYes
Request exampleNo request body
curl -X DELETE https://api.rieckflow.com/v1/orders/9b2f1c1e-… \
-H "Authorization: Bearer $RIECK_API_KEY" \
-H "Idempotency-Key: order-2041"
204 No contentNo response body
Possible errors 7
HTTPCodeMeaning
400invalid_idempotency_keyIdempotency-Key is missing or malformed.
401invalid_api_keyThe API key is missing, invalid, expired or revoked.
403api_not_includedThe organisation’s plan does not include API access.
403insufficient_scopeThe key does not have the required scope.
409idempotency_conflictThe same key was used with a different request.
409idempotency_in_progressThe same operation is currently being processed. Retry later.
429rate_limitedThe organisation’s rate budget is exhausted.

Confirm and send

orders:write

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.

ParameterInTypeRequiredDescription
orderIdpathstringYes
Request exampleNo request body
curl -X POST https://api.rieckflow.com/v1/orders/9b2f1c1e-…/confirm \
-H "Authorization: Bearer $RIECK_API_KEY" \
-H "Idempotency-Key: order-2041"
200 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/json
Possible errors 7
HTTPCodeMeaning
400invalid_idempotency_keyIdempotency-Key is missing or malformed.
401invalid_api_keyThe API key is missing, invalid, expired or revoked.
403api_not_includedThe organisation’s plan does not include API access.
403insufficient_scopeThe key does not have the required scope.
409idempotency_conflictThe same key was used with a different request.
409idempotency_in_progressThe same operation is currently being processed. Retry later.
429rate_limitedThe organisation’s rate budget is exhausted.

Invoice the order (fully or partially)

orders:write

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.

ParameterInTypeRequiredDescription
orderIdpathstringYes
Request body fields 4
FieldTypeRequiredDescription
linesobject[]NoInvoice or subscription line items.
lines[].orderLineIdstringYesField in the request payload.
lines[].quantitynumberYesPositive quantity for this line.
paymentTermsDaysintegerNoNumber of days from issue date until payment is due.
Request exampleapplication/json
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
}
]
}'
201 data.invoiceId (also in Location) and data.order with the new status and remaining quantities.application/json
Possible errors 9
HTTPCodeMeaning
400invalid_idempotency_keyIdempotency-Key is missing or malformed.
400invalid_requestThe request body or parameter failed validation.
401invalid_api_keyThe API key is missing, invalid, expired or revoked.
403api_not_includedThe organisation’s plan does not include API access.
403insufficient_scopeThe key does not have the required scope.
409idempotency_conflictThe same key was used with a different request.
409idempotency_in_progressThe same operation is currently being processed. Retry later.
413payload_too_largeThe JSON or uploaded file exceeds this endpoint’s size limit.
429rate_limitedThe 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
}

Cancel the open remainder

orders:write

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.

ParameterInTypeRequiredDescription
orderIdpathstringYes
Request exampleNo request body
curl -X POST https://api.rieckflow.com/v1/orders/9b2f1c1e-…/cancel \
-H "Authorization: Bearer $RIECK_API_KEY" \
-H "Idempotency-Key: order-2041"
200 Success envelopeapplication/json
Possible errors 7
HTTPCodeMeaning
400invalid_idempotency_keyIdempotency-Key is missing or malformed.
401invalid_api_keyThe API key is missing, invalid, expired or revoked.
403api_not_includedThe organisation’s plan does not include API access.
403insufficient_scopeThe key does not have the required scope.
409idempotency_conflictThe same key was used with a different request.
409idempotency_in_progressThe same operation is currently being processed. Retry later.
429rate_limitedThe organisation’s rate budget is exhausted.

Invoices produced by the order

orders:read
ParameterInTypeRequiredDescription
orderIdpathstringYes
Request exampleNo request body
curl https://api.rieckflow.com/v1/orders/9b2f1c1e-…/invoices \
-H "Authorization: Bearer $RIECK_API_KEY"
200 Oldest first, with each invoice’s status and balance. This is the read path partial invoicing depends on.application/json
Possible errors 4
HTTPCodeMeaning
401invalid_api_keyThe API key is missing, invalid, expired or revoked.
403api_not_includedThe organisation’s plan does not include API access.
403insufficient_scopeThe key does not have the required scope.
429rate_limitedThe organisation’s rate budget is exhausted.

Order timeline

orders:read
ParameterInTypeRequiredDescription
orderIdpathstringYes
Request exampleNo request body
curl https://api.rieckflow.com/v1/orders/9b2f1c1e-…/timeline \
-H "Authorization: Bearer $RIECK_API_KEY"
200 Newest first. kind: created, confirmed, sent, resent, invoiced, invoice_released, cancelled.application/json
Possible errors 4
HTTPCodeMeaning
401invalid_api_keyThe API key is missing, invalid, expired or revoked.
403api_not_includedThe organisation’s plan does not include API access.
403insufficient_scopeThe key does not have the required scope.
429rate_limitedThe organisation’s rate budget is exhausted.

Order confirmation PDF (write-once)

orders:read

Exists only after confirmation (404 order_pdf_not_found for a draft). Sealed once; a resend never redraws it.

ParameterInTypeRequiredDescription
orderIdpathstringYes
Request exampleNo request body
curl https://api.rieckflow.com/v1/orders/9b2f1c1e-…/pdf \
-H "Authorization: Bearer $RIECK_API_KEY"
200 Success envelopeapplication/pdf
Possible errors 4
HTTPCodeMeaning
401invalid_api_keyThe API key is missing, invalid, expired or revoked.
403api_not_includedThe organisation’s plan does not include API access.
403insufficient_scopeThe key does not have the required scope.
429rate_limitedThe organisation’s rate budget is exhausted.