Перейти к основному содержимому

Purchase Line API

Overview

The WMS Purchase Line API is a Business Central API page designed to manage purchase line data. This API allows external systems to interact with purchase line records, providing functionality for creating, reading, and updating purchase line information.

API Details

  • Publisher: smart
  • API Group: wms
  • API Version: v2.0
  • Entity Name: purchaseLine
  • Entity Set Name: purchaseLines
  • Source Table: Purchase Line
  • ODataKeyFields: Document Type, Document No., Line No.

Fields

The following fields are exposed in the API:

Field NameSource FieldRequiredDescription
DocumentTypePurchase Line."Document Type"YesType of the purchase document.
DocumentNoPurchase Line."Document No."YesNumber of the purchase document.
LineNoPurchase Line."Line No."NoLine number of the purchase document.
TypePurchase Line.TypeNoType of the line (e.g., Item, Resource).
NoPurchase Line."No."YesItem or resource number.
VariantCodePurchase Line."Variant Code"NoVariant code of the item.
LocationCodePurchase Line."Location Code"NoLocation code for the line.
QuantityPurchase Line.QuantityNoQuantity of the item.
QtyToReceivePurchase Line."Qty. to Receive"NoQuantity to be received.
DirectUnitCostPurchase Line."Direct Unit Cost"NoDirect unit cost of the item.
LotNoLotNoNoLot number for the item.
SerialNumberSerialNumberNoSerial number for the item.
FactoryNoFactoryNoNoFactory number for the item.
ExpirationDateExpirationDateNoExpiration date for the item.
ExpectedReceiptDatePurchase Line."Expected Receipt Date"NoExpected receipt date for the line.
BinCodePurchase Line."Bin Code"NoBin code for the item.

Notes

  • The LineNo field is automatically generated and incremented by 10,000 for each new sales line.

Example Usage

Create a New Purchase Line

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

{
"DocumentType": "Order",
"DocumentNo": "PO001",
"No": "ITEM001",
"Quantity": 10,
"LocationCode": "MAIN",
"LotNo": "LOT001",
"ExpirationDate": "2025-12-31"
}

Retrieve a Purchase Lines

GET host/instance/api/smart/wms/v2.0/companies(companyId)/purchaseLines?$filter=DocumentType eq 'Order' & DocumentNo eq 'PO001'

Update a Purchase Line

PATCH host/instance/api/smart/wms/v2.0/companies(companyId)/purchaseLines('Order','PO001',10000)
Content-Type: application/json

{
"Quantity": 15,
"LotNo": "LOT002"
}
© 2008 - 2026 SMART business