curl --request PATCH \
--url http://localhost:3500/v1/invoices/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('http://localhost:3500/v1/invoices/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "http://localhost:3500/v1/invoices/{id}"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(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>"
}
}{
"error": {
"code": "validation_error",
"message": "Invalid input or financially inconsistent invoice. Details identify failing fields or checks. The entire edit is rolled back.",
"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": "not_found",
"message": "The resource does not exist in the current organization.",
"request_id": "req_example"
}
}{
"error": {
"code": "conflict",
"message": "The resulting business identity matches another active invoice, or a credit note linked to a claim cannot be changed to another category.",
"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"
}
}Update an invoice
Merges changes against the locked current invoice. Financial changes require the complete result to pass validation; failure rolls back the entire edit. Metadata-only edits preserve existing financial errors. Equivalent numeric values are no-ops. Saving does not refresh matching or compliance analysis.
curl --request PATCH \
--url http://localhost:3500/v1/invoices/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('http://localhost:3500/v1/invoices/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "http://localhost:3500/v1/invoices/{id}"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(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>"
}
}{
"error": {
"code": "validation_error",
"message": "Invalid input or financially inconsistent invoice. Details identify failing fields or checks. The entire edit is rolled back.",
"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": "not_found",
"message": "The resource does not exist in the current organization.",
"request_id": "req_example"
}
}{
"error": {
"code": "conflict",
"message": "The resulting business identity matches another active invoice, or a credit note linked to a claim cannot be changed to another category.",
"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]+$Path Parameters
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 - 2552000^\d{4}-\d{2}-\d{2}$^\d{4}-\d{2}-\d{2}$^[A-Z]{3}$100^-?\d+(?:\.\d+)?$100^-?\d+(?:\.\d+)?$^[A-Z]{3}$100^-?\d+(?:\.\d+)?$Show child attributes
Show child attributes
200020002000501 - 2000200020002000200020001 - 500 elementsShow child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
50Response
Invoice after the atomic update, or unchanged invoice for a no-op.
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