Breadcrumbs

API - MES Receiving Transaction


Overview

The is an API to create a receiving 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

  • The properties of this API are specifically named for "reception data"

  • Modification is not allowed. If a wrong entry was created, it can be deleted and recreated, if its status allows.

  • When a Receiving Transaction is processed by the MES posting routine, the following will be modified in Wisefish:

    • If it’s a transaction linked to a Receipt Agreement, an inbound line is updated on the agreement which will create a Trade Item after posting.

    • If it’s a transaction linked to a Fishing Trip, a Trade Item will be posted for a lot that is linked to the Fishing Trip.

    • More info about the workflow, see document MES Workflow - Receiving


Endpoint name

receivingTransactions

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.

(If GET is used, it will only show lines with Transaction Type = Receipt.

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

Max Len

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

3

lineNo

integer


The number of this line, within the transaction if ID = transactionId

PRIMARY KEY

non-editable

4

terminal

string

10

The Terminal Code will say from which manufacturing unit this entry comes from. If there is only one terminal, this can be set up as a default.

OPTIONAL

5

externalReference

string

10

The sender can use it’s own reference, in order to add a line to a transaction already created.

Mandatory

6

documentType

string


Allowed values:

  • Receipt Agreement

  • Fishing Trip

  • Purchase Order

If skipped, system will try to figure it out according to documentNo.

Mandatory *

7

documentNo

string

20

A receiving transaction must belong to a document, these can be any of the following:

  • Receipt Agreement No.

  • Fishing Trip No.

  • Purchase Order No.

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

receiptDate

date


The date of the receipt of the items.


9

itemNo

string

20

Item No.

Mandatory *

10

quantity

decimal


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

Mandatory *

11

unitOfMeasure

string

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

10

For some receipts, the lot can be known beforehand.

OPTIONAL

15

tradeItemBarcode

string

22

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

OPTIONAL

16

palletBarcode

string

20

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

OPTIONAL

17

palletNo

string

20

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

OPTIONAL

18

lastModified

date-time utc


The system populates this value automatically.

non-editable


Example Object

Expand to see the example json

An example of one object :

JSON
{
    "@odata.context": "https://containers.wisefish.com/BC/api/wisefish/mes/v1.0/$metadata#companies(cf9f7b85-dd11-ef11-9f8b-6045bde9cc61)/receivingTransactions/$entity",
    "@odata.etag": "W/\"JzIwOzE2MTcxNTMyODcwMDc0OTAwMjM0MTswMDsn\"",
    "systemId": "5c251d5b-d80c-f111-b02e-c90982a94d21",
    "transactionId": 72,
    "lineNo": 1,
    "terminal": "POSTMAN",
    "extReference": "REC-04",
    "documentType": "PurchaseAgreement",
    "documentNo": "PR-049",
    "receiptDate": "2026-02-18",
    "itemNo": "70064",
    "quantity": 50,
    "unitOfMeasure": "KG",
    "weight": 50,
    "pieces": "",
    "lot": "PURCH01",
    "tradeItemBarcode": "",
    "palletBarcode": "",
    "palletNo": "",
    "lastModified": "2026-02-18T14:44:41.65Z"
}


Automatic Fields

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 Receipt

    • Activity Date will be the receiptDate or today

    • If not given, Document Type will be set automatically after the documentNo has been searched for in the system.

    • 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

Usage

Create a receipt transaction for a single item

Using an “External Reference” that does not exist on an existing transaction, will create a new one.

In the following example, the PR-0050 could be the number of a Receipt Agreement, and a pallet with 10 boxes is being received.

JSON
POST
.../receivingTransactions

Body:
{   
    "externalReference": "ID-0123",
    "documentNo": "PR-0050",
    "itemNo": "70079",
    "quantity": 10,
    "unitOfMeasure": "BOX",
    "palletBarcode": "00050000000000000005"
}

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)/receivingTransactions/$entity",
    "@odata.etag": "W/\"JzIwOzE1NTI3NzUwMjkzNjQ0MzE2MTM2MTswMDsn\"",
    "systemId": "d13ef9f5-24df-f011-b02a-a0f00c1d9c9e",
    "transactionId": 33,
    "lineNo": 1,
    "externalReference": "ID-0123",
    "documentNo": "PR-0050",
    "itemNo": "70079",
    "quantity": 10,
    "unitOfMeasure": "BOX",
    "weight": 100,
    "pieces": "",
    "tradeItemBarcode": "",
    "palletBarcode": "00050000000000000005",
    "palletNo": "",
    "lastModified": "2025-12-22T10:57:09.707Z"
}
  • 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

  • documentType was skipped because the PR-0050 is found as Receipt Agreement

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


Add trade item to an existing receipt transaction

Using Transaction ID

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

POST
.../receivingTransactions

{   
    "transactionId": 33,
    "documentNo": "PR-0050",
    "itemNo": "70079",
    "quantity": 11.5,
    "unitOfMeasure": "kg",
    "palletBarcode": "00050000000000000005"
}

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)/receivingTransactions/$entity",
    "@odata.etag": "W/\"JzIwOzExNzk4NzY0NzQxMTM0ODI2NzYyMTswMDsn\"",
    "systemId": "552f8937-25df-f011-b02a-a0f00c1d9c9e",
    "transactionId": 33,
    "lineNo": 2,
    "extReference": "",
    "documentNo": "PR-0050",
    "itemNo": "70079",
    "quantity": 11.5,
    "unitOfMeasure": "KG",
    "weight": 11.5,
    "pieces": "",
    "tradeItemBarcode": "",
    "palletBarcode": "00050000000000000005",
    "palletNo": "",
    "lastModified": "2025-12-22T10:58:59.703Z"
}


Using External Reference

In a similar way, the same externalReference can be used repeatedly, to add multiple lines on the same transaction.

JSON
POST
.../receivingTransactions

Body:
{   
    "extReference": "ID-0123",
    "documentNo": "PR-0050",
    "itemNo": "70079",
    "quantity": 12.0,
    "unitOfMeasure": "kg",
    "palletBarcode": "00050000000000000005"
}

The response shows, that now the third line as been created on the same transaction:

JSON
{
    "@odata.context": "https://containers.wisefish.com/BC/api/wisefish/mes/v1.0/$metadata#companies(cf9f7b85-dd11-ef11-9f8b-6045bde9cc61)/receivingTransactions/$entity",
    "@odata.etag": "W/\"JzIwOzEzNzA2MjgyODE5NzMyMTE2NDQzMTswMDsn\"",
    "systemId": "35accb2a-26df-f011-b02a-a0f00c1d9c9e",
    "transactionId": 33,
    "lineNo": 3,
    "externalReference": "ID-0123",
    "documentNo": "PR-0050",
    "itemNo": "70079",
    "quantity": 12,
    "unitOfMeasure": "KG",
    "weight": 12,
    "pieces": "",
    "tradeItemBarcode": "",
    "palletBarcode": "00050000000000000005",
    "palletNo": "",
    "lastModified": "2025-12-22T11:05:47.823Z"
}


Receiving landed raw material

Create Fishing Trip

First the Fishing Trip needs to be created, if it does not already exist:

JSON
POST
.../fishingTrips
{
    "landingDate": "2024-04-16",
    "landingTime": "16:00",
    "endDate": "2024-04-05",
    "startDate": "2024-04-04",
    "vessel": "2625",
    "aveWeightOfFish": 3.45,
    "salesPrice": 982,    
}
The reponse will say what the ID of the Fishing Trip is. Let's say it would be:
{
  "tripNo": "900061",
  ...
}

Receive raw material

Then the receivingTransactions endpoint can be used repeatedly for all the items received.

Example:

JSON
POST
.../receivingTransactions
{   
    "externalReference": "12345",
    "documentType": "Fishing Trip",
    "documentNo": "900061",
    "receiptDate": "2023-08-17",
    "itemNo": "001",
    "weight": 1200,
    "palletBarcode": "00050000000000000001"
}
...then another pallet.
{   
    "externalReference": "12346",
    "documentType": "Fishing Trip", 
    "documentNo": "900061",
    "receiptDate": "2023-08-17",
    "itemNo": "001",
    "weight": 1205,
    "palletBarcode": "00050000000000000002"
}
...and third pallet, etc.
{   
    "externalReference": "12347",
    "documentType": "Fishing Trip", 
    "documentNo": "900061",
    "receiptDate": "2023-08-17",
    "itemNo": "001",
    "weight": 1998,
    "palletBarcode": "00050000000000000003"
}


In older version (Inbound from Innova) this was posted in the following way:

JSON
POST
.../inboundInnovaEntries
{
    "soapID": "108",
    "aveWeightOfFish": 3.45,
    "endDate": "2024-04-05",
    "itemId": "1",
    "landingDate": "2024-04-16T00:00:00Z",
    "masters": 1,
    "productionDate": "2023-08-17T00:00:00Z",
    "registrationDate": "2024-04-15T20:10:00Z",
    "salesPrice": 982,    
    "startDate": "2024-04-04",
    "supplier": "2625",
    "tripno": "900061",
    "warehouseId": "RawMaterial",
    "weight": 1200
}