Sales Line API
Overview
The WMS Sales Line API is a Business Central API page designed to manage sales line data. This API allows external systems to interact with sales line records, providing functionality for creating, reading, and updating sales line information.
API Details
- Publisher: smart
- API Group: wms
- API Version: v2.0
- Entity Name: salesLine
- Entity Set Name: salesLines
- Source Table: Sales Line
- ODataKeyFields: Document Type, Document No., Line No.
Fields
The following fields are exposed in the API:
| Field Name | Source Field | Required | Description |
|---|---|---|---|
DocumentType | Sales Line."Document Type" | Yes | Type of the sales document. |
DocumentNo | Sales Line."Document No." | Yes | Number of the sales document. |
LineNo | Sales Line."Line No." | No | Line number of the sales line. |
Type | Sales Line.Type | No | Type of the sales line (e.g., Item). |
No | Sales Line."No." | Yes | Item or resource number. |
VariantCode | Sales Line."Variant Code" | No | Variant code for the item. |
LocationCode | Sales Line."Location Code" | No | Location code for the sales line. |
Quantity | Sales Line.Quantity | No | Quantity of the item. |
QtytoShip | Sales Line."Qty. to Ship" | No | Quantity to be shipped. |
QtyToInvoice | Sales Line."Qty. to Invoice" | No | Quantity to be invoiced. |
UnitPrice | Sales Line."Unit Price" | No | Unit price of the item. |
LotNo | LotNo | No | Lot number for the item. |
Notes
- The
LineNofield is automatically generated and incremented by 10,000 for each new sales line.
Example Usage
Create a New Sales Line
POST host/instance/api/smart/wms/v2.0/companies(companyId)/salesLines
Content-Type: application/json
{
"DocumentType": "Order",
"DocumentNo": "SO001",
"No": "ITEM001",
"Quantity": 10,
"LocationCode": "MAIN",
"LotNo": "LOT123"
}
Retrieve a Sales Lines
GET host/instance/api/smart/wms/v2.0/companies(companyId)/salesLines?$filter=DocumentType eq 'Order' & DocumentNo eq 'SO001'
Update a Sales Line
PATCH host/instance/api/smart/wms/v2.0/companies(companyId)/salesLines('Order','SO001',10000)
Content-Type: application/json
{
"Quantity": 15
}