Skip to main content

Check Bill for Duplicates

POST 

/api/bills/duplicate-check

Check a bill, before or after it is saved, against the supplier's other bills and purchase invoices and against the unlinked bills in the connected accounting system (Xero / QuickBooks Online) for the provider contacts mapped to that supplier. Writes nothing.

Required scope: purchase-orders:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Two tiers:

  • exact - same supplier and the same invoice number, ignoring punctuation, spaces and leading zeros. Creating or editing an expense bill with an exact match is refused with 422 on invoice_number until you resend it with duplicate_acknowledged: true. Invoice numbers are unique per supplier, not across suppliers: the same supplier's bill with the identical number (case-insensitive) can't be acknowledged, so it stays a 422 until the number changes; that match has blocks_save: true.
  • possible - same supplier and currency, a total within tolerance and an invoice date within a few days. A warning only; saving is allowed.

A pair someone already answered with Record Bill Duplicate Decision is never flagged again.

Body:

  • supplier_id (required, integer) - an existing supplier.
  • invoice_number (required key, string or null).
  • invoice_date (required, Y-m-d).
  • total (required, number) - the bill's grand total in its own currency.
  • currency_id (optional, integer, nullable) - the bill's currency; defaults to the tenant currency.
  • exclude_bill_id (optional, integer, nullable) - the saved bill being checked, so it is not matched against itself.

Response:

  • tier - exact, possible, or null when nothing matched.
  • matches[] - exact matches first. Each has type (bill, purchase_invoice or provider), id (for a provider bill, {connection_id}:{remote_type}:{remote_id}), label, url (an app path, or the provider's own link), total, date, reason, can_link (true for provider bills: use Link Bill to Provider Bill), tier and blocks_save (true only for the same supplier's bill with the identical number). A QuickBooks Online match's url opens the bill in QuickBooks, as a Xero match's does.

Authentication: Requires Bearer token. Permission: create or edit bills (bills.create or bills.update). Scope: purchase-orders (read/write).

Request​

Responses​

OK

Response Headers
    Content-Type