API - MES Output


Overview

The is an API to create an output transaction in the MES transaction queue.

  • This API will create a new entry in table MES Transaction Line

  • The header (MES Transaction) will be created automatically, if it does not already exist

  • Modification is not allowed. If a wrong entry was created, it must be deleted and a new one created instead, unless it has already been posted, then it is not possible to delete it.

  • When an Output Transaction is processed by the MES posting routine, the trade items are created.
    -> See more information about the workflow: MES Use Case: Production


Endpoint name

mesOutput

Source table

WiFiAPIs MES Transaction Line

Fixed view/defaults

This endpoint will only create/show transactions with Type = Receipt.

Requests allowed

  • POST is used to create transactions

  • PATCH is not allowed.

  • DELETE is not allowed.

  • GET is possible, but not recommended since this endpoint is specifally designed to insert entries. To view transactions, it is better to use API - MES Transactions

Primary key

The primary key of a transaction line is transactionId + lineNo

Record ID

The record ID is systemId

Procedures

None


About Output transactions

  • When an Output is processed by the MES processor, inventory is created on the given location, similar as positive adjustment in BC.

    • Each Output transaction can have multiple lines, and for each line an Open Trade Item will be created

  • Locations

    • The locations on the lines are used for the posting, but the header will automatically get the Location of the first line. Transactions with mixed locations are allowed, because the location on the header is only for information. It should not be empty, because else the transaction will not get through the error checks.

    • When adding lines to a transaction that has a location in the header, that location will be set as a default for fromLocation.

  • Stage

    • Stage is required, because it will become the Stage of the trade items.

    • The default for the Stage, comes from the Default Stage on the Terminal card.

  • Stock Center

    • Stock Center is also mandtory

    • The Stock Center can be set on the transaction’s header by using the default Terminal card, field Default Stock Center.

  • Pallet creation

    • This procedure will create a pallet, if it does not already exist

  • Reservation

    • Using the reserve to fields

    • Adding trade items on an already existing pallet, will



Data

Field List

Property

Type

Format

Description


systemId

string

uuid

The automatic system ID, which is in GUID format.

record id

non-editable

transactionId

integer


The Transaction this line belongs to.

  • Skip this when creating a new transaction.

  • Can be used to add a line to a transaction that already has been created. If used, the transaction with this ID must already exist. It is not possible to use an ID that does not exist.

PRIMARY KEY

OPTIONAL

lineNo

integer


The sequence number of this line, within the transaction which has ID = transactionId

This is set automatically as next number..

PRIMARY KEY

non-editable

terminal

string

max 10

The terminal will indicate from which manufacturing unit or machine this entry comes from. This could for example be one packing station. This is mandatory, but if there is only one terminal, this can be set up as a default on page API Base Setup.

OPTIONAL

externalReference

string

max 10

The sender needs to use their own reference, because every transaction needs to be unique. The same external reference can be used repeatedly in order to add an item line (for example a new package) to a transaction already created.

Mandatory

lot

string

max 10

The production lot to post this output on.

Mandatory

productionDate

string

date

Production date for the items.

Mandatory

expirationDate

string

date

Expiration date for the items. If not given, the system will calculate it automatically.

OPTIONAL

location

string

max 10

The location of the produced item / trade item.

OPTIONAL

itemNo

string

max 20

Item No.

Mandatory

quantity

decimal


quantity and unitOfMeasure are mandatory, unless weight is used instead.

Mandatory *

unitOfMeasure

string

max 10

The unit of measure that belongs to the quantity field.

Mandatory *

weight

decimal


Weight, if used, it is the weight in the base weight unit of Wisefish.

Mandatory *

weightUnitOfMeasure

string

max 10

Only to be used for irregular items, or when real weight must be registered. Or when weight is in another unit than the general weight unit of the system.

If not given, it will be set as the Weight Unit of the item.

OPTIONAL

pieces

decimal


For some trade items, the number of pieces is given and saved on the Trade Item record. This can for example be number of fish in a box.

OPTIONAL

tradeItemBarcode

string

max 22

If given, this will be the Trade Item Barcode on the Trade Item entry.

OPTIONAL

palletBarcode

string

max 20

If this trade item was put on a pallet, give the pallet barcode in this property.

OPTIONAL

palletNo

string

max 20

If the pallet has already been created, this field can be skipped.

OPTIONAL

documentType

string


To use when this production output is for a specific document. Allowed values:

  • Sales Agreement - when producing to sales order which is a Delivery Agreement.

  • Sales Order - when producing to a standard sales order

  • Production Agreement - when production for a production agreement (Not implemented yet)

  • Production Order- when production for a production order (Not implemented yet)

If skipped, system will try to populate this according to documentNo, if used, by searching for the given document number in these 3 tables.

OPTIONAL

documentNo

string

max 20

The document number.

A production output transaction can belong to a

  • Production Agreement - when producing into stock - NOT IMPLEMENTED YET

  • Delivery Agreement - when producing into order. When this is used, the output trade items will be automatically reserved on this sales document.

  • Sales Order - same functionality but for standard sales orders.

  • Production Order (Not implemented yet)

  • Production Agreement (Not implemented yet)

The API does not check if a document with this number exists in the system. If it does not exist, the transaction will stop in the processing queue later.

When adding a line to a a current Transaction, the documentNo is not necessary, because it has already been put on the transaction. But if it is given, it must match the document number on the transaction.

OPTIONAL

reserveToDocType

string

enum

Used when the produced items are to be reserved directly to a sales document, which are either

  • Delivery (Sales) Agreements, in Wisefish

  • Standard Sales Orders

If documenType is used, referring to a sales document, this property get automatically populated on the transactions line and can therefore be skipped. See examples below.

optional

reserveToDocNo

string

max 20

Used with the field above, the number of the document.

If documentNo is used, referring to a sales document, this property get automatically populated on the transactions line and can therefore be skipped. See examples below.

optional

reserveToLineNo

integer


Used with the field above, the number of the document line, if needed. If not given, the system will find a matching line.

optional







Example Object

Expand to see the example json

An example of one object :

JSON
{
    "systemId": "76f12af1-d80c-f111-b02e-c90982a94d21",
    "transactionId": 74,
    "lineNo": 1,
    "terminal": "INNOVA",
    "externalReference": "PROD-06",
    "lot": "LOT005",
    "productionDate": "2026-02-18",
    "itemNo": "70079",
    "quantity": 10,
    "unitOfMeasure": "BOX",
    "weight": 10,
    "pieces": "",
    "tradeItemBarcode": "",
    "palletBarcode": "",
    "palletNo": "",
    "documentType": "Sales Agreement",
    "documentNo": "DA-0125",
    "lastModified": "2026-02-18T14:48:53.38Z"
}


Default Values

This is explained in more details in document MES Inbound - Error Handling & Validation but the main defaults and automatic population is as follows:

  • Creation of the Transaction:

    • Type will be Output

    • Activity Date will be the productionDate or today

    • If not given, Document Type will be set automatically as Production Agreement if documentNo contains a production agreement number.

    • For this API there is no property for Stock Center or Location, these values should get their default value from any of the following tables:

      • Terminal table

      • User Profile

      • Lot

  • Creation of the Transaction Line:

    • Line No. is set automatically

    • Lot is set the same as on the Transaction

Usage

Create an output transaction for a single item

Using an “External Reference” that does not exist on an existing transaction, will result in the creation of a new Transaction.

In the following example, an output is posted for 20 boxes on a single pallet that is to be produced for a sales agreement:

JSON
POST
.../mesOutput

Body:
{   
    "terminal": "INNOVA",
    "externalReference": "PROD-09",    
    "productionDate": "2026-02-18",    
    "itemNo": "70079",
    "documentNo": "DS-056",
    "lot": "02-18-001",
    "quantity": 20,
    "unitOfMeasure": "BOX",
    "palletNo": "33230",
    "palletBarcode": "00137300000002332307"
}

The response will show all the properties of the endpoint:

JSON
{
    "@odata.context": "https://containers.wisefish.com/BC/api/wisefish/mes/v1.0/$metadata#companies(cf9f7b85-dd11-ef11-9f8b-6045bde9cc61)/outputTransactions/$entity",
    "@odata.etag": "W/\"JzIwOzExMzk0MDU5NDkyNTA2MTcwNTE5MTswMDsn\"",
    "systemId": "9efafa9f-870d-f111-b02e-ed7e9281a12c",
    "transactionId": 79,
    "lineNo": 1,
    "terminal": "INNOVA",
    "externalReference": "PROD-09",
    "documentType": "SalesAgreement",
    "documentNo": "DS-056",
    "productionDate": "2026-02-18",
    "itemNo": "70079",
    "quantity": 20,
    "unitOfMeasure": "BOX",
    "weight": 20,
    "pieces": 0,
    "lot": "02-18-001",
    "tradeItemBarcode": "",
    "palletBarcode": "00137300000002332307",
    "palletNo": "33230",
    "lastModified": "2026-02-19T11:39:19.21Z"
}


  • The primary key of the created transaction can be seen in property transactionId

  • The primary key of the transaction line is in 2 properties: transactionId and lineNo

  • lineNo has value 1, which means that this is the first item line for this transaction.


Add trade item to an existing output transaction

Using Transaction ID

Posting again, with the transactionId just created, will add a new line on the same transaction.

POST
.../mesOutput

{   
    "terminal": "INNOVA",
    "externalReference": "PROD-09",    
    "productionDate": "2026-02-18",    
    "itemNo": "70079",
    "documentNo": "DS-056",
    "lot": "02-18-001",
    "quantity": 10,
    "unitOfMeasure": "BOX",
    "palletNo": "33230",
    "palletBarcode": "00137300000002332307"
}

The response shows that line number 2 has now been added:

JSON
{
    "@odata.context": "https://containers.wisefish.com/BC/api/wisefish/mes/v1.0/$metadata#companies(cf9f7b85-dd11-ef11-9f8b-6045bde9cc61)/outputTransactions/$entity",
    "@odata.etag": "W/\"JzE5OzI0OTY0MTczNDQ4MTcxNDkxOTExOzAwOyc=\"",
    "systemId": "1ccf7c0c-880d-f111-b02e-ed7e9281a12c",
    "transactionId": 79,
    "lineNo": 2,
    "terminal": "INNOVA",
    "externalReference": "PROD-09",
    "documentType": "SalesAgreement",
    "documentNo": "DS-056",
    "productionDate": "2026-02-18",
    "itemNo": "70079",
    "quantity": 10,
    "unitOfMeasure": "BOX",
    "weight": 10,
    "pieces": "33230",
    "lot": "02-18-001",
    "tradeItemBarcode": "",
    "palletBarcode": "00137300000002332307",
    "palletNo": "33230",
    "lastModified": "2026-02-19T11:42:21.143Z"
}

Then the transaction looks like this, because it has 2 item lines:

ADD SNAPSHOT OF page in BC


Using External Reference

In a similar way, the same externalReference can be used repeatedly, to add multiple lines on the same transaction. There is an example of this in documentation API - MES Receipt.


Packages on same Pallet

Putting 2 packages on the same pallet, could be done in the following way:

JSON
POST
.../mesOutput

Create a transaction for every package, by putting the package ID into Trade
{
    "terminal": "INNOVA",
    "externalReference": "5145",
    "productionDate": "2025-12-12",
    "itemNo": "112600",
    "quantity": 1,
    "unitOfMeasure": "PACK",
    "weight": 25,
    "lot": "2025-12-12",
    "palletBarcode": "00137300000002332307",
    "palletNo": "S099000"
}
Then for next package, repeat this but with another "externalReference":
{
    "terminal": "INNOVA",
    "externalReference": "5146",
    "productionDate": "2025-12-12",
    "itemNo": "112600",
    "quantity": 1,
    "unitOfMeasure": "PACK",
    "weight": 25,
    "lot": "2025-12-12",
    "palletBarcode": "00137300000002332307",
    "palletNo": "S099000"
}

=> A transaction with one item line will be created for every pack


Another way would be to accumulate the whole pallet into one entry:

  • identify the transaction by putting the pallet number into externalReference

  • send in each package identity in the tradeItemBarcode:

JSON
POST
.../mesOutput

{
    "terminal": "INNOVA",
    "externalReference": "S099000",
    "productionDate": "2025-12-12",
    "itemNo": "112600",
    "quantity": 1,
    "unitOfMeasure": "PACK",
    "weight": 25,
    "lot": "2025-12-12",
    "tradeItemBarcode": "5145",
    "palletBarcode": "00137300000002332307",
    "palletNo": "S099000"
}
{
    "terminal": "INNOVA",
    "externalReference": "S099000",
    "productionDate": "2025-12-12",
    "itemNo": "112600",
    "quantity": 1,
    "unitOfMeasure": "PACK",
    "weight": 25,
    "lot": "2025-12-12",
    "tradeItemBarcode": "5146",
    "palletBarcode": "00137300000002332307",
    "palletNo": "S099000"
}


Older version (External Production app)

In the older version of the Wisefish MES this was posted in the following way with endpoint InboundInnovaEntries

JSON
POST
.../inboundInnovaEntries

{
    "soapID": "107",
    "packetId":5145,
    "producerId": "A373" ,
    "masters": 1,
    "weight": 25,
    "nominal": 25,
    "quantity": 1,
    "quantityunit": "PACK",
    "itemId": "112600",
    "palletNo": "S099000",
    "sscc": "00137300000002332307",
    "lotid": "2025-12-12",
    "warehouseId": "SALT",
    "productionDate": "2025-12-12T00:00:00Z",
    "registrationDate": "2023-12-12T00:00:00Z"
}


Reserving production for sales

Create an output and instantly reserve to a Sales document

Using the “reserve to” properties will instantly reserve the trade item after creation:

In the following example, an output is posted for 1 pallet with 32 boxes, and reserved to a sales agreement:

JSON
POST
.../mesOutput

Body:
{   
    "terminal": "INNOVA",
    "externalReference": "PROD-09",    
    "productionDate": "2026-03-13",    
    "itemNo": "70079",
    "lot": "13-03-01",
    "quantity": 32,
    "unitOfMeasure": "BOX",
    "palletNo": "33251",
    "palletBarcode": "00137300000002332510",
    "reserveToDocType": "SalesAgreement",
    "reserveToDocNo": "DA-001"
}


Create an output and reserve multiple items on the same sales document

In this example documentNo is used instead of reserveToDocNo - with same results.

JSON
POST
.../mesOutput

Create first entry and there give
- the sales document documentNo:
- the pallet

Body:
{   
    "externalReference": "0106-03",
    "productionDate": "2026-05-31",    
    "itemNo": "70061-2",
    "lot": "PROD-0106",
    "quantity": 30,
    "unitOfMeasure": "BOKS",
    "tradeItemBarCode" : "ITEM-1",
    "palletNo": "33251",
    "palletBarcode": "00137300000002332510",
    "documentNo": "DA-011"  
}

Send another request for same reference and lot, to add another package,
- skip document, because it will be the same for all packages in the same transaction
- Use same pallet barcode
{   
    "externalReference": "0106-03",
    "lot": "PROD-0106",
    "itemNo": "70061-2",
    "quantity": 30,
    "unitOfMeasure": "BOKS",
    "tradeItemBarCode" : "ITEM-2",
    "palletNo": "33251",
    "palletBarcode": "00137300000002332510",
    "documentNo": "DA-011"  
}

To add the third barcoded package, only change the tradeItemBarcode:
{   
    "externalReference": "0106-03",
    "lot": "PROD-0106",
    "itemNo": "70061-2",
    "quantity": 30,
    "unitOfMeasure": "BOKS",
    "tradeItemBarCode" : "ITEM-3",
    "palletNo": "33251",
    "palletBarcode": "00137300000002332510",
    "documentNo": "DA-011"  
}

S