curl --request POST \
--url http://localhost:3500/v1/invoices/{id}/preview-category-change \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('http://localhost:3500/v1/invoices/{id}/preview-category-change', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "http://localhost:3500/v1/invoices/{id}/preview-category-change"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"category": "invoice",
"changes": [
{
"field": "<string>",
"from": "<string>",
"to": "<string>"
}
],
"line_changes": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"changes": [
{
"field": "<string>",
"from": "<string>",
"to": "<string>"
}
]
}
],
"removed_line_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"parties": {
"supplier": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"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": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"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>"
}
}
}
},
"financially_valid": true,
"financial_errors": [
{
"code": "missing_financial_inputs",
"field": "<string>",
"message": "<string>"
}
],
"affected_matches": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"action": "retain"
}
],
"selected_invoice_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"retained_finding_count": 123,
"claim_conflicts": [
{
"claim_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reason": "<string>"
}
],
"exact_reference_candidates": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_number": "<string>",
"category": "invoice",
"supplier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"currency_code": "<string>",
"total_amount_including_vat": "<string>"
}
],
"candidates_truncated": true,
"requires_matched_invoice_ids": true
}{
"error": {
"code": "validation_error",
"message": "Invalid correction or category selection, including an invalid financial result.",
"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": "Invoice, relationship, or claim conflict.",
"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"
}
}Preview category and pending corrections
Performs no writes. Includes complete financial diagnostics, party resolution, affected matches and claim conflicts. Exact-reference candidates are bounded at 100 and never selected automatically. PATCH reloads and validates current state.
curl --request POST \
--url http://localhost:3500/v1/invoices/{id}/preview-category-change \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('http://localhost:3500/v1/invoices/{id}/preview-category-change', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "http://localhost:3500/v1/invoices/{id}/preview-category-change"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"category": "invoice",
"changes": [
{
"field": "<string>",
"from": "<string>",
"to": "<string>"
}
],
"line_changes": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"changes": [
{
"field": "<string>",
"from": "<string>",
"to": "<string>"
}
]
}
],
"removed_line_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"parties": {
"supplier": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"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": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"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>"
}
}
}
},
"financially_valid": true,
"financial_errors": [
{
"code": "missing_financial_inputs",
"field": "<string>",
"message": "<string>"
}
],
"affected_matches": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"action": "retain"
}
],
"selected_invoice_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"retained_finding_count": 123,
"claim_conflicts": [
{
"claim_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reason": "<string>"
}
],
"exact_reference_candidates": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_number": "<string>",
"category": "invoice",
"supplier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"currency_code": "<string>",
"total_amount_including_vat": "<string>"
}
],
"candidates_truncated": true,
"requires_matched_invoice_ids": true
}{
"error": {
"code": "validation_error",
"message": "Invalid correction or category selection, including an invalid financial result.",
"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": "Invoice, relationship, or claim conflict.",
"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.
Path Parameters
Body
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
Advisory category plan.
invoice, credit_note, self_billed_invoice 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
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes