Import
POST /v1/imports
Section titled “POST /v1/imports”Writes NOTHING. Validates every row and returns a report; POST /commit is what writes. Idempotent on the file’s content — submitting the same file twice is the same run, not 5.000 duplicates. Amounts are OPEN items (what is outstanding), not original invoice totals. Invoice numbers must be numeric: our series continues from yours.
Request body fields 20
| Field | Type | Required | Description |
|---|---|---|---|
customers | object[] | Yes | Field in the request payload. |
customers[].externalId | string | Yes | Field in the request payload. |
customers[].type | string | Yes | Resource-specific type. |
customers[].name | string | Yes | Human-readable name. |
customers[].cvr | string | No | Danish CVR number for a company. |
customers[].vatNumber | string | No | Foreign VAT number for a non-Danish company. |
customers[].email | string | No | E-mail used for delivery and contact. |
customers[].address | object | No | Postal address used on documents. |
customers[].address.street | string | No | Street and house number. |
customers[].address.postalCode | string | No | Postal code. |
customers[].address.city | string | No | City. |
customers[].address.country | string | No | ISO country code or country name. |
invoices | object[] | Yes | Field in the request payload. |
invoices[].externalId | string | Yes | Field in the request payload. |
invoices[].customerExternalId | string | Yes | Field in the request payload. |
invoices[].number | integer | Yes | Field in the request payload. |
invoices[].issuedDate | string | Yes | Field in the request payload. |
invoices[].dueDate | string | Yes | Due date in YYYY-MM-DD format. |
invoices[].openAmountOere | integer | Yes | Field in the request payload. |
invoices[].vatOere | integer | Yes | Field in the request payload. |
Request exampleapplication/json
curl -X POST https://api.rieckflow.com/v1/imports \ -H "Authorization: Bearer $RIECK_API_KEY" \ -H "Idempotency-Key: order-2041" \ -H "Content-Type: application/json" \ -d '{ "customers": [ { "externalId": "9b2f1c1e-…", "type": "company", "name": "Acme ApS", "cvr": "12345678", "email": "ap@acme.example" } ], "invoices": [ { "externalId": "9b2f1c1e-…", "customerExternalId": "9b2f1c1e-…", "number": "…", "issuedDate": "2026-08-15", "dueDate": "2026-08-15", "openAmountOere": 125000, "vatOere": 125000 } ] }'const svar = await rieck.request("POST", "/v1/imports", { body: { "customers": [ { "externalId": "9b2f1c1e-…", "type": "company", "name": "Acme ApS", "cvr": "12345678", "email": "ap@acme.example" } ], "invoices": [ { "externalId": "9b2f1c1e-…", "customerExternalId": "9b2f1c1e-…", "number": "…", "issuedDate": "2026-08-15", "dueDate": "2026-08-15", "openAmountOere": 125000, "vatOere": 125000 } ] },});{ "data": { "id": "9b2f1c1e-6b87-4d9b-91a0-47c8d72b8440", "status": "ready", "createdAt": "2026-08-04T09:32:11Z", "committedAt": null, "report": { "customers": 42, "invoices": 118, "openTotalOere": 8425000, "highestInvoiceNumber": 9018, "errors": [] } }}201 Success envelopeapplication/json
Response fields 3
| Field | Type | Description |
|---|---|---|
data.status | received | ready | failed | committed | Migration state. |
data.report | object | null | Dry-run totals and row-level validation errors. |
data.committedAt | date-time | null | Set once the validated migration is written. |
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": { "customers": { "maxItems": 5000, "type": "array", "items": { "type": "object", "properties": { "externalId": { "type": "string", "minLength": 1, "maxLength": 200 }, "type": { "type": "string", "enum": [ "person", "company" ] }, "name": { "type": "string", "minLength": 1, "maxLength": 200 }, "cvr": { "anyOf": [ { "type": "string", "pattern": "^\\d{8}$" }, { "type": "null" } ] }, "vatNumber": { "anyOf": [ { "type": "string", "maxLength": 20 }, { "type": "null" } ] }, "email": { "anyOf": [ { "type": "string", "maxLength": 254 }, { "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" } ] } }, "required": [ "externalId", "type", "name" ], "additionalProperties": false } }, "invoices": { "maxItems": 20000, "type": "array", "items": { "type": "object", "properties": { "externalId": { "type": "string", "minLength": 1, "maxLength": 200 }, "customerExternalId": { "type": "string", "minLength": 1, "maxLength": 200 }, "number": { "anyOf": [ { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, { "type": "string", "minLength": 1, "maxLength": 40 } ] }, "issuedDate": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" }, "dueDate": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" }, "openAmountOere": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "vatOere": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "externalId", "customerExternalId", "number", "issuedDate", "dueDate", "openAmountOere", "vatOere" ], "additionalProperties": false } } }, "required": [ "customers", "invoices" ], "additionalProperties": false}GET /v1/imports/{importId}
Section titled “GET /v1/imports/{importId}”| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
importId | path | string | Yes |
Request exampleNo request body
curl https://api.rieckflow.com/v1/imports/9b2f1c1e-… \ -H "Authorization: Bearer $RIECK_API_KEY"const svar = await rieck.request("GET", "/v1/imports/9b2f1c1e-…");{ "data": { "id": "9b2f1c1e-6b87-4d9b-91a0-47c8d72b8440", "status": "ready", "createdAt": "2026-08-04T09:32:11Z", "committedAt": null, "report": { "customers": 42, "invoices": 118, "openTotalOere": 8425000, "highestInvoiceNumber": 9018, "errors": [] } }}200 Success envelopeapplication/json
Response fields 3
| Field | Type | Description |
|---|---|---|
data.status | received | ready | failed | committed | Migration state. |
data.report | object | null | Dry-run totals and row-level validation errors. |
data.committedAt | date-time | null | Set once the validated migration is written. |
Possible errors 5
| 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. |
| 404 | import_not_found | The import run does not exist or belongs to another organisation. |
| 429 | rate_limited | The organisation’s rate budget is exhausted. |
POST /v1/imports/{importId}/commit
Section titled “POST /v1/imports/{importId}/commit”All or nothing, in one transaction, on the SAVED payload — a commit can never hit data other than what you had approved. Imported items are exempted from the reminder engine (they are past due by definition) and nothing is sent: no mails, no reminders. Committing twice is a no-op.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
importId | path | string | Yes |
Request exampleNo request body
curl -X POST https://api.rieckflow.com/v1/imports/9b2f1c1e-…/commit \ -H "Authorization: Bearer $RIECK_API_KEY" \ -H "Idempotency-Key: order-2041"const svar = await rieck.request("POST", "/v1/imports/9b2f1c1e-…/commit");{ "data": { "id": "9b2f1c1e-6b87-4d9b-91a0-47c8d72b8440", "status": "ready", "createdAt": "2026-08-04T09:32:11Z", "committedAt": null, "report": { "customers": 42, "invoices": 118, "openTotalOere": 8425000, "highestInvoiceNumber": 9018, "errors": [] } }}200 Success envelopeapplication/json
Response fields 3
| Field | Type | Description |
|---|---|---|
data.status | received | ready | failed | committed | Migration state. |
data.report | object | null | Dry-run totals and row-level validation errors. |
data.committedAt | date-time | null | Set once the validated migration is written. |
Possible errors 8
| 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. |
| 404 | import_not_found | The import run does not exist or belongs to another organisation. |
| 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. |