Purchase Order
Return a purchase order.
Released
Updated
| URL | Supports |
|---|---|
{URI}/purchaseorder/ | |
{URI}/purchaseorder/search?q={query} | |
| {URI} is exo.api.myob.com when connecting to the cloud or the address of the machine hosting the API when connecting on premise. | |
search returns purchase orders that match the specified search string.
Attribute Details
| Attribute | Type | Notes |
|---|---|---|
lines | array,null | Type: array,null. Optional, but orders without lines don't have much purpose. |
lines.stockcode | string | Type: string. Length defined by database schema, default 23. |
lines.orderquantity | number | Type: number. Decimal Precision defined by profile QTYDECIMALS in Exo system. |
lines.supplyquantity | number,calculated | Type: number. DO NOT SPECIFY. Always 0 for new Orders/Quotes. Do not change value as Supply via API is not enabled. |
lines.invoicequantity | number,calculated | Type: number. DO NOT SPECIFY. Always 0 for new Orders/Quotes. Do not change value as Supply via API is not enabled. |
lines.correctionquantity | number,calculated | Type: number. |
lines.correctedquantity | number,calculated | Type: number. |
lines.supplynowquantity | number,calculated | Type: number. DO NOT SPECIFY. Always the full value of the line for new Orders/Quotes. Do not change value as Supply via API is not enabled. |
lines.invoicenowquantity | number,calculated | Type: number. DO NOT SPECIFY. Always 0 for new Orders/Quotes. Do not change value as Supply via API is not enabled. |
lines.lastsupplyquantity | number,calculated | Type: number. DO NOT SPECIFY. Always 0 for new Orders/Quotes. Do not change value as Supply via API is not enabled. |
lines.lastinvoicequantity | number,calculated | Type: number. DO NOT SPECIFY. Always 0 for new Orders/Quotes. Do not change value as Supply via API is not enabled. |
lines.linkedquantity | number,calculated | Type: number. |
lines.purchasepackquantity | number,calculated | Type: number. |
lines.costquantity | number,calculated | Type: number. |
lines.jobcode | string,null | Type: string. |
lines.jobno | integer,null | Type: integer. |
lines.salesorderno | integer,null | Type: integer. |
lines.codetype | char | Type: char. |
lines.suppliercode | string | Type: string. |
lines.polineid | integer | Type: integer. |
lines.linkedstockcode | string | Type: string. |
lines.linkedstatus | boolean | Type: boolean. |
lines.solineid | integer | Type: integer. |
lines.purchasepackprice | number,null | Type: number. |
lines.sellprice | number,null | Type: number. |
lines.discount | number,null | Type: number. Optional. Decimal Precision defined by profile DISCOUNTDECIMALS in Exo system. Note that discounts may have additional restrictions on them in system. |
lines.unitprice | number,null | Type: number. Optional. Decimal Precision defined by profile SELLPRDECIMALS in Exo system. Tax exclusive price. Failure to specify will return the default price on order validation. |
lines.ispriceoverridden | boolean,null | Type: boolean. Optional. Specifies if the price has been overridden. Overridden prices are not recalculated if an order is edited in Exo Business. |
lines.locationid | integer,null | Type: integer. Optional. Stock Location that the line should be supplied from. If not specified will be defaulted based on API User. |
lines.taxrateid | integer,null | Type: integer. Optional. TaxrateID for the line. If unspecified will default based on Debtor/Stock Item hierarchy from Exo. |
lines.linetype | integer,enum,null | Type: integer. Optional. Linetypes can be (0 = Normal stockline,1 = BOM header line,2 = BOM component line,4 = Comment/Narrative line). Default is 0. |
lines.stocktype | enum,calculated | Type: enum. DO NOT SPECIFY. Will be either PhysicalItem or Lookup Item. (Defines if Item has stock, retrieved from stock item record) |
lines.id | integer,null | Type: integer. Database ID number for Order line. SOLINEID value from SALESORD_LINES. |
lines.branchid | integer,null | Type: integer. Optional. Branch the line's profit should be reported to. If not specified is inherited from Order branch or User. |
lines.taxratevalue | number,null | Type: number. Optional. (Recommended DO NOT SPECIFY). The taxrate for the line. (Percentage). To correctly specify taxrates use taxrateid |
lines.istaxoverridden | boolean,null | Type: boolean. Optional. Only specify if you have overridden the tax calculation so it no longer matches the database default. Note that if you overwrite the tax value for a line, this prevents Exo from recalculating prices on Order edits/processing. |
lines.taxoverridevalue | number,null | Type: number. Optional. If istaxoverridden is true then must specify the exact tax amount for the line. |
lines.narrative | string,null | Type: string. Optional. Additional narrative (nvarchar(Max)) for recording additional information. |
lines.backorderquantity | number,null | Type: number. Optional. Specifies the backorder quantity for a line (which affects stock availability and supply processes in Exo Business.) |
lines.description | string,null | Type: string. Optional. If not specified will be the standard item description from the stock item. String truncation errors can occur if you don't obey database schema. (Default schema length 100 on new databases) |
lines.batchcode | string,null | Type: string. Optional. Specify a batchcode for batch tracking purposes, note batch tracking is not fully supported via the API. Schema bound with default length of 20 characters. |
lines.duedate | date,null | Type: date. Optional, line specific duedate. Should be in format YYYY-MM-DD when set. |
lines.linetotal | number,calculated | Type: number. DO NOT SPECIFY. Calculated based on unitprice * orderquantity less discount. Tax Exclusive line-total. |
lines.rankorder | integer,null | Type: integer. For determining line-position when printing. |
lines.extrafields | array,null | Type: array. Optional. Defined in individual user databases against SALESORD_LINES level. For assistance speak to database's implementation partner. |
creditorid | integer,null | Type: integer. |
authorisationstaffno | integer,null | Type: integer. |
authorisationdate | date,null | Type: date. |
isconfirmed | boolean,null | Type: boolean. |
leadtimeused | integer,null | Type: integer. |
hstatus | integer,enum | Type: integer. |
sosourceref | string,null | Type: string. |
campaignwaveseqno | string,null | Type: string. |
hasuninvoiced | boolean,calculated | Type: boolean. DO NOT SPECIFY. Whether order has uninvoiced lines. |
hasunsupplied | boolean,calculated | Type: boolean. DO NOT SPECIFY. Whether order has unsupplied lines. |
accountname | string,null | Type: string. Optional. Always retrieves the Accountname value from the Debtor account. |
istaxinclusive | boolean,null | Type: boolean, defaults false. (Tax Exclusive). Defines if pricing on the order is tax inclusive or tax exclusive. |
hasbackorders | boolean,calculated | Type: boolean. DO NOT SPECIFY. Whether order has backordered lines. |
branchid | integer,null | Type: integer. Default branch for the order. If unspecified will be drawn based on user profile. BRANCHNO field. |
defaultlocationid | integer, null | Type: integer. Default stock location for order. If unspecified will default based on user. DEFLOCNO field. |
narrative | string,null | Type: string. Optional. Additional narrative (nvarchar(Max)) for recording information at a Sales Order Header level. |
currencyid | integer,null | Type: integer. Optional. Defines the currency the order is in. Should always be the same as the related Debtor account. If not specified will default to Debtor account Currrrency. CURRENCYNO |
salespersonid | integer,null | Type: integer. Optional. Salesperson for the Order, is an integer specifying the staff member from the STAFF table. |
exchangerate | number,null | Type: number. Optional. Exchange rate order was received at. Must be 1 for currencyno 0. |
taxtotal | number,calculated | Type: number. DO NOT SPECIFY. The total tax value of the order. |
subtotal | number,calculated | Type: number. DO NOT SPECIFY. The subtotal of all lines without tax. |
reference | string,null | Type: string. Optional, reference field for order. Default definition NVARCHAR(20) |
instructions | string,null | Type: string. Optional, delivery instruction field for order. Default database definition NVARCHAR(255) |
createdate | date,calculated | Type: date. DO NOT SPECIFY. Timestamp of order being created. |
orderdate | date,null | Type: date. Optional, date of order. Should be in format YYYY-MM-DD when set. Defaults to today's date. |
duedate | date,null | Type: date. Optional, overall order duedate. Should be in format YYYY-MM-DD when set. |
finalisationdate | date,null | Type: date. Optional, date order was finalised. Should be in format YYYY-MM-DD when set. Should be left alone. |
activationdate | datetime,null | Type: date. Optional. Date order was activated. Full timestamp value. Defaults to current time. Returns string. |
deliveryaddress | array,null | Type: array. Delivery address for order, if unspecified will default to Debtor account delivery address. |
deliveryaddress.line1 | string,null | Type: string. Delivery address line 1. Display definition defined as part of Exo Profiles. Default length is NVARCHAR(30). If longer lengths are required speak to implementer. |
deliveryaddress.line2 | string,null | Type: string. Delivery address line 2. Display definition defined as part of Exo Profiles. Default length is NVARCHAR(30). If longer lengths are required speak to implementer. |
deliveryaddress.line3 | string,null | Type: string. Delivery address line 3. Display definition defined as part of Exo Profiles. Default length is NVARCHAR(30). If longer lengths are required speak to implementer. |
deliveryaddress.line4 | string,null | Type: string. Delivery address line 4. Display definition defined as part of Exo Profiles. Default length is NVARCHAR(30). If longer lengths are required speak to implementer. |
deliveryaddress.line5 | string,null | Type: string. Delivery address line 5. Display definition defined as part of Exo Profiles. Default length is NVARCHAR(30). If longer lengths are required speak to implementer. OPTIONAL FIELD - may not be visible to end users in all systems. |
deliveryaddress.line6 | string,null | Type: string. Delivery address line 6. Display definition defined as part of Exo Profiles. Default length is NVARCHAR(30). If longer lengths are required speak to implementer. OPTIONAL FIELD - may not be visible to end users in all systems. |
status | integer,enum | Type: integer. 0 = "Not Processed", 3 = "Quotation", 4 = "Standing Order", 5 - "Layby". Note that not all statuses are available if Extended Order types is off. (1 = Partially Processed, 2 = Fully Processed. These will be set by system users on processing orders.) |
statusdescription | string calculated | Type: string. DO NOT SPECIFY. Description of the Status integer. |
finalised | integer,null | Type: integer. Optional. Specifies the Finalisation status of order. 0 = Normal, 1 = Deleted, 2 = Forced Fully Processed, 3 = Lost Quote |
ordertotal | number,calculated | Type: number. DO NOT SPECIFY. Calculated total of the Order. |
localvalue | number,calculated | Type: number. DO NOT SPECIFY. The converted value of the order in the system denomination currency. (Ordertotal * exchangerate) |
lastupdated | datetime,calculated | Type: date. DO NOT SPECIFY. Date order was last edited. Full timestamp value. Defaults to current time on order update. Returns string. |
extrafields | array,null | Type: array. Optional. Defined in individual user databases against SALESORD_HDR level. For assistance speak to database's implementation partner. |
id | integer,null | Type: integer. ID value specified is the SEQNO from SALESORD_HDR |
href | string,null | Type: string. DO NOT SPECIFY. URI location for retrieving sales order. |
Example json GET response
Example
[
{
"stockcode": "AIRSUS01",
"orderquantity": 1.0,
"supplyquantity": 0.0,
"invoicequantity": 0.0,
"correctionquantity": 0.0,
"correctedquantity": 1.0,
"supplynowquantity": 0.0,
"invoicenowquantity": 0.0,
"lastsupplyquantity": 0.0,
"lastinvoicequantity": 0.0,
"linkedquantity": 1.0,
"purchasepackquantity": 1.0,
"costquantity": 0.0,
"jobcode": 1,
"jobno": 1,
"salesorderno": -1,
"codetype": "S",
"suppliercode": null,
"polineid": 359,
"linkedstockcode": "AIRSUS01",
"linkedstatus": "N",
"solineid": -1,
"purchasepackprice": 0.0,
"sellprice": -1.0,
"discount": 0.0,
"unitprice": 184.55,
"locationid": 1,
"taxrateid": 3,
"linetype": 0.0,
"stocktype": "PhysicalItem",
"id": 359,
"branchid": 0,
"taxratevalue": 12.5,
"istaxoverridden": false,
"taxoverridevalue": 0.0,
"backorderquantity": 1.0,
"description": "AIR SUSPENSION",
"duedate": "2024-01-12",
"linetotal": 184.55,
"rankorder": 1
},
{
"creditorid": 0,
"authorisationstaffno": -1,
"authorisationdate": null,
"isconfirmed": "false",
"leadtimeused": 0,
"hstatus": 0,
"sosourceref": null,
"campaignwaveseqno": -1,
"hasuninvoiced": true,
"hasunsupplied": true,
"accountname": "MISC PURCHASES",
"istaxinclusive": false,
"hasbackorders": true,
"branchid": 0,
"defaultlocationid": -1,
"currencyid": 0,
"salespersonid": 8,
"exchangerate": 1.0,
"taxtotal": 23.07,
"subtotal": 184.55,
"createdate": "2013-09-18T10:23:13+12:00",
"orderdate": "2024-01-12",
"duedate": "2024-01-12",
"line1": "238 GREAT NORTH ROAD",
"line2": "GREY LYNN",
"line3": "NSW",
"line4": "Australia",
"line5": "",
"line6": "",
"status": 0,
"statusdescription": "Unprocessed Order",
"finalised": 0,
"ordertotal": 207.62,
"localvalue": 184.55,
"lastupdated": "2024-01-12T11:31:04+13:00",
"key": "X_CHECKEDBY",
"id": 10082,
"href": "https://relaycloud.exo.api.myob.com/relay/purchaseorder/10082"
}
]