Breadcrumbs

API - MES Output Transaction


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 Workflow - Production


Endpoint name

outputTransactions

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 allowed, but if course not possible if the entry has been processed.

  • 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


Data

Field List

Property

Type

Format

Description


1

systemId

string

uuid

The automatic system ID, which is in GUID format.

record id

non-editable

2

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

3

lineNo

integer


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

PRIMARY KEY

non-editable

4

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.

If there is only one terminal, this can be set up as a default on page API Base Setup.

OPTIONAL

5

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

6

documentType

string


Allowed values:

  • Production Agreement

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

  • Sales Order - when producing to a standard sales order

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

Mandatory *

7

documentNo

string

max 20

An output transaction can only belong to a document which is a Production Agreement. This field shall contain the number of that agreement.

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.

Mandatory

8

productionDate

string

date

Production date for the items.

Mandatory *

9

itemNo

string

max 20

Item No.

Mandatory *

10

quantity

decimal


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

Mandatory *

11

unitOfMeasure

string

max 10

The unit of measure that belongs to the quantity field.

Mandatory *

12

weight

decimal


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

Mandatory *

13

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

14

lot

string

max 10

For some receipts, the lot can be known beforehand.

OPTIONAL

15

tradeItemBarcode

string

max 22

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

OPTIONAL

16

palletBarcode

string

max 20

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

OPTIONAL

17

palletNo

string

max 20

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

OPTIONAL

18

lastModified

string

date-time

The system populates this value automatically.

non-editable


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",
    "documentType": "Sales Agreement",
    "documentNo": "DA-0125",
    "productionDate": "2026-02-18",
    "itemNo": "70079",
    "quantity": 10,
    "unitOfMeasure": "BOX",
    "weight": 10,
    "pieces": "",
    "lot": "LOT005",
    "tradeItemBarcode": "",
    "palletBarcode": "",
    "palletNo": "",
    "lastModified": "2026-02-18T14:48:53.38Z"
}


Default Values

This is explained in more details in document https://wisefish.atlassian.net/wiki/x/AYCVKQ 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
.../outputTransactions

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
.../outputTransactions

{   
    "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 Receiving Transaction.


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"
}


For this new endpoint, the body for this same transaction would look like this:

JSON
POST
.../outputTransactions

Create a transaction for every package, by putting the package ID into externalReference
{
    "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
.../outputTransactions

{
    "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"
}

=> Both packs will be added as item lines on the same transaction

.............................  REKJA ÞESSA
    "producerId": "A373" ,
  location?


Temp notes (to delete)

Ath. í gamla kerfi virkar þetta svona

PacketId er id til að þekkaj hvern pakka. Innova sendir þetta, en ekki endilega öll MES, t.d. ekki CodeIT.

Þetta var skrifaði niður í “WP Connection PK” í bæði flushed og OTI og TILE

ef ég geymi þetta bara í flushed, get ég ekki þannig fundið hvaða WP Connection PK þetta verður?

Eins og þetta er núna =>

  • Ef við setjum packetId í extReference => ef þarf að þekkja eininguna og geta rakið alveg niður á pakka, þá má bara vera eitt trade item í hverri Transaction.

  • Ef við setjum packetId í TradeItemBarcode => má safna saman í transaction