FD1 Client Protocol
 
Library Developer Home FD1 Client Protocol Home Concepts Reading Data Writing Data Protocol Defined Servers Connect & Authenticate Proxies & Tunnels
Webhooks Programming Support Logging Minor Facts State Facts Response Format How To Guides eCommerce Sites Custom Point of Sale Customer Access Bulk Downloads Major APIs / Endpoints All Endpoints Products Sales SalesBuilder Session Sale Capture General Purpose Data Capture Devices Barcode Scanners Eftpos IoT Sensors Power Outlets Printing Scales Security Cameras Purchasing / Supply Side Purchase Orders Invoices Invoice Payments Document Capture Rare APIs / Endpoints SSL Certificates API Key Management Diagnositics Server to Client Messages Overview Resources / Objects Purchase Order Invoice Payable Invoice Payment Product Supplier Location Sale Lines Sale Delivery Details Sales Price Maps Employees Carriers Payments Product Kits Department 1 Customers

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

  1. 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.
  2. overview. Top level or header style information
  3. from. Who the invoice came from
  4. to. Who the invoice was sent too
  5. 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.
  6. payment. Payment details present on the invoice
  7. lines. Itemised detail lines from the invoice. This can include both "actual" (directly from the invoice) and "derived" values.
  8. delivery. Details of where the items were delivered too. This can be a store, customers address (in case of drop shipping) or anything relevant
  9. technical. A range of technical indicators that have been collected as the invoice has been received and processed.

Top Level Fields

NameDescriptionDatatypeResource"q"
number Invoice number as read from the invoice. String. Yes
physkeyUnique 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

NameDescriptionDatatypeResource"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
dateDate, taken from invoice, but converted to a more standard syntaxString
duedateDue Date, taken from invoice if it exists, but converted to a more standard syntaxString
received_utcDate/time (UTC) that this invoice was first received or uploadedString

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.

NameDescriptionDatatypeResource"q"
description The description on the invoice String.
partcodeThe suppliers partcode on the invoiceString
serialnumberThe serial number(s) given for this lineArray String
batchnoBatch Numbers for this lineArray String
batchexpiryBatch expiry dates. The value in the array is "as read", so may not be a well formed date literalArray String