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 Name | Source Field | Required | Description |
|---|---|---|---|
DocumentType | Purchase Header."Document Type" | Yes | Type of the document (Return Order). |
No | Purchase Header."No." | Yes | Unique identifier for the return order. |
VendorNo | Purchase Header."Buy-from Vendor No." | Yes | Vendor number associated with the order. |
VendorName | Purchase Header."Buy-from Vendor Name" | No | Name of the vendor. |
LocationCode | Purchase Header."Location Code" | No | Location code for the order. |
DocumentDate | Purchase Header."SMA API Document Date" | Yes | Date of the document. |
PostingDate | Purchase Header."Posting Date" | Yes | Posting date of the document. |
DueDate | Purchase Header."Due Date" | Yes | Due date for the return order. |
OrderDate | Purchase Header."SMA API Order Date" | Yes | Order date of the return order. |
VendorInvoiceNo | Purchase Header."Vendor Invoice No." | No | Vendor invoice number. |
Status | Purchase Header.Status | No | Status of the return order. |
PromisedReceiptDate | Purchase Header."Promised Receipt Date" | No | Promised receipt date for the order. |
Notes
- The API automatically marks records for release upon insertion. The
ReleaseAllMarkedandReleaseprocedures 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