curl --request POST \
--url http://localhost:3500/v1/invoices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"supplier_id": "11111111-1111-4111-8111-111111111111",
"recipient_id": "22222222-2222-4222-8222-222222222222",
"invoice_number": "INV-2026-001",
"category": "invoice",
"issued_date": "2026-09-07",
"currency_code": "NOK",
"total_amount_including_vat": "125.00",
"line_items": [
{
"line_number": 1,
"description": "Consulting",
"quantity": "1",
"unit_price": "100.00",
"vat_rate": "0.25",
"total_excluding_vat": "100.00"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
supplier_id: '11111111-1111-4111-8111-111111111111',
recipient_id: '22222222-2222-4222-8222-222222222222',
invoice_number: 'INV-2026-001',
category: 'invoice',
issued_date: '2026-09-07',
currency_code: 'NOK',
total_amount_including_vat: '125.00',
line_items: [
{
line_number: 1,
description: 'Consulting',
quantity: '1',
unit_price: '100.00',
vat_rate: '0.25',
total_excluding_vat: '100.00'
}
]
})
};
fetch('http://localhost:3500/v1/invoices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "http://localhost:3500/v1/invoices"
payload = {
"supplier_id": "11111111-1111-4111-8111-111111111111",
"recipient_id": "22222222-2222-4222-8222-222222222222",
"invoice_number": "INV-2026-001",
"category": "invoice",
"issued_date": "2026-09-07",
"currency_code": "NOK",
"total_amount_including_vat": "125.00",
"line_items": [
{
"line_number": 1,
"description": "Consulting",
"quantity": "1",
"unit_price": "100.00",
"vat_rate": "0.25",
"total_excluding_vat": "100.00"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"extraction_confirmed": true,
"extraction_confirmed_at": "2023-11-07T05:31:56Z",
"extraction_confirmed_by_user_id": "<string>",
"invoice_number": "<string>",
"title": "<string>",
"category": "invoice",
"issued_date": "2023-12-25",
"due_date": "2023-12-25",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"currency_code": "<string>",
"total_amount_excluding_vat": "1250.00",
"total_amount_including_vat": "1250.00",
"financially_valid": true,
"financial_errors": [
{
"code": "missing_financial_inputs",
"field": "<string>",
"message": "<string>"
}
],
"alert_summary": {
"scope": {
"type": "invoice",
"agreement_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"checks": {
"status": "not_checkable",
"completed": 1,
"total": 1,
"reasons": [
"credit_note"
]
},
"counts": {
"pending": 1,
"claimed": 1,
"dismissed": 1,
"credited": 1
},
"is_fully_credited": true,
"has_credit_note_match": true
},
"supplier_name": "<string>",
"recipient_name": "<string>",
"review_recommended": true,
"extraction_confidence": "high",
"relationships": {
"linked_credit_note_count": 1,
"matched_invoice_count": 1,
"line_item_count": 123,
"document_count": 123,
"agreement_match_count": 123,
"alert_count": 123
},
"supplier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"recipient_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"supplier_snapshot": {
"name": "<string>",
"organization_number": "<string>",
"main_name": "<string>",
"department": "<string>",
"email": "<string>",
"website": "<string>",
"address": {
"street": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country_code": "<string>"
}
},
"recipient_snapshot": {
"name": "<string>",
"organization_number": "<string>",
"main_name": "<string>",
"department": "<string>",
"email": "<string>",
"website": "<string>",
"address": {
"street": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country_code": "<string>"
}
},
"payment_terms": "<string>",
"invoice_note": "<string>",
"additional_properties": [
{
"name": "<string>",
"value": "<string>",
"source_path": "<string>",
"scheme": "<string>"
}
],
"original_currency_code": "<string>",
"currency_conversion_rate": "1250.00",
"original_total_amount_including_vat": "1250.00",
"payment": {
"reference": "<string>",
"bank_account_number": "<string>",
"status": "paid",
"outstanding_amount": "1250.00",
"override": {
"outstanding_amount": "1250.00"
},
"integration_outstanding_amount": "1250.00"
},
"delivery": {
"name": "<string>",
"address": {
"street": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country_code": "<string>"
},
"date": "2023-12-25"
},
"references": {
"order_references": [
"<string>"
],
"buyer_reference": "<string>",
"seller_reference": "<string>",
"contract_reference": "<string>",
"project_reference": "<string>",
"accounting_cost": "<string>",
"credit_note_invoice_reference": "<string>"
},
"origin": {
"type": "structured",
"import_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_system": "<string>",
"source_invoice_id": "<string>"
}
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"extraction_confirmed": true,
"extraction_confirmed_at": "2023-11-07T05:31:56Z",
"extraction_confirmed_by_user_id": "<string>",
"invoice_number": "<string>",
"title": "<string>",
"category": "invoice",
"issued_date": "2023-12-25",
"due_date": "2023-12-25",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"currency_code": "<string>",
"total_amount_excluding_vat": "1250.00",
"total_amount_including_vat": "1250.00",
"financially_valid": true,
"financial_errors": [
{
"code": "missing_financial_inputs",
"field": "<string>",
"message": "<string>"
}
],
"alert_summary": {
"scope": {
"type": "invoice",
"agreement_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"checks": {
"status": "not_checkable",
"completed": 1,
"total": 1,
"reasons": [
"credit_note"
]
},
"counts": {
"pending": 1,
"claimed": 1,
"dismissed": 1,
"credited": 1
},
"is_fully_credited": true,
"has_credit_note_match": true
},
"supplier_name": "<string>",
"recipient_name": "<string>",
"review_recommended": true,
"extraction_confidence": "high",
"relationships": {
"linked_credit_note_count": 1,
"matched_invoice_count": 1,
"line_item_count": 123,
"document_count": 123,
"agreement_match_count": 123,
"alert_count": 123
},
"supplier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"recipient_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"supplier_snapshot": {
"name": "<string>",
"organization_number": "<string>",
"main_name": "<string>",
"department": "<string>",
"email": "<string>",
"website": "<string>",
"address": {
"street": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country_code": "<string>"
}
},
"recipient_snapshot": {
"name": "<string>",
"organization_number": "<string>",
"main_name": "<string>",
"department": "<string>",
"email": "<string>",
"website": "<string>",
"address": {
"street": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country_code": "<string>"
}
},
"payment_terms": "<string>",
"invoice_note": "<string>",
"additional_properties": [
{
"name": "<string>",
"value": "<string>",
"source_path": "<string>",
"scheme": "<string>"
}
],
"original_currency_code": "<string>",
"currency_conversion_rate": "1250.00",
"original_total_amount_including_vat": "1250.00",
"payment": {
"reference": "<string>",
"bank_account_number": "<string>",
"status": "paid",
"outstanding_amount": "1250.00",
"override": {
"outstanding_amount": "1250.00"
},
"integration_outstanding_amount": "1250.00"
},
"delivery": {
"name": "<string>",
"address": {
"street": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country_code": "<string>"
},
"date": "2023-12-25"
},
"references": {
"order_references": [
"<string>"
],
"buyer_reference": "<string>",
"seller_reference": "<string>",
"contract_reference": "<string>",
"project_reference": "<string>",
"accounting_cost": "<string>",
"credit_note_invoice_reference": "<string>"
},
"origin": {
"type": "structured",
"import_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_system": "<string>",
"source_invoice_id": "<string>"
}
}{
"error": {
"code": "validation_error",
"message": "Invalid input or financially inconsistent invoice. Details identify failing fields or checks. The entire write is rolled back; creation failures do not commit an idempotency receipt.",
"request_id": "req_example"
}
}{
"error": {
"code": "invalid_token",
"message": "Missing or invalid bearer credential.",
"request_id": "req_example"
}
}{
"error": {
"code": "forbidden",
"message": "Access denied: forbidden, token_disabled, organization_required, insufficient_role, or mfa_required. Check the error code and effective permissions.",
"request_id": "req_example"
}
}{
"error": {
"code": "conflict",
"message": "An active invoice already has the same business identity, or a committed idempotency key has different input or references a permanently deleted resource.",
"request_id": "req_example"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "The IP or authenticated credential exceeded its request limit.",
"request_id": "req_example"
}
}{
"error": {
"code": "internal_error",
"message": "Unexpected server failure. Include the request ID when contacting support.",
"request_id": "req_example"
}
}{
"error": {
"code": "service_unavailable",
"message": "Authentication infrastructure is unavailable or rate limited. Honor Retry-After when provided.",
"request_id": "req_example"
}
}Create an invoice from structured data
Requires financially consistent structured data. An active invoice with the same supplier, recipient, invoice number, issued date, category, currency, and normalized total returns 409 without creating another invoice. Idempotency-Key is optional and protects request retries. Validation failure commits neither the invoice nor its idempotency receipt. Reusing a committed key with different input returns 409. A replay returns the same invoice ID with its current values, including subsequent edits. If that invoice was permanently deleted, replay returns 409; the key remains reserved.
curl --request POST \
--url http://localhost:3500/v1/invoices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"supplier_id": "11111111-1111-4111-8111-111111111111",
"recipient_id": "22222222-2222-4222-8222-222222222222",
"invoice_number": "INV-2026-001",
"category": "invoice",
"issued_date": "2026-09-07",
"currency_code": "NOK",
"total_amount_including_vat": "125.00",
"line_items": [
{
"line_number": 1,
"description": "Consulting",
"quantity": "1",
"unit_price": "100.00",
"vat_rate": "0.25",
"total_excluding_vat": "100.00"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
supplier_id: '11111111-1111-4111-8111-111111111111',
recipient_id: '22222222-2222-4222-8222-222222222222',
invoice_number: 'INV-2026-001',
category: 'invoice',
issued_date: '2026-09-07',
currency_code: 'NOK',
total_amount_including_vat: '125.00',
line_items: [
{
line_number: 1,
description: 'Consulting',
quantity: '1',
unit_price: '100.00',
vat_rate: '0.25',
total_excluding_vat: '100.00'
}
]
})
};
fetch('http://localhost:3500/v1/invoices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "http://localhost:3500/v1/invoices"
payload = {
"supplier_id": "11111111-1111-4111-8111-111111111111",
"recipient_id": "22222222-2222-4222-8222-222222222222",
"invoice_number": "INV-2026-001",
"category": "invoice",
"issued_date": "2026-09-07",
"currency_code": "NOK",
"total_amount_including_vat": "125.00",
"line_items": [
{
"line_number": 1,
"description": "Consulting",
"quantity": "1",
"unit_price": "100.00",
"vat_rate": "0.25",
"total_excluding_vat": "100.00"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"extraction_confirmed": true,
"extraction_confirmed_at": "2023-11-07T05:31:56Z",
"extraction_confirmed_by_user_id": "<string>",
"invoice_number": "<string>",
"title": "<string>",
"category": "invoice",
"issued_date": "2023-12-25",
"due_date": "2023-12-25",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"currency_code": "<string>",
"total_amount_excluding_vat": "1250.00",
"total_amount_including_vat": "1250.00",
"financially_valid": true,
"financial_errors": [
{
"code": "missing_financial_inputs",
"field": "<string>",
"message": "<string>"
}
],
"alert_summary": {
"scope": {
"type": "invoice",
"agreement_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"checks": {
"status": "not_checkable",
"completed": 1,
"total": 1,
"reasons": [
"credit_note"
]
},
"counts": {
"pending": 1,
"claimed": 1,
"dismissed": 1,
"credited": 1
},
"is_fully_credited": true,
"has_credit_note_match": true
},
"supplier_name": "<string>",
"recipient_name": "<string>",
"review_recommended": true,
"extraction_confidence": "high",
"relationships": {
"linked_credit_note_count": 1,
"matched_invoice_count": 1,
"line_item_count": 123,
"document_count": 123,
"agreement_match_count": 123,
"alert_count": 123
},
"supplier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"recipient_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"supplier_snapshot": {
"name": "<string>",
"organization_number": "<string>",
"main_name": "<string>",
"department": "<string>",
"email": "<string>",
"website": "<string>",
"address": {
"street": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country_code": "<string>"
}
},
"recipient_snapshot": {
"name": "<string>",
"organization_number": "<string>",
"main_name": "<string>",
"department": "<string>",
"email": "<string>",
"website": "<string>",
"address": {
"street": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country_code": "<string>"
}
},
"payment_terms": "<string>",
"invoice_note": "<string>",
"additional_properties": [
{
"name": "<string>",
"value": "<string>",
"source_path": "<string>",
"scheme": "<string>"
}
],
"original_currency_code": "<string>",
"currency_conversion_rate": "1250.00",
"original_total_amount_including_vat": "1250.00",
"payment": {
"reference": "<string>",
"bank_account_number": "<string>",
"status": "paid",
"outstanding_amount": "1250.00",
"override": {
"outstanding_amount": "1250.00"
},
"integration_outstanding_amount": "1250.00"
},
"delivery": {
"name": "<string>",
"address": {
"street": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country_code": "<string>"
},
"date": "2023-12-25"
},
"references": {
"order_references": [
"<string>"
],
"buyer_reference": "<string>",
"seller_reference": "<string>",
"contract_reference": "<string>",
"project_reference": "<string>",
"accounting_cost": "<string>",
"credit_note_invoice_reference": "<string>"
},
"origin": {
"type": "structured",
"import_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_system": "<string>",
"source_invoice_id": "<string>"
}
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"extraction_confirmed": true,
"extraction_confirmed_at": "2023-11-07T05:31:56Z",
"extraction_confirmed_by_user_id": "<string>",
"invoice_number": "<string>",
"title": "<string>",
"category": "invoice",
"issued_date": "2023-12-25",
"due_date": "2023-12-25",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"currency_code": "<string>",
"total_amount_excluding_vat": "1250.00",
"total_amount_including_vat": "1250.00",
"financially_valid": true,
"financial_errors": [
{
"code": "missing_financial_inputs",
"field": "<string>",
"message": "<string>"
}
],
"alert_summary": {
"scope": {
"type": "invoice",
"agreement_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"checks": {
"status": "not_checkable",
"completed": 1,
"total": 1,
"reasons": [
"credit_note"
]
},
"counts": {
"pending": 1,
"claimed": 1,
"dismissed": 1,
"credited": 1
},
"is_fully_credited": true,
"has_credit_note_match": true
},
"supplier_name": "<string>",
"recipient_name": "<string>",
"review_recommended": true,
"extraction_confidence": "high",
"relationships": {
"linked_credit_note_count": 1,
"matched_invoice_count": 1,
"line_item_count": 123,
"document_count": 123,
"agreement_match_count": 123,
"alert_count": 123
},
"supplier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"recipient_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"supplier_snapshot": {
"name": "<string>",
"organization_number": "<string>",
"main_name": "<string>",
"department": "<string>",
"email": "<string>",
"website": "<string>",
"address": {
"street": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country_code": "<string>"
}
},
"recipient_snapshot": {
"name": "<string>",
"organization_number": "<string>",
"main_name": "<string>",
"department": "<string>",
"email": "<string>",
"website": "<string>",
"address": {
"street": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country_code": "<string>"
}
},
"payment_terms": "<string>",
"invoice_note": "<string>",
"additional_properties": [
{
"name": "<string>",
"value": "<string>",
"source_path": "<string>",
"scheme": "<string>"
}
],
"original_currency_code": "<string>",
"currency_conversion_rate": "1250.00",
"original_total_amount_including_vat": "1250.00",
"payment": {
"reference": "<string>",
"bank_account_number": "<string>",
"status": "paid",
"outstanding_amount": "1250.00",
"override": {
"outstanding_amount": "1250.00"
},
"integration_outstanding_amount": "1250.00"
},
"delivery": {
"name": "<string>",
"address": {
"street": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country_code": "<string>"
},
"date": "2023-12-25"
},
"references": {
"order_references": [
"<string>"
],
"buyer_reference": "<string>",
"seller_reference": "<string>",
"contract_reference": "<string>",
"project_reference": "<string>",
"accounting_cost": "<string>",
"credit_note_invoice_reference": "<string>"
},
"origin": {
"type": "structured",
"import_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source_system": "<string>",
"source_invoice_id": "<string>"
}
}{
"error": {
"code": "validation_error",
"message": "Invalid input or financially inconsistent invoice. Details identify failing fields or checks. The entire write is rolled back; creation failures do not commit an idempotency receipt.",
"request_id": "req_example"
}
}{
"error": {
"code": "invalid_token",
"message": "Missing or invalid bearer credential.",
"request_id": "req_example"
}
}{
"error": {
"code": "forbidden",
"message": "Access denied: forbidden, token_disabled, organization_required, insufficient_role, or mfa_required. Check the error code and effective permissions.",
"request_id": "req_example"
}
}{
"error": {
"code": "conflict",
"message": "An active invoice already has the same business identity, or a committed idempotency key has different input or references a permanently deleted resource.",
"request_id": "req_example"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "The IP or authenticated credential exceeded its request limit.",
"request_id": "req_example"
}
}{
"error": {
"code": "internal_error",
"message": "Unexpected server failure. Include the request ID when contacting support.",
"request_id": "req_example"
}
}{
"error": {
"code": "service_unavailable",
"message": "Authentication infrastructure is unavailable or rate limited. Honor Retry-After when provided.",
"request_id": "req_example"
}
}Authorizations
Personal API key. Send X-Organization-Id. The required cumulative level is listed in x-watchdog-permission.
Headers
Required for personal API keys. Target one organization you have access to. Migrated keys may omit it to use their original organization. For Clerk sessions, it must match the active organization.
Optional protection for safely retrying a request after a timeout or lost response. Choose a unique value (for example, a UUID) for each action and reuse it with the same input when retrying. Omit it for a normal request.
1 - 200^[\x21-\x7e]+$Body
The complete encoded JSON body, including all line data, must be at most 2 MiB (2,097,152 bytes). Individual field and line-count limits also apply.
invoice, credit_note, self_billed_invoice 1 - 255^\d{4}-\d{2}-\d{2}$^[A-Z]{3}$100^-?\d+(?:\.\d+)?$1 - 500 elementsShow child attributes
Show child attributes
2000^\d{4}-\d{2}-\d{2}$100^-?\d+(?:\.\d+)?$^[A-Z]{3}$100^-?\d+(?:\.\d+)?$Show child attributes
Show child attributes
200020002000501 - 200020002000200020002000Response
Idempotent replay of an earlier request
Explicit human review acknowledgment; independent of extraction confidence and financial validity.
invoice, credit_note, self_billed_invoice Exact decimal string; retain as decimal text rather than a floating-point number.
100^-?\d+(?:\.\d+)?$"1250.00"
Exact decimal string; retain as decimal text rather than a floating-point number.
100^-?\d+(?:\.\d+)?$"1250.00"
Deterministic arithmetic within a tolerance of 1 currency unit. Does not imply extraction accuracy, compliance, or human approval.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Current canonical supplier name. Used by supplier ordering.
Current canonical recipient name. Used by recipient ordering.
Review is recommended for low or medium unconfirmed extraction confidence, an unmatched credit note, or financial invalidity. Uses the same predicate as the review_recommended filter.
Lowest original header/line confidence from the creating import, when both stages have reliable evidence. Structured, XML and unavailable historical evidence are unknown; manual confirmation does not change this value.
high, mid, low, unknown Recorded org-owned links including soft-deleted counterparts. A match does not establish financial resolution.
Show child attributes
Show child attributes
Current canonical supplier ID.
Current canonical recipient ID.
Supplier details captured on the invoice.
Show child attributes
Show child attributes
Recipient details captured on the invoice.
Show child attributes
Show child attributes
Stored printed payment terms, including conditions. Null means unavailable; never inferred from the due date.
Stored invoice-wide note in its original wording, separate from line notes. Null means unavailable; empty text stays empty.
Stored named business details with optional source paths. Null means unavailable; [] means inspected with none found. These do not replace financial values.
Show child attributes
Show child attributes
Exact decimal string; retain as decimal text rather than a floating-point number.
100^-?\d+(?:\.\d+)?$"1250.00"
Exact decimal string; retain as decimal text rather than a floating-point number.
100^-?\d+(?:\.\d+)?$"1250.00"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes