Skip to content

Purchase Order

Return a purchase order.

Released
Updated
URLSupports
{URI}/purchaseorder/
GET
{URI}/purchaseorder/search?q={query}
GET
{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

AttributeTypeNotes
linesarray,nullType: array,null. Optional, but orders without lines don't have much purpose.
lines.stockcodestringType: string. Length defined by database schema, default 23.
lines.orderquantitynumberType: number. Decimal Precision defined by profile QTYDECIMALS in Exo system.
lines.supplyquantitynumber,calculatedType: number. DO NOT SPECIFY. Always 0 for new Orders/Quotes. Do not change value as Supply via API is not enabled.
lines.invoicequantitynumber,calculatedType: number. DO NOT SPECIFY. Always 0 for new Orders/Quotes. Do not change value as Supply via API is not enabled.
lines.correctionquantitynumber,calculatedType: number.
lines.correctedquantitynumber,calculatedType: number.
lines.supplynowquantitynumber,calculatedType: 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.invoicenowquantitynumber,calculatedType: number. DO NOT SPECIFY. Always 0 for new Orders/Quotes. Do not change value as Supply via API is not enabled.
lines.lastsupplyquantitynumber,calculatedType: number. DO NOT SPECIFY. Always 0 for new Orders/Quotes. Do not change value as Supply via API is not enabled.
lines.lastinvoicequantitynumber,calculatedType: number. DO NOT SPECIFY. Always 0 for new Orders/Quotes. Do not change value as Supply via API is not enabled.
lines.linkedquantitynumber,calculatedType: number.
lines.purchasepackquantitynumber,calculatedType: number.
lines.costquantitynumber,calculatedType: number.
lines.jobcodestring,nullType: string.
lines.jobnointeger,nullType: integer.
lines.salesordernointeger,nullType: integer.
lines.codetypecharType: char.
lines.suppliercodestringType: string.
lines.polineidintegerType: integer.
lines.linkedstockcodestringType: string.
lines.linkedstatusbooleanType: boolean.
lines.solineidintegerType: integer.
lines.purchasepackpricenumber,nullType: number.
lines.sellpricenumber,nullType: number.
lines.discountnumber,nullType: number. Optional. Decimal Precision defined by profile DISCOUNTDECIMALS in Exo system. Note that discounts may have additional restrictions on them in system.
lines.unitpricenumber,nullType: 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.ispriceoverriddenboolean,nullType: boolean. Optional. Specifies if the price has been overridden. Overridden prices are not recalculated if an order is edited in Exo Business.
lines.locationidinteger,nullType: integer. Optional. Stock Location that the line should be supplied from. If not specified will be defaulted based on API User.
lines.taxrateidinteger,nullType: integer. Optional. TaxrateID for the line. If unspecified will default based on Debtor/Stock Item hierarchy from Exo.
lines.linetypeinteger,enum,nullType: integer. Optional. Linetypes can be (0 = Normal stockline,1 = BOM header line,2 = BOM component line,4 = Comment/Narrative line). Default is 0.
lines.stocktypeenum,calculatedType: enum. DO NOT SPECIFY. Will be either PhysicalItem or Lookup Item. (Defines if Item has stock, retrieved from stock item record)
lines.idinteger,nullType: integer. Database ID number for Order line. SOLINEID value from SALESORD_LINES.
lines.branchidinteger,nullType: integer. Optional. Branch the line's profit should be reported to. If not specified is inherited from Order branch or User.
lines.taxratevaluenumber,nullType: number. Optional. (Recommended DO NOT SPECIFY). The taxrate for the line. (Percentage). To correctly specify taxrates use taxrateid
lines.istaxoverriddenboolean,nullType: 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.taxoverridevaluenumber,nullType: number. Optional. If istaxoverridden is true then must specify the exact tax amount for the line.
lines.narrativestring,nullType: string. Optional. Additional narrative (nvarchar(Max)) for recording additional information.
lines.backorderquantitynumber,nullType: number. Optional. Specifies the backorder quantity for a line (which affects stock availability and supply processes in Exo Business.)
lines.descriptionstring,nullType: 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.batchcodestring,nullType: 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.duedatedate,nullType: date. Optional, line specific duedate. Should be in format YYYY-MM-DD when set.
lines.linetotalnumber,calculatedType: number. DO NOT SPECIFY. Calculated based on unitprice * orderquantity less discount. Tax Exclusive line-total.
lines.rankorderinteger,nullType: integer. For determining line-position when printing.
lines.extrafieldsarray,nullType: array. Optional. Defined in individual user databases against SALESORD_LINES level. For assistance speak to database's implementation partner.
creditoridinteger,nullType: integer.
authorisationstaffnointeger,nullType: integer.
authorisationdatedate,nullType: date.
isconfirmedboolean,nullType: boolean.
leadtimeusedinteger,nullType: integer.
hstatusinteger,enumType: integer.
sosourcerefstring,nullType: string.
campaignwaveseqnostring,nullType: string.
hasuninvoicedboolean,calculatedType: boolean. DO NOT SPECIFY. Whether order has uninvoiced lines.
hasunsuppliedboolean,calculatedType: boolean. DO NOT SPECIFY. Whether order has unsupplied lines.
accountnamestring,nullType: string. Optional. Always retrieves the Accountname value from the Debtor account.
istaxinclusiveboolean,nullType: boolean, defaults false. (Tax Exclusive). Defines if pricing on the order is tax inclusive or tax exclusive.
hasbackordersboolean,calculatedType: boolean. DO NOT SPECIFY. Whether order has backordered lines.
branchidinteger,nullType: integer. Default branch for the order. If unspecified will be drawn based on user profile. BRANCHNO field.
defaultlocationidinteger, nullType: integer. Default stock location for order. If unspecified will default based on user. DEFLOCNO field.
narrativestring,nullType: string. Optional. Additional narrative (nvarchar(Max)) for recording information at a Sales Order Header level.
currencyidinteger,nullType: 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
salespersonidinteger,nullType: integer. Optional. Salesperson for the Order, is an integer specifying the staff member from the STAFF table.
exchangeratenumber,nullType: number. Optional. Exchange rate order was received at. Must be 1 for currencyno 0.
taxtotalnumber,calculatedType: number. DO NOT SPECIFY. The total tax value of the order.
subtotalnumber,calculatedType: number. DO NOT SPECIFY. The subtotal of all lines without tax.
referencestring,nullType: string. Optional, reference field for order. Default definition NVARCHAR(20)
instructionsstring,nullType: string. Optional, delivery instruction field for order. Default database definition NVARCHAR(255)
createdatedate,calculatedType: date. DO NOT SPECIFY. Timestamp of order being created.
orderdatedate,nullType: date. Optional, date of order. Should be in format YYYY-MM-DD when set. Defaults to today's date.
duedatedate,nullType: date. Optional, overall order duedate. Should be in format YYYY-MM-DD when set.
finalisationdatedate,nullType: date. Optional, date order was finalised. Should be in format YYYY-MM-DD when set. Should be left alone.
activationdatedatetime,nullType: date. Optional. Date order was activated. Full timestamp value. Defaults to current time. Returns string.
deliveryaddressarray,nullType: array. Delivery address for order, if unspecified will default to Debtor account delivery address.
deliveryaddress.line1string,nullType: 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.line2string,nullType: 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.line3string,nullType: 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.line4string,nullType: 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.line5string,nullType: 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.line6string,nullType: 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.
statusinteger,enumType: 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.)
statusdescriptionstring calculatedType: string. DO NOT SPECIFY. Description of the Status integer.
finalisedinteger,nullType: integer. Optional. Specifies the Finalisation status of order. 0 = Normal, 1 = Deleted, 2 = Forced Fully Processed, 3 = Lost Quote
ordertotalnumber,calculatedType: number. DO NOT SPECIFY. Calculated total of the Order.
localvaluenumber,calculatedType: number. DO NOT SPECIFY. The converted value of the order in the system denomination currency. (Ordertotal * exchangerate)
lastupdateddatetime,calculatedType: date. DO NOT SPECIFY. Date order was last edited. Full timestamp value. Defaults to current time on order update. Returns string.
extrafieldsarray,nullType: array. Optional. Defined in individual user databases against SALESORD_HDR level. For assistance speak to database's implementation partner.
idinteger,nullType: integer. ID value specified is the SEQNO from SALESORD_HDR
hrefstring,nullType: string. DO NOT SPECIFY. URI location for retrieving sales order.

Example json GET response

Example

json
[
  {
    "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"
  }
]