API - Closed Trade Items


Overview

Trade Items are items that have the field “Trade Item Type” populated. The options are:

  • Raw Material

  • WIP

  • Product

The API returns the list of Trade Items that are no longer in stock, because they have been sold or used, for example.

This data can for example be used to trace from a produced item to the raw materials.

Endpoint name

closedTradeItems

Source table

WiFi Trade Item Ledger Entry

Fixed view

The endpoint only lists items that are not in inventory any more, so there is a fixed filter on non-empty Closing Type:

where("Closing Type" = filter(<> ''));

Requests allowed

GET

Primary key

stage, lineNo

Record ID

systemId

Procedures

None


Data

Field List

Property

Type

Format

Description


1

systemId

string

uuid

The system ID of the entry.

Record ID

non-editable

2

stage

string

max 20

Each trade item was created for a specific stage.

primary key

3

lineNo

integer


Within each stage, the trade items are numbered with a sequential number.

primary key

4

itemNo

string

max 20

Item number.


5

itemDescription

string

max 100

Description from the Item card.


6

itemType

string

enum

Trade item type. Options: (blank), Raw Material, WIP, Product


7

variantCode

string

max 10

Variant code.


8

lot

string

max 20

Lot number.


9

stockCenterCode

string

max 20

Stock center code.


10

quantityBase

number

decimal

Quantity in base unit of measure.


11

unitOfMeasureBase

string

max 10

Base unit of measure.


12

tradeItems

number

decimal

Number of trade items.


13

tradeItemUnitOfMeasure

string

max 10

Trade item unit of measure.


14

weight

number

decimal

Weight.


15

creationType

string

enum

Creation type. Options: (blank), Transfer, Purchase, Fishing Trip, Production, Repacking, Sales, Storage


16

inboundDocumentNo

string

max 20

Inbound document number.


17

inboundDocumentType

string


Inbound document type.


18

inboundPostingDate

string

date

Inbound posting date.


19

vesselCode

string

max 20

Vessel code.


20

fishingAreaCode

string

max 10

Fishing area code.


21

productionDate

string

date

Production date.


22

tradeItemBarcode

string

max 22

Trade item barcode.


23

palletBarcode

string

max 20

Pallet barcode.


24

closingType

string

enum

Closing type. Options: (blank), Credit, Sale, Usage, Repacking, Depreciation, Scrap, Storage


25

consumedToLot

string

max 20

Consumed-to lot.


26

consumedToStage

string

max 20

Consumed-to stage.


27

outboundDocumentNo

string

max 20

Outbound document number.


28

outboundDocumentType

string


Outbound document type.


29

outboundPostingDate

string

date

Outbound posting date.


30

scheduledTripNo

string

max 20

Scheduled trip number.


31

transportUnitID

integer


Transport unit ID.


32

baseCertificationProgram

string

max 10

Base certification program.


Object Example

JSON
{
    "systemId": "9e6d83c3-3637-f111-b030-c053a2f93f8a",
    "stage": "PRODUCED",
    "lineNo": 65,
    "itemNo": "70064",
    "itemDescription": "Salmon Pack of 3 boxes",
    "itemType": "Product",
    "variantCode": "",
    "lot": "CREDIT-TEST",
    "stockCenterCode": "OWN",
    "quantityBase": 3,
    "unitOfMeasureBase": "BOKS",
    "tradeItems": 1,
    "tradeItemUnitOfMeasure": "STK",
    "weight": 6,
    "creationType": "Production",
    "inboundDocumentNo": "27-0064",
    "inboundDocumentType": " ",
    "inboundPostingDate": "2026-04-09",
    "vesselCode": "",
    "fishingAreaCode": "",
    "productionDate": "2026-04-09",
    "tradeItemBarcode": "",
    "palletBarcode": "",
    "closingType": "Credit",
    "consumedToLot": "",
    "consumedToStage": "",
    "outboundDocumentNo": "",
    "outboundDocumentType": " ",
    "outboundPostingDate": "2026-04-13",
    "scheduledTripNo": "",
    "transportUnitID": 0,
    "baseCertificationProgram": ""
}

Examples

Read closed trade items

Closed Trade Items for a specific Item

To get all closed trade items for item 70064:

JSON
GET ../closedTradeItems?$filter=itemNo eq '70064'

Read one closed trade item

The Record ID is systemId, so one entry is read with a GET request on the following format (the response is one object, as shown in Object Example):

JSON
GET .../closedTradeItems(9e6d83c3-3637-f111-b030-c053a2f93f8a)

Trade items sold in a period

Lists the trade items that were sold in April 2026 and returns only the item, lot, quantity and sales document with $select.

JSON
GET .../closedTradeItems?$filter=closingType eq 'Sale' and outboundPostingDate ge 2026-04-01 and outboundPostingDate le 2026-04-30&$select=itemNo,lot,quantityBase,unitOfMeasureBase,outboundDocumentNo

Trace consumption

Trade items consumed into a production lot

Lists the trade items (raw materials or WIP) that were consumed into production lot LOT0206, i.e. traces a produced lot back to its raw materials.

JSON
GET .../closedTradeItems?$filter=consumedToLot eq 'LOT0206'

Response (shortened to one entry):

JSON
{
    "@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#companies(cf9f7b85-dd11-ef11-9f8b-6045bde9cc61)/closedTradeItems",
    "value": [
        {
            "@odata.etag": "W/\"JzE5OzI5NDgxNzI2MzA1NTkxODQ3NzMxOzAwOyc=\"",
            "systemId": "4b1f62d0-3537-f111-b030-c053a2f93f8a",
            "stage": "RECEIVED",
            "lineNo": 12,
            "itemNo": "1000",
            "itemDescription": "Þorsklifur - ósnyrt",
            "itemType": "Raw Material",
            "variantCode": "",
            "lot": "COD-LIVER-18-12",
            "stockCenterCode": "OWN",
            "quantityBase": 250,
            "unitOfMeasureBase": "KG",
            "tradeItems": 25,
            "tradeItemUnitOfMeasure": "KAR",
            "weight": 250,
            "creationType": "Purchase",
            "inboundDocumentNo": "107012",
            "inboundDocumentType": " ",
            "inboundPostingDate": "2026-04-07",
            "vesselCode": "",
            "fishingAreaCode": "",
            "productionDate": "2026-04-07",
            "tradeItemBarcode": "",
            "palletBarcode": "",
            "closingType": "Usage",
            "consumedToLot": "LOT0206",
            "consumedToStage": "PRODUCED",
            "outboundDocumentNo": "",
            "outboundDocumentType": " ",
            "outboundPostingDate": "2026-04-09",
            "scheduledTripNo": "",
            "transportUnitID": 0,
            "baseCertificationProgram": ""
        }
    ]
}