
Webhooks & Firehoses
Invoice Payable
Details of an invoice payable resource.
Example Record
{ "number": "996282", "physkey": "KEP3BM5AODVKKAKVLKYTYRABAAOQAD3R", "physkey_seq": 4, "overview": { "purchaseorder": "205826", "date": "26 Feb 2024", "duedate": "20 Mar 2024", "received_utc": "2024-02-25 21:42.49" }, "from": { "name": "ABC Health Ltd", "emailreplyto": "accounts@example.com" }, "to": { "address": [ "My Store Limited", "237 Waterloo Road", "Gisborne", "NEW ZEALAND" ] }, "totals": { "pageorder": [ "items", "subtotal", "tax", "grandtotal" ], "present": { "subtotal": [ "subtotal.extax" ], "totaltax": [ "totaltax" ], "grandtotal": [ "grandtotal.inctax" ] }, "subtotal": { "extax": 498.99 }, "totaltax": 74.86, "grandtotal": { "inctax": 573.85 }, "freight": { "extax": 0.0 }, "rawqty": 18 }, "payment": { "bankaccount": [ { "number": { "text": "02-0108-01234567-000" }, "decoded_bankname": "BNZ", "decoded_bank": "02", "decoded_account": "01234567", "decoded_suffix": "0000", "decoded_branch": "0108" } ] }, "lines": [ { "description": "Magnesium Restore - 120 caps (SBPMAG)", "qty": 3.0, "qty_retailunits": 3.0, "totalprice_extax": 34.00, "sitepolinenum": 1, "invoiceseq": 1, "matchedpoline": { "value": { "poid": 205826, "linenum": 1, "pid": 35572, "qty_ord": 3, "qty_arrived": 0, "totalprice": 34.00, "physkey": "KEP3BMICABLFCABEMX7GYKQAABMQYAAB", "physkeyh": "KEP3BMICABLFCABEMX3WYKQAABMAYAAB", "_piddescription": "MAGNESIUM RESTORE", "_pidsize": "120 Caps" }, "source": 4, "flowp": 814240211 } }, ... More lines ... ], "delivery": { "target_locationid": 3, "target_locationname": "Gisborne" }, "technical": { "issues": [ { "code": 1002, "level": "minor", "description": "sum(lines) != subtotal, variation -0.0200" } ], "decoder": { "schemaversion": 2402131033, "builddt": "Feb 26 2024 09:16:14", "flowp": 1403240213 } } }
Available Fields
An invoice record consists of several sections
-
Top level fields
- number. The actual invoice number.
- physkey. A unique UUID/GUID like identifier that, when combined with physkey_seq, uniquely identifies this specific invoice.
- physkey_seq. An optional sequential/secondary identifier used to indicate which part/index this invoice came from. For example, when invoices are received by email, this contains the attachment part number from the original email.
- overview. Top level or header style information
- from. Who the invoice came from
- to. Who the invoice was sent too
- totals. The various totals on the invoice. This section contains both "actual" values and also "derived" values so that downstream programs do not need to perform gymnastics.
- payment. Payment details present on the invoice
- lines. Itemised detail lines from the invoice. This can include both "actual" (directly from the invoice) and "derived" values.
- delivery. Details of where the items were delivered too. This can be a store, customers address (in case of drop shipping) or anything relevant
- technical. A range of technical indicators that have been collected as the invoice has been received and processed.
Top Level Fields
Name | Description | Datatype | Resource | "q" |
number | Invoice number as read from the invoice. | String. | Yes | |
physkey | Unique record identifier. | String | ||
physkey_seq | An optional sequential/secondary identifier used to indicate which part/index this invoice came from. For example, when invoices are received by email, this contains the attachment part number from the original email. | String |
Overview Fields
Name | Description | Datatype | Resource | "q" |
purchaseorder |
Purchase order number associated with this invoice.
This value is normally a string, but can be an array of strings in the rarer cases where an invoice spans multiple purchase orders. |
String. | Yes | |
date | Date, taken from invoice, but converted to a more standard syntax | String | ||
duedate | Due Date, taken from invoice if it exists, but converted to a more standard syntax | String | ||
received_utc | Date/time (UTC) that this invoice was first received or uploaded | String |
Lines Fields
The Lines array contains an entry per invoice line. The values in each object can include both actual information on the invoice and derived information.
If the invoice itemises freight as an invoice line, this line is removed from this array and the freight specific values are altered.
Name | Description | Datatype | Resource | "q" |
description | The description on the invoice | String. | ||
partcode | The suppliers partcode on the invoice | String | ||
serialnumber | The serial number(s) given for this line | Array String | ||
batchno | Batch Numbers for this line | Array String | ||
batchexpiry | Batch expiry dates. The value in the array is "as read", so may not be a well formed date literal | Array String |