Skip to main content

Purchase Return Order API

Overview​

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

API Details​

  • Publisher: smart
  • API Group: wms
  • API Version: v2.0
  • Entity Name: purchaseReturnOrder
  • Entity Set Name: purchaseReturnOrders
  • Source Table: Purchase Header
  • ODataKeyFields: Document Type, No

Fields​

The following fields are exposed in the API:

Field NameSource FieldRequiredDescription
DocumentTypePurchase Header."Document Type"YesType of the document (Return Order).
NoPurchase Header."No."YesUnique identifier for the return order.
VendorNoPurchase Header."Buy-from Vendor No."YesVendor number associated with the order.
VendorNamePurchase Header."Buy-from Vendor Name"NoName of the vendor.
LocationCodePurchase Header."Location Code"NoLocation code for the order.
DocumentDatePurchase Header."SMA API Document Date"YesDate of the document.
PostingDatePurchase Header."Posting Date"YesPosting date of the document.
DueDatePurchase Header."Due Date"YesDue date for the return order.
OrderDatePurchase Header."SMA API Order Date"YesOrder date of the return order.
VendorInvoiceNoPurchase Header."Vendor Invoice No."NoVendor invoice number.
StatusPurchase Header.StatusNoStatus of the return order.
PromisedReceiptDatePurchase Header."Promised Receipt Date"NoPromised receipt date for the order.

Notes​

  • The API automatically marks records for release upon insertion. The ReleaseAllMarked and Release procedures are service-enabled and can be used to release marked purchase orders.

Example Usage​

Create a New Purchase Return Order​

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

{
"DocumentType": "Return Order",
"No": "PR001",
"VendorNo": "VEND001",
"VendorName": "Sample Vendor",
"LocationCode": "MAIN",
"DocumentDate": "2023-01-01",
"PostingDate": "2023-01-01",
"DueDate": "2023-01-10",
"OrderDate": "2023-01-01",
"VendorInvoiceNo": "INV001",
"Status": "Open",
"PromisedReceiptDate": "2023-01-15"
}

Retrieve a Purchase Return Order​

GET host/instance/api/smart/wms/v2.0/companies(companyId)/purchaseReturnOrders('PR001')

Update a Purchase Return Order​

PATCH host/instance/api/smart/wms/v2.0/companies(companyId)/purchaseReturnOrders('PR001')
Content-Type: application/json

{
"Status": "Released"
}

Release a specific Purchase Return Order​

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

Release All Marked Purchase Return Orders​

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