Posting API
Overview
The WMS Order Posting API is a Business Central API page designed to handle the posting of WMS orders. This API allows external systems to trigger posting operations for orders and retrieve error messages related to the posting process.
API Details
- Publisher: smart
- API Group: wms
- API Version: v2.0
- Entity Name: orderPost
- Entity Set Name: orderPosting
- ODataKeyFields: ID
Fields
The following fields are exposed in the API:
| Field Name | Source Field | Required | Description |
|---|---|---|---|
SourceDocument | "SMA Source Document" | Yes | The source document type ("Sales Order","Purchase Order","Transfer Order","Purchase Return Order"). |
SourceNo | "SMA Source No." | Yes | The source document number. |
PostingType | Posting Type | Yes | The type of posting (Normal, Shipment, Receipt, Invoice). The allowed values depend on the source document; see Posting Types. |
ID | ID | No | Unique identifier. Assigned automatically; do not send it in the request. |
MessageType | "Message Type" | No | The type of message (e.g., error, warning). |
Description | Message | No | Detailed description of the error message. |
Posting Types
| Source Document | Allowed Posting Types | Result |
|---|---|---|
| Sales Order | Normal | The warehouse shipments of the order are posted, and then the order is invoiced. |
| Purchase Order | Normal, Receipt, Invoice | Receipt posts the receipt, Invoice posts the invoice, and Normal posts both. If the location requires receive, the receipt is posted through a warehouse receipt, which is created if it does not exist. |
| Transfer Order | Shipment, Receipt | Shipment posts the warehouse shipments of the order. Receipt creates and posts the warehouse receipts. Invoice is accepted but posts nothing. |
| Purchase Return Order | Normal, Shipment, Invoice | Shipment posts the shipment, Invoice posts the invoice, and Normal posts both. If the location requires shipment, the shipment is posted through a warehouse shipment, which is created if it does not exist. |
If the posting type is not allowed for the source document, the request fails with the Wrong Posting Type error.
Response
A failed posting does not return an HTTP error. The API creates a record with the posting result:
MessageTypeisInformationandDescriptionisOKif the posting succeeded;MessageTypeisErrorandDescriptioncontains the error text if the posting failed.
If a warehouse shipment could not be posted, the shpmtErrors sub-entity contains the available and missing quantities of the item.
Sub-Entities
Shipment Errors
This API includes a sub-entity for shipment errors:
- Entity Name: shpmtError
- Entity Set Name: shpmtErrors
- SubPageLink: Links to the error message entry using the ID field.
- Fields: see Warehouse Shipment Error Message API.
Example Usage
Post a Sales Order
POST host/instance/api/smart/wms/v2.0/companies(companyId)/orderPosting
Content-Type: application/json
{
"SourceDocument": "Sales Order",
"SourceNo": "SALES001",
"PostingType": "Normal"
}