Перейти до основного вмісту

Sales Return Order API

Overview​

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

API Details​

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

Fields​

The following fields are exposed in the API:

Field NameSource FieldRequiredDescription
DocumentTypeSales Header."Document Type"YesType of the document (always "Return Order").
NoSales Header."No."YesUnique identifier for the sales return order.
CustomerNoSales Header."Sell-to Customer No."YesCustomer number associated with the order.
CustomerNameSales Header."Sell-to Customer Name"NoName of the customer (read-only).
LocationCodeSales Header."Location Code"NoCode of the location for the return order.
DocumentDateSales Header."SMA API Document Date"NoDate of the document.
PostingDateSales Header."Posting Date"NoPosting date of the return order.
DueDateSales Header."Due Date"NoDue date of the return order.
OrderDateSales Header."SMA API Order Date"NoOrder date of the return order.
ShipmentFromLocationDateSales Header."SMA Shpt from Location Date"NoShipment from location date.
ShipmentFromLocationTimeSales Header."SMA Shpt from Location Time"NoShipment from location time.
CustomerOrderCategorySales Header."SMA Customer Order Category"NoCategory of the customer order.
StatusSales Header.StatusNoStatus of the sales return order.
ExternalDocumentNoSales Header."External Document No."NoExternal document number.
ShipToCodeSales Header."Ship-to Code"NoCode of the ship-to address.

Notes​

  • The DocumentType field is always set to "Return Order" for this API.
  • All sales return orders created via API are marked for release. The Release procedure releases the return order specified in the URL, and the ReleaseAllMarked procedure releases all marked sales return orders. After the release, a warehouse receipt is created for the return order.
  • Release returns OK. If the order is already released, it returns the ALREADY RELEASED error; if the release fails, it returns ERROR: followed by the error text.
  • ReleaseAllMarked returns OK or FAILED ORDERS: followed by the numbers of the orders that were not released. Such orders remain marked for release. If there are no marked orders, it returns the NO MARKED RECORDS error.
  • Service-enabled procedures are bound actions, so the releaseAllMarked URL must contain the key of an existing record. The action processes all marked orders regardless of which order is specified in the URL.
  • The salesLines part is linked to the SMA Sales Line API for managing sales order lines.

Example Usage​

Create a New Sales Return Order​

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

{
"No": "SRO001",
"CustomerNo": "CUST001",
"LocationCode": "MAIN",
"DocumentDate": "2023-10-01",
"PostingDate": "2023-10-02",
"DueDate": "2023-10-10",
"OrderDate": "2023-09-30",
"ExternalDocumentNo": "EXT12345"
}

Retrieve a Sales Return Order​

GET host/instance/api/smart/wms/v2.0/companies(companyId)/salesReturnOrders('Return_x0020_Order','SRO001')

Update a Sales Return Order​

PATCH host/instance/api/smart/wms/v2.0/companies(companyId)/salesReturnOrders('Return_x0020_Order','SRO001')
Content-Type: application/json

{
"LocationCode": "SECONDARY",
"DueDate": "2023-10-15"
}

Release a Sales Return Order​

POST host/instance/api/smart/wms/v2.0/companies(companyId)/salesReturnOrders('Return_x0020_Order','SRO001')/Microsoft.NAV.release

Release All Marked Sales Return Orders​

POST host/instance/api/smart/wms/v2.0/companies(companyId)/salesReturnOrders('Return_x0020_Order','SRO001')/Microsoft.NAV.releaseAllMarked
© 2008 - 2026 SMART business