Skip to content

invoices

Supported, no replacement yet

This endpoint remains fully supported. No replacement exists in the new API yet, and no action is needed. When a replacement ships you will get 12 months' notice, and this site will be updated.

Reference

/rest/stockMgmt/invoice

POST
Adds/updates an invoice and invoice lines
  • invoiceNumber - mandatory - invoice looked up using combination of invoiceNumber and vendorID - if found, invoice is updated and invoice lines added
  • vendorId - mandatory - ID of vendor
  • invoiceDate - mandatory - date of invoice
  • clientGroupdId - mandatory - client group the invoice is linked to
  • grnRef - optional - the GRN Ref which the lines on this invoice should be matched against - GRN will be looked up using combination of grnRef and vendorID - if given combination not found, error will be reported and whole request will fail. Given GRN needs to have matching line (with given part number). Given grnRef is overriden if specified at the line level. (work in progress)

  • Invoice Line: partNumber - the partNumber - part will be looked up by partNumber and if not found, error message logged/returned
  • Invoice Line: quantity - the quantity
  • Invoice Line: unitPrice - the unit price
  • Invoice Line: grnRef - optional - the GRN Ref which the lines on this invoice should be matched against - GRN will be looked up using combination of grnRef and vendorID - if given combination not found, error will be reported and whole request will fail. Given GRN needs to have matching line (with given part number).
Note: sending again matching GRN and part number will override existing values ie. quantity


acceptable request representations:

  • application/json
 {
     "invoiceNumber" : "eeheh23",      "vendorId" : "433",     "invoiceDate" : "12/12/2013"     "clientGroupId" : "34"     "grnRef" : "GR-434", //optional v2     "invoiceLines" : [
                {
                    "partNumber" : "abc123",
                    "quantity" : "43",
                    "unitPrice" : "12.23",                    "grnRef" : "GR-223"
                }
     ]}


available response representations:
  • 200 - application/json
{
  "result" : "success or fail",
  "result_msg" : "error message", 
  # may also return 
  "invoiceId" : "8181"
}



See the Stock Management API matrix for the full list of endpoints in this category.