Orders

Three-way match and duplicate detection

POST
/invoices/analyze

Three-way match and duplicate detection. Requires the MANAGER role. Idempotent: send an Idempotency-Key.

Authorization

__Host-qm_session<token>

Session cookie set by sign-in on HTTPS deployments (the hosted demo).

In: cookie

Header Parameters

X-Requested-With*string

CSRF guard: must be quartermaster on every mutation.

Idempotency-Key*string

A unique key per user action; retries with the same key return the first result.

Length8 <= length <= 128

Request Body

application/json

A supplier invoice to match against its purchase order and delivery.

A supplier invoice to match against its purchase order and delivery.

supplier_id*string

Id of the related supplier.

Match^([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)$
Formatuuid
purchase_order_id?|

Id of the related purchase order.

invoice_number*string
Length1 <= length <= 64
invoice_date*string

Invoice date (YYYY-MM-DD).

Match^\d{4}-\d{2}-\d{2}$
currency*"USD"

ISO 4217 currency code.

Value in

  • "USD"
lines*array<>

Line items.

Items1 <= items <= 200
total_minor*integer

Total, in minor units (cents).

Range0 <= value <= 9007199254740991
notes?string
Lengthlength <= 5000

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/invoices/analyze" \  -H "X-Requested-With: quartermaster" \  -H "Idempotency-Key: 3b8c2c1e-6f6d-4a59-9a43-8f0c2a9e1d22" \  -H "Content-Type: application/json" \  -d '{    "supplier_id": "3cb1e20c-c6c9-4e71-ba66-399c468f697c",    "invoice_number": "string",    "invoice_date": "string",    "currency": "USD",    "lines": [      {        "description": "string",        "quantity": 1,        "unit_price_minor": 0,        "line_total_minor": 0      }    ],    "total_minor": 0  }'
{  "id": "string",  "supplier_id": "string",  "purchase_order_id": "string",  "invoice_number": "string",  "invoice_date": "string",  "currency": "string",  "total_minor": 0,  "status": "MATCHED",  "settlement_allowed": true,  "matches": [    {      "check": "string",      "passed": true,      "severity": "LOW",      "detail": "string"    }  ],  "created_at": "string"}