Перейти к основному содержимому

Sales Order API

Overview

The WMS Sales Orders API is a Business Central API page designed to manage sales order data. This API allows external systems to interact with sales order records, providing functionality for creating, reading, and updating sales orders.

API Details

  • Publisher: smart
  • API Group: wms
  • API Version: v2.0
  • Entity Name: salesOrder
  • Entity Set Name: salesOrders
  • Source Table: Sales Header
  • ODataKeyFields: Document Type, No

Fields

The following fields are exposed in the API:

Field NameSource FieldRequiredDescription
DocumentTypeSales Header."Document Type"NoType of the document (e.g., Order).
NoSales Header."No."YesUnique identifier for the sales order.
CustomerNoSales Header."Sell-to Customer No."YesCustomer number associated with the order.
CustomerNameSales Header."Sell-to Customer Name"NoName of the customer.
LocationCodeSales Header."Location Code"NoCode of the location for the order.
PostingDateSales Header."Posting Date"NoDate the order was posted.
ShipmentDateSales Header."Shipment Date"NoDate the order is scheduled for shipment.
CustomerOrderCategorySales Header."SMA Customer Order Category"NoCategory of the customer order.
StatusSales Header.StatusNoCurrent status of the sales order.
ExternalDocumentNoSales Header."External Document No."NoExternal reference number for the order.
ShipToCodeSales Header."Ship-to Code"NoCode for the shipping address.

Notes

  • The salesLines part is linked to the SMA Sales Line API for managing sales order lines.
  • The ReleaseAllMarked and Release procedures are service-enabled and can be used to release purchase orders. All records created via API are marked for release by default. You need just call 'ReleaseAllMarked' procedure to release all of them.

Example Usage

Create a New Sales Order

POST host/instance/api/smart/wms/v2.0/companies(companyId)/salesOrders
Content-Type: application/json

{
"DocumentType": "Order",
"No": "SO001",
"CustomerNo": "CUST001",
"PostingDate": "2023-01-01",
"ShipmentDate": "2023-01-05",
"LocationCode": "MAIN",
"CustomerOrderCategory": "Standard",
"ExternalDocumentNo": "EXT001"
}

Retrieve a Sales Order

GET host/instance/api/smart/wms/v2.0/companies(companyId)/salesOrders('Order','SO001')

Update a Sales Order

PATCH host/instance/api/smart/wms/v2.0/companies(companyId)/salesOrders('Order','SO001')
Content-Type: application/json

{
"ShipmentDate": "2023-01-10"
}

Release a Sales Order

POST host/instance/api/smart/wms/v2.0/companies(companyId)/salesOrders('SO001')/Microsoft.NAV.release

Release All Marked Sales Orders

POST host/instance/api/smart/wms/v2.0/companies(companyId)/salesOrders/Microsoft.NAV.releaseAllMarked
© 2008 - 2026 SMART business