Overview
The API returns the inventory of items that are Trade Items. Every trade item is a unique “individual” of a standard BC item.
No data update is allowed.
Trade Items are items that have the field “Trade Item Type” populated. The options are:
-
Raw Material
-
WIP
-
Product
Each trade item is linked to one Item card in BC. Details from the Item card can be read with items or itemDetails for more fields and child entries.
|
Endpoint name |
|
|
Source table |
|
|
Fixed view |
The endpoint only lists items that are still in inventory, so to ensure that, there is a fixed filter on empty Closing Type:
Records are sorted by |
|
Requests allowed |
GET (changes via procedures) |
|
Primary key |
|
|
Record ID |
|
|
Procedures |
|
Data
Field List
|
Property |
Type |
Format |
Description |
|
|
|---|---|---|---|---|---|
|
1 |
|
string |
uuid |
The systemID of the entry. |
Record ID non-editable |
|
2 |
|
string |
max 20 |
Each trade item was created for a specific Stage. |
primary key |
|
3 |
|
integer |
|
Within each stage, the trade items are numbered with a sequential number. |
primary key |
|
4 |
|
string |
max 20 |
Every trade item is a unique “individual” of a standard BC item. Same as |
|
|
5 |
|
string |
max 100 |
Description of the Trade Item. |
|
|
6 |
|
string |
enum |
Blank if it is a standard item, if not blank, it is a “trade item”. Options:
Same as |
|
|
7 |
|
string |
max 20 |
The lot of this trade item. |
|
|
8 |
|
string |
max 100 |
The description from the Item card. Same as |
|
|
9 |
|
string |
max 10 |
Variant Code |
|
|
10 |
|
number |
decimal |
Pieces |
|
|
11 |
|
string |
max 10 |
Location Code |
|
|
12 |
|
string |
max 20 |
Stock Center Code |
|
|
13 |
Quantity fields, that show how much this item is in inventory, it is shown in multiple units, according to the setup on the Item card in BC. |
|
|||
|
14 |
|
number |
decimal |
Quantity field: Unit field: This unit is the quantity in the base trade item unit of this item. All trade items for the same Item number, have the same unit in the “trade item base unit” On the Item card, this unit can be read from field |
|
|
15 |
|
string |
max 10 |
|
|
|
16 |
|
number |
decimal |
Quantity field: Unit field: This field contains the quantity and unit which was used when this trade item was created. |
|
|
17 |
|
string |
max 10 |
|
|
|
18 |
|
number |
decimal |
Quantity field: Unit field: This unit is the quantity in the base unit of this Item. Same as All trade items for the same Item number, have the same unit in the “base unit”. |
|
|
19 |
|
string |
max 10 |
|
|
|
20 |
|
number |
decimal |
When is this useful? Don’t remember. Quantity field: Unit field: |
|
|
21 |
|
string |
max 10 |
|
|
|
22 |
|
number |
decimal |
Field: |
|
|
23 |
|
number |
decimal |
Field: |
|
|
24 |
|
string |
enum |
Unit of measure of the weight (Base Weight Unit from Wisefish Setup). Options: Undefined, Kg, Lb |
|
|
25 |
Trade Item is on a barcoded pallet, or bar coded itself: |
|
|||
|
26 |
|
string |
max 20 |
Pallet Barcode |
|
|
27 |
|
string |
max 20 |
Pallet No. |
|
|
28 |
|
string |
max 20 |
Physical Pallet ID |
|
|
29 |
|
string |
max 22 |
Trade Item Barcode |
|
|
30 |
Various fields about the status of the item (ledger, hold, expiration) |
|
|||
|
31 |
|
string |
enum |
Status |
|
|
32 |
|
string |
enum |
Hold Status. Options: (blank), Released, Extended (BB4), Hold, QA Hold, QA Lock, Testing (BB4), Customs Hold |
|
|
33 |
|
string |
enum |
Agreement Type. Options: Delivery, Production, Receipt, Storage Shipment, Blanket |
|
|
34 |
|
string |
max 20 |
Agreement No. |
|
|
35 |
|
string |
date |
Posting Date (Inbound) |
|
|
36 |
|
string |
date |
Production Date |
|
|
37 |
|
string |
date |
Expiration Date |
|
|
38 |
If using the warehouse module (zones and bins) |
|
|||
|
39 |
|
string |
max 10 |
Zone Code |
|
|
40 |
|
string |
max 20 |
Bin Code |
|
|
41 |
|
integer |
int64 |
ID of the MES transaction that created the trade item (WP Connection PK). 0 if not created by MES. |
|
|
42 |
System fields: |
|
|||
|
43 |
|
integer |
|
System row version. Increments every time the record is modified. |
non-editable |
|
44 |
|
string |
date-time |
SystemModifiedAt (date and time of last change) |
non-editable |
Object Example
{
"systemId": "e996b124-3003-f011-b01d-f992b2580806",
"stage": "PRODUCTION",
"lineNo": 64,
"itemNo": "70064",
"description": "Cod - raw material",
"type": "Raw Material",
"lot": "LOT0051",
"itemDescription": "Cod - raw material",
"variantCode": "SV-0002",
"pieces": 0,
"locationCode": "BLUE",
"stockCenterCode": "BLA",
"tradeItemsBase": 500,
"tradeItemBaseUnitOfMeasure": "KG",
"tradeItems": 500,
"tradeItemUnitOfMeasure": "KG",
"quantityBase": 500,
"baseUnitOfMeasure": "KG",
"quantity": 500,
"unitOfMeasure": "KG",
"qtyPerUnitOfMeasure": 1,
"weight": 500,
"weightUnitOfMeasure": "Kg",
"palletBarcode": "",
"palletNo": "",
"physicalPalletID": "",
"tradeItemBarcode": "",
"status": "Posted in (BC inv.)",
"holdStatus": " ",
"reservedToDocumentType": "Delivery",
"reservedToDocumentNo": "",
"postingDateInbound": "2025-03-17",
"productionDate": "2025-03-17",
"expirationDate": "0001-01-01",
"zoneCode": "",
"binCode": "",
"mesTransactionId": 0,
"systemRowVersion": 2584102,
"lastModified": "2025-03-26T10:11:17.52Z"
}
Procedures
Procedures are called on a specific trade item: POST inventoryTradeItems(<systemId>)/Microsoft.NAV.<procedureName> with a JSON body of parameters. Each procedure returns a text message on success. On failure it returns an error with a readable message.
|
Procedure |
Parameters |
Description |
Details |
|---|---|---|---|
|
|
|
Add this trade item to an existing pallet, identified by the pallet barcode. A trade item that is already on another pallet is not moved. |
|
|
|
|
Remove this trade item from the pallet it is on. |
|
|
|
|
Split this trade item in two. The quantity to keep is given in the Trade Item Unit of Measure of the item. |
|
|
|
|
Split this trade item in two. The quantity to keep is given in any unit of measure of the item. |
Palletizing
Add a Trade Item to a Pallet
Procedure addToPallet adds this open trade item to an existing pallet, identified by the pallet barcode.
POST
.../inventoryTradeItems([record-id])/Microsoft.NAV.addToPallet
Body:
{
"setPalletBarcode" : [barcode of an existing pallet]
}
|
Parameters |
Type |
Max Len |
Description |
|
|---|---|---|---|---|
|
|
string |
20 |
Barcode of the pallet the trade item is added to. The pallet must exist. |
mandatory |
The trade item is added to the pallet, and a confirmation is shown in the value property of the response: Trade Item <Stage>-<Line No.> added to pallet <Pallet No.>.
If the trade item is already on this pallet, this is not an error. The call succeeds and returns: Trade Item <Stage>-<Line No.> is already on this pallet <Pallet No.>.
Possible errors, in the order they are checked:
-
The trade item given by the record ID in the URL does not exist (standard Business Central error).
-
The pallet does not exist:
Pallet with barcode <barcode> does not exist. -
The trade item is already on another pallet:
Trade Item <Stage>-<Line No.> is already on pallet with barcode <Current Pallet Barcode> and cannot be added to pallet <Pallet No.>.
This procedure does not move a trade item from another pallet. Remove it first withremoveFromPallet, or usepalletsprocedureaddTradeItem, which moves it. -
The reservation of the trade item and the pallet differ (also when the pallet is reserved and the trade item is not reserved to the same agreement):
Trade Item <Stage>-<Line No.> and pallet <Pallet No.> have different reservations. The trade item cannot be added to the pallet. -
The status of the pallet (Full or Reserved) does not allow adding trade items:
Pallet <Pallet No.> has status <Status> that does not allow adding trade items. -
The item does not match the key item of the pallet (when the Pallet Mixing setting of the key item does not allow item mixing):
Trade Item <Stage>-<Line No.> has item <Item No.>, which does not match key item <Key Item No.> on pallet <Pallet No.>. -
The lot does not match the lot on the pallet (when the Pallet Mixing setting of the key item does not allow lot mixing):
Trade Item <Stage>-<Line No.> has lot <Lot>, which does not match lot <Lot> on pallet <Pallet No.>.
Behaviour notes:
-
The pallet barcode must be given exactly as it is stored on the pallet (the barcode is not zero-padded).
-
The trade item gets the pallet no., physical pallet ID, bin code and loading information (loaded, loading date-time, scheduled trip, transport unit) of the pallet.
-
If the pallet is Empty, it gets status Open. If the pallet has no key item, the item of the trade item becomes the key item. If the pallet has a maximum number of trade items and it is exceeded, the pallet gets status Full.
-
If the trade item is reserved and the pallet is not, the reservation of the trade item is copied to the pallet.
Remove a Trade Item from a Pallet
Procedure removeFromPallet removes this trade item from the given pallet.
POST
.../inventoryTradeItems([record-id])/Microsoft.NAV.removeFromPallet
Body:
{
"setPalletBarcode" : [barcode of the pallet the trade item is on]
}
|
Parameters |
Type |
Max Len |
Description |
|
|---|---|---|---|---|
|
|
string |
20 |
Barcode of the pallet the trade item is removed from. The trade item must be on this pallet. |
mandatory |
The trade item is removed from the pallet, and a confirmation is shown in the value property of the response: Trade Item <Stage>-<Line No.> removed from pallet <Pallet No.>.
When the last trade item is removed from the pallet, the pallet gets status Empty, and its key item no. and reservation are cleared.
Possible errors, in the order they are checked:
-
The trade item given by the record ID in the URL does not exist (standard Business Central error).
-
The pallet does not exist:
Pallet with barcode <barcode> does not exist. -
The trade item is not on the given pallet:
Trade Item <Stage>-<Line No.> is not on pallet <Pallet No.>.
Behaviour notes:
-
The pallet barcode must be given exactly as it is stored on the pallet (the barcode is not zero-padded).
-
The pallet no., pallet barcode and physical pallet ID are cleared on the trade item, and a pallet history entry is created for it.
-
If trade items are still on the pallet, the pallet gets status Open (also if it was Full).
Splitting
Split Trade Items
Procedure splitTradeItems splits this open trade item in two. The quantity is given in the Trade Item Unit of Measure of the item, so the item must have a Trade Item Unit of Measure. The current trade item keeps the given number of trade items, and the rest is moved to a new open trade item with a new line no. The split is posted in the trade item ledger.
POST
.../inventoryTradeItems([record-id])/Microsoft.NAV.splitTradeItems
Body:
{
"setTradeItems" : [number of trade items to keep on the current trade item]
}
|
Parameters |
Type |
Max Len |
Description |
|
|---|---|---|---|---|
|
|
number |
|
The number of trade items, in the item's Trade Item Unit of Measure, that stay on the current trade item. The rest is moved to a new open trade item. |
mandatory |
The split is posted, a new open trade item is created for the remaining trade items, and the value property of the response is Split successfully posted.
Possible errors, in the order they are checked:
-
The trade item given by the record ID in the URL does not exist (standard Business Central error).
-
The item has no Trade Item Unit of Measure on the Item card (standard Business Central error: field
WiFi TI Unit of Measuremust have a value). -
The user has no User Setup, no User Profile Code in User Setup, or the User Profile does not exist (standard Business Central error).
-
The trade item is on a pallet and the User Profile of the user does not allow splitting from a pallet:
User Profile <User Profile Code> does not allow you to split from a pallet (<Pallet Barcode>). -
The Item Unit of Measure is missing, or has no Qty. per Unit of Measure, for the units used in the conversion (standard Business Central error).
-
More trade items are given than available:
Cannot split more trade items than available on the current open trade item. -
Errors from posting the split in Wisefish (standard Wisefish/Business Central errors).
Behaviour notes:
-
The weight fields stay zero on the new trade item if they are zero on the current trade item.
Split by Quantity and Unit
Procedure split works the same way as splitTradeItems, but the quantity can be given in any unit of measure of the item. The current trade item keeps the given quantity, and the rest is moved to a new open trade item.
POST
.../inventoryTradeItems([record-id])/Microsoft.NAV.split
Body:
{
"setQuantity" : [quantity to keep on the current trade item],
"setUnit" : [a unit of measure of the item]
}
|
Parameters |
Type |
Max Len |
Description |
|
|---|---|---|---|---|
|
|
number |
|
The quantity, in the unit given in |
mandatory |
|
|
string |
10 |
The unit of measure of the quantity. Must be an existing Item Unit of Measure for the item. |
mandatory |
The split is posted, a new open trade item is created for the remaining quantity, and the value property of the response is Split successfully posted.
Possible errors, in the order they are checked:
-
The trade item given by the record ID in the URL does not exist (standard Business Central error).
-
The unit is not a unit of measure of the item:
The specified unit of measure <Unit> is not valid for item <Item No.>. -
The user has no User Setup, no User Profile Code in User Setup, or the User Profile does not exist (standard Business Central error).
-
The trade item is on a pallet and the User Profile of the user does not allow splitting from a pallet:
User Profile <User Profile Code> does not allow you to split from a pallet (<Pallet Barcode>). -
The item has no Trade Item Unit of Measure, or a unit has no Qty. per Unit of Measure (standard Business Central error).
-
More is given than available:
Cannot split more trade items than available on the current open trade item. -
The same errors as for
splitTradeItems, such as splitting more than is available, or splitting from a pallet when the User Profile does not allow it. -
Errors from posting the split in Wisefish (standard Wisefish/Business Central errors).
Behaviour notes:
-
The quantity is converted from
setUnitto the base unit and to the Trade Item Unit of Measure of the item (rounded to 0.00001), and then split the same way as withsplitTradeItems.
Examples
Read trade items
Trade Items in stock on specific Location
To get the inventory on Location BLUE this request will do:
GET .../inventoryTradeItems?$filter=locationCode eq 'BLUE'
Read a single trade item
Reads one trade item by its Record ID (systemId). The response is one trade item object, as shown in Object Example.
GET .../inventoryTradeItems(e996b124-3003-f011-b01d-f992b2580806)
Read the trade items on a pallet
Reads all trade items in stock on the pallet with barcode 00050000000000001101.
GET .../inventoryTradeItems?$filter=palletBarcode eq '00050000000000001101'
Read trade items that are not on a pallet
Reads the trade items on Location BLUE that are not on any pallet (empty pallet barcode).
GET .../inventoryTradeItems?$filter=locationCode eq 'BLUE' and palletBarcode eq ''
Read trade items of an item and lot
Reads the trade items of item 70064 with lot LOT0051, and returns only a few fields with $select.
GET .../inventoryTradeItems?$filter=itemNo eq '70064' and lot eq 'LOT0051'&$select=stage,lineNo,tradeItems,tradeItemUnitOfMeasure,palletBarcode
Palletize trade items
Add trade item PRODUCTION-64 to a pallet
Adds trade item PRODUCTION-64 to pallet 00050000000000001101 (pallet no. 000000000110) using addToPallet.
POST .../inventoryTradeItems(e996b124-3003-f011-b01d-f992b2580806)/Microsoft.NAV.addToPallet
{
"setPalletBarcode": "00050000000000001101"
}
Response:
{
"@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#Edm.String",
"value": "Trade Item PRODUCTION-64 added to pallet 000000000110."
}
Add a trade item that is already on the pallet
Calls addToPallet again for trade item PRODUCTION-64, which is already on the pallet. This is not an error.
Request:
POST
.../inventoryTradeItems(e996b124-3003-f011-b01d-f992b2580806)/Microsoft.NAV.addToPallet
Body:
{
"setPalletBarcode" : "00050000000000001101"
}
Response:
{
"@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#Edm.String",
"value": "Trade Item PRODUCTION-64 is already on this pallet 000000000110."
}
Remove trade item PRODUCTION-64 from a pallet
Removes trade item PRODUCTION-64 from pallet 00050000000000001101 using removeFromPallet.
POST .../inventoryTradeItems(e996b124-3003-f011-b01d-f992b2580806)/Microsoft.NAV.removeFromPallet
{
"setPalletBarcode": "00050000000000001101"
}
Response:
{
"@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#Edm.String",
"value": "Trade Item PRODUCTION-64 removed from pallet 000000000110."
}
Split a trade item
Keep 200 trade items and split off the rest
Trade item PRODUCTION-64 has 500 KG. With splitTradeItems, 200 stay on it and 300 are moved to a new trade item.
POST .../inventoryTradeItems(e996b124-3003-f011-b01d-f992b2580806)/Microsoft.NAV.splitTradeItems
{
"setTradeItems": 200
}
Response:
{
"@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#Edm.String",
"value": "Split successfully posted"
}
Keep 200 KG and split off the rest
The same split with split, where the quantity is given with a unit of measure.
POST .../inventoryTradeItems(e996b124-3003-f011-b01d-f992b2580806)/Microsoft.NAV.split
{
"setQuantity": 200,
"setUnit": "KG"
}
Response:
{
"@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#Edm.String",
"value": "Split successfully posted"
}