Skip to content

Sales Order

Return information on a Sales Order.

Released
Updated
URLSupports
{URI}/salesorder/
GETPUTPOST
{URI}/salesorder/search?q={query}
GET
{URI}/salesorder/validate/{salesorderid}
POST
{URI}/salesorder/{salesorderid}?overridelock=true
PUT
{URI}/salesorder/convertquotetoorder/
POST
{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 sales orders that match the specified search string.

validate validates a sales order, ideally before performing a PUT or POST - see below.

overridelock overrides object locks (if any) on a sales order that needs to be updated.

convertquotetoorder converts the specified sales order quote to a full sales order. The endpoint is called with the Sales Order ID as the paylod, e.g.

json
{
"id": 12345
}

If successful, it returns a new sales order object. If the status of the specified sales order isn’t 3 (Quotation), the endpoint will return an error.

Attribute Details

AttributeTypeNotes
debtoridintegerType: Required on PUT, POST. ACCNO from Salesord_Hdr, defines the Debtor Account making the order. (Relates to DR_ACCS ACCNO)
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.isoriginatedfromtemplateboolean,nullType: boolean. Optional.
lines.orderquantitynumberType: number. Decimal Precision defined by profile QTYDECIMALS in Exo system.
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.listpricenumber,nullType: number. Optional. Defines the RRP of the item at time of ordering.
lines.pricepolicyidinteger,nullType: integer. Optional. Should be 0 or refer to a price policy that this price is taken from.
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.uninvoicedquantitynumber,calculatedType: number. DO NOT SPECIFY. Always 0 for new Orders/Quotes. Do not change value as Supply via API is not enabled.
lines.releasequantitynumber,calculatedType: number. DO NOT SPECIFY. Always 0 for new Orders/Quotes. Do not change value as Supply via API is not enabled.
lines.releasenowquantitynumber,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.lastreleasedquantitynumber,calculatedType: number. DO NOT SPECIFY. Always 0 for new Orders/Quotes. Do not change value as Supply via API is not enabled.
lines.pickedquantitynumber,calculatedType: number. DO NOT SPECIFY. Always 0 for new Orders/Quotes. Do not change value as Supply via API is not enabled.
lines.picknowquantitynumber,calculatedType: number. DO NOT SPECIFY. Always 0 for new Orders/Quotes. Do not change value as Supply via API is not enabled.
lines.lastpickedquantitynumber,calculatedType: number. DO NOT SPECIFY. Always 0 for new Orders/Quotes. Do not change value as Supply via API is not enabled.
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. Required on PUT. Do not specify on POST, only on PUT. Database ID number for Order line. For POST either leave blank or specify a negative number. 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.invoicedquantitynumber,calculatedType: number. DO NOT SPECIFY. Always 0 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.lastinvoicedquantitynumber,calculatedType: number. DO NOT SPECIFY. Always 0 for new Orders/Quotes. Do not change value as Supply via API is not enabled.
lines.suppliedquantitynumber,calculatedType: number. DO NOT SPECIFY. Always 0 for new Orders/Quotes. Do not change value as Supply via API is not enabled.
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.lastsuppliedquantitynumber,calculatedType: number. DO NOT SPECIFY. Always 0 for new Orders/Quotes. Do not change value as Supply via API is not enabled.
lines.restrictedlineboolean, calculatedType: boolean. DO NOT SPECIFY. Specifies whether the line has restricted stock on it.
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.
taxroundingnumber,nullType: number. Defines the tax rounding override for the order.
deliverycountinteger,calculatedType: integer. DO NOT SPECIFY. Count of past delivery events.
invoicecountinteger,calculatedType: integer. DO NOT SPECIFY. Count of past invoice events.
pickedcountinteger,calculatedType: integer. DO NOT SPECIFY. Count of past picking events.
releasecountinteger,calculatedType: integer. DO NOT SPECIFY. Count of past release events.
hasuninvoicedboolean,calculatedType: boolean. DO NOT SPECIFY. Whether order has uninvoiced lines.
hasunpickedboolean,calculatedType: boolean. DO NOT SPECIFY. Whether order has unpicked lines.
hasunreleasedboolean,calculatedType: boolean. DO NOT SPECIFY. Whether order has unreleased lines.
hasunsuppliedboolean,calculatedType: boolean. DO NOT SPECIFY. Whether order has unsupplied lines.
allowcustomerordernumberbooleanType: boolean. Related to order number validation.
customerordernumberstring,nullType: string. Optional. Linked to the CUSTORDERNO field (which has to be added as an Extra Field to be visible in the front end UI). Default schema definition is NVARCHAR(20)
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
contactidinteger,nullType: integer. Optional. Contact associated for the sales order. Note: Contacts are an optional feature controlled by profiles, and may not be visible to all systems depending on configuration.
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. Required on POST. 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)
hasrestrictedlineboolean,calculatedType: boolean. Specifies whether the order has restricted stock on it.
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. Must be specified for PUT. For POST must be blank or negative value. ID value specified is the SEQNO from SALESORD_HDR
hrefstring,nullType: string. DO NOT SPECIFY. URI location for retrieving sales order.

Validating Sales Orders

The salesorder/validate endpoint validates a sales order, ideally before performing a PUT or POST. The minimum attributes required for a valid VALIDATE request are:

  • Debtorid
  • Status
  • Stockcode - applies to order lines and if the stock item is not a BOM
  • Bomcode - applies to order lines and if the item is a BOM

A VALIDATE request would be used in two scenarios:

  • Updating a record - In such a case, it returns a list of errors, if any, that would prevent a successful PUT.
  • Creating a new Sales Order - VALIDATE has been designed primarily for this use. It accepts a minimum set of attributes, i.e. debtor and status. The response returns all the other attributes, which would then be the payload for a POST. The response attributes adhere to the various user and computer profiles that apply to an order in EXO Business.

VALIDATE requests are also particularly useful when adding Bill of Materials items to the order. Passing in just the bomcode in the VALIDATE request would return the entire BOM set of header and components.

POST has more required fields than a VALIDATE. Developers are recommended to POST/PUT a response returned by VALIDATE. To verify what fields are required for a PUT and POST, refer to the API schemas.

To update, GET, make changes, VALIDATE, then PUT. To create, VALIDATE, then POST

Example json GET response

Example

json
{
  "debtorid": 2,
  "stockcode": "DIFF01",
  "isoriginatedfromtemplate": false,
  "orderquantity": 1,
  "discount": 0,
  "unitprice": 2386.62,
  "ispriceoverridden": false,
  "locationid": 1,
  "taxrateid": 0,
  "listprice": 2386.62,
  "pricepolicyid": -1,
  "linetype": 0,
  "uninvoicedquantity": 0,
  "releasequantity": 1,
  "releasenowquantity": 0,
  "lastreleasedquantity": 0,
  "pickedquantity": 0,
  "picknowquantity": 0,
  "lastpickedquantity": 0,
  "stocktype": "PhysicalItem",
  "id": 10009,
  "branchid": 0,
  "taxratevalue": 12.5,
  "istaxoverridden": false,
  "taxoverridevalue": 0,
  "backorderquantity": 0,
  "description": "Hi-Performance Differential",
  "duedate": "2014-10-10",
  "linetotal": 2386.62,
  "invoicedquantity": 0,
  "invoicenowquantity": 0,
  "lastinvoicedquantity": 0,
  "suppliedquantity": 0,
  "supplynowquantity": 0,
  "lastsuppliedquantity": 0,
  "restrictedline": false,
  "rankorder": 1,
  "taxrounding": 0,
  "deliverycount": 0,
  "invoicecount": 0,
  "pickedcount": 0,
  "releasecount": 0,
  "hasuninvoiced": false,
  "hasunpicked": false,
  "hasunreleased": false,
  "hasunsupplied": false,
  "allowcustomerordernumber": false,
  "accountname": "MARKER METRO",
  "istaxinclusive": false,
  "hasbackorders": false,
  "defaultlocationid": -1,
  "currencyid": 0,
  "contactid": -1,
  "salespersonid": 2,
  "exchangerate": 1,
  "taxtotal": 298.33,
  "subtotal": 2386.62,
  "createdate": "2014-09-13T00:00:00+10:00",
  "orderdate": "2014-09-13",
  "line1": "4238 Anzac Rd",
  "line2": "Kingsford",
  "line3": "NSW",
  "line4": "Australia",
  "line5": "",
  "line6": "",
  "status": 3,
  "statusdescription": "Quotation",
  "finalised": 0,
  "ordertotal": 2684.95,
  "localvalue": 2386.62,
  "hasrestrictedline": false,
  "lastupdated": "2013-11-12T11:55:32+11:00",
  "key": "X_CHECKEDBY",
  "href": "{URI}https://exo-stage.api.myob.com/salesorder/10009"
}

{URI} is defined as: http://exo.api.myob.com/