salesOrder resource type

Represents a sales order in Business Central.

Note

For information about enabling APIs for Business Central see Enabling the APIs for Dynamics 365 Business Central.

Methods

MethodReturn TypeDescription
GET salesOrdersalesOrderGets a sales order object.
DELETE salesOrdernoneDeletes a sales order object.
POST salesOrdersalesOrderCreates a sales order object.
PATCH salesOrdersalesOrderUpdates a sales order object.

Bound Actions

The salesOrder resource type offers a bound action called shipAndInvoice, which ship and invoices the corresponding salesOrder batch. This is illustrated in the following example: POST https://<server address>:<server API port>/<server instance name>/api/v2.0/companies({id})/salesOrders({id})/Microsoft.NAV.shipAndInvoice

The response has no content; the response code is 204.

NavigationReturn TypeDescription
customercustomerGets the customer of the salesOrder.
dimensionValuedimensionValueGets the dimensionvalue of the salesOrder.
currencycurrencyGets the currency of the salesOrder.
paymentTermpaymentTermGets the paymentterm of the salesOrder.
shipmentMethodshipmentMethodGets the shipmentmethod of the salesOrder.
dimensionSetLinesdimensionSetLinesGets the dimensionsetlines of the salesOrder.
salesOrderLinessalesOrderLinesGets the salesorderlines of the salesOrder.
pdfDocumentpdfDocumentGets the pdfdocument of the salesOrder.
attachmentsattachmentsGets the attachments of the salesOrder.
documentAttachmentsdocumentAttachmentsGets the documentattachments of the salesOrder.

Properties

PropertyTypeDescription
idGUIDThe unique ID of the sales order. Non-editable.
numberstringSpecifies the number of the sales order.
externalDocumentNumberstringSpecifies an external document number for the sales order.
orderDatedateThe order date.
postingDatedateThe date that the sales order is posted.
customerIdGUIDThe unique ID of customer.
customerNumberstringThe customer's number.
customerNamestringThe customer's name.
billToNamestringBill to name.
billToCustomerIdGUIDBill to customer id.
billToCustomerNumberstringBill to customer number.
shipToNamestringShip to name.
shipToContactstringShip to contact.
sellToAddressLine1stringSell to address line 1.
sellToAddressLine2stringSell to address line 2.
sellToCitystringSell to city.
sellToCountrystringSell to country.
sellToStatestringSell to state.
sellToPostCodestringSell to post code.
billToAddressLine1stringBill to address line 1.
billToAddressLine2stringBill to address line 2.
billToCitystringBill to city.
billToCountrystringBill to country.
billToStatestringBill to state.
billToPostCodestringBill to post code.
shipToAddressLine1stringShip to address line 1.
shipToAddressLine2stringShip to address line 2.
shipToCitystringShip to city.
shipToCountrystringShip to country.
shipToStatestringShip to state.
shipToPostCodestringShip to post code.
shortcutDimension1Codestring
shortcutDimension2Codestring
currencyIdGUIDSpecifies which currency the sales order uses.
currencyCodestringThe default currency code for the sales order.
pricesIncludeTaxbooleanSpecifies whether the prices include Tax or not. Read-Only.
paymentTermsIdGUIDSpecifies which payment term the sales order uses.
shipmentMethodIdGUIDSpecifies which shipment method the sales order uses.
salespersonstringThe salesperson code for the sales order.
partialShippingbooleanSpecifies whether partial shipping of items is preferred or not.
requestedDeliveryDatedateThe requested delivery date.
discountAmountdecimalThe sales order discount amount.
discountAppliedBeforeTaxbooleanSpecifies whether the discount is applied before tax.
totalAmountExcludingTaxdecimalThe total amount excluding tax. Read-Only.
totalTaxAmountdecimalThe total tax amount for the sales order. Read-Only.
totalAmountIncludingTaxdecimalThe total amount including tax. Read-Only.
fullyShippedbooleanSpecifies whether the items of the sales order were fully shipped or not.
statusNAV.salesOrderEntityBufferStatusSpecifies the status of the sales order. It can be "Draft", "In Review" or "Open".
lastModifiedDateTimedatetimeThe last datetime the sales order was modified. Read-Only.
phoneNumberstringSpecifies the sales order's telephone number.
emailstringSpecifies the sales order's email address.

JSON representation

Here's a JSON representation of the salesOrder resource.

{
    "id": "GUID",
    "number": "string",
    "externalDocumentNumber": "string",
    "orderDate": "date",
    "postingDate": "date",
    "customerId": "GUID",
    "customerNumber": "string",
    "customerName": "string",
    "billToName": "string",
    "billToCustomerId": "GUID",
    "billToCustomerNumber": "string",
    "shipToName": "string",
    "shipToContact": "string",
    "sellToAddressLine1": "string",
    "sellToAddressLine2": "string",
    "sellToCity": "string",
    "sellToCountry": "string",
    "sellToState": "string",
    "sellToPostCode": "string",
    "billToAddressLine1": "string",
    "billToAddressLine2": "string",
    "billToCity": "string",
    "billToCountry": "string",
    "billToState": "string",
    "billToPostCode": "string",
    "shipToAddressLine1": "string",
    "shipToAddressLine2": "string",
    "shipToCity": "string",
    "shipToCountry": "string",
    "shipToState": "string",
    "shipToPostCode": "string",
    "shortcutDimension1Code": "string",
    "shortcutDimension2Code": "string",
    "currencyId": "GUID",
    "currencyCode": "string",
    "pricesIncludeTax": "boolean",
    "paymentTermsId": "GUID",
    "shipmentMethodId": "GUID",
    "salesperson": "string",
    "partialShipping": "boolean",
    "requestedDeliveryDate": "date",
    "discountAmount": "decimal",
    "discountAppliedBeforeTax": "boolean",
    "totalAmountExcludingTax": "decimal",
    "totalTaxAmount": "decimal",
    "totalAmountIncludingTax": "decimal",
    "fullyShipped": "boolean",
    "status": "NAV.salesOrderEntityBufferStatus",
    "lastModifiedDateTime": "datetime",
    "phoneNumber": "string",
    "email": "string"
}

GET salesOrder
DELETE salesOrder
POST salesOrder
PATCH salesOrder