API - MES Transfer


Overview

The is an API to create a transfer 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 or deletion is not allowed. If a wrong entry was created, it must be deleted (with the transactionLines endpoint) and a new one created instead, unless it has already been processed, then it is not possible to delete it.

  • When a Transfer is processed by the MES processor, the trade items are moved to another Location.


About Transfer transactions

  • When an Transfer is processed by the MES processor, inventory is moved from one location to another. This is often called reclassification in BC.

    • Each Transfer transaction can have multiple lines, but only one line can exist for same Item No. and Lot.

  • Locations

    • Both Location and To Location is needed to perform the posting, given as parameters.

    • 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

    • If Stage is populated, only trade items with that stage will be transferred. Leaving the field blank, will not put any constraints when selecting the trade item to transfer.

    • With this endpoint, a Stage can only be set on the transaction’s header by default from field Default Stage on the Terminal card.

    • (This value not have any effect when transferring standard items.)

  • Stock Center (on transaction)

    • With this endpoint, a Stock Center can be set on the transaction’s header by using the default Terminal card, field Default Stock Center. If it is populated, only trade items with that stock center will be transferred. Leaving it blank, will not put any constraints when selecting the trade item to transfer.

    • (This field has no no value when transferring standard items.)

  • To Stock Center (on transaction line)

    • This field makes it possible to transfer trade items to a new Stock Center, at the same time it is transferred to a new location.

    • (This field has no no value when transferring standard items.)


Endpoint name

mesTransfer

Source table

WiFiAPIs MES Transaction Line

Fixed view/defaults

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

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


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

This is set automatically as next number..

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. This is mandatory, but 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

date

string

date

Date of the transfer.

Mandatory

7

fromLocation

string

max 10

The current location of the item / trade item.

Mandatory

8

fromStockCenter

string

max 20

The current stock center of the item / trade item.

OPTIONAL

9

toLocation

string

max 10

The new location of the item / trade item.

Mandatory

10

toStockCenter

string

max 20

Using this field will also change the Stock Center of the item.

OPTIONAL

11

itemNo

string

max 20

Item No. of the item to be moved.

Mandatory

12

lot

string

max 10

The lot of the item to be moved.

Mandatory

13

quantity

decimal


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

Mandatory *

14

unitOfMeasure

string

max 10

The unit of measure that belongs to the quantity field.

This can be skipped if the Terminal is marked with

Mandatory *

15

weight

decimal


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

OPTIONAL

16

tradeItemStage

string

max 20

A relation to the moved Trade Item can be given with tradeItemStageand tradeItemLineNo

OPTIONAL

17

tradeItemLineNo

number


A relation to the moved Trade Item can be given with tradeItemStageand tradeItemLineNo

OPTIONAL

18

tradeItemBarcode

string

max 22

A relation to the moved Trade Item can be given with it’s barcode.

OPTIONAL

19

lastModified

string

date-time

Timestamp.

non-editable


Example Object

Expand to see the example json

An example of one object :

JSON
{
    "@odata.etag": "W/\"JzIwOzEzNzkzNTM5NDc3NTg0OTU1NzgyMTswMDsn\"",
    "systemId": "ac322c0f-5949-f111-b032-ccc8a446a9f5",
    "transactionId": 428,
    "lineNo": 1,
    "terminal": "INNOVA",
    "externalReference": "06-MAY-T6",
    "date": "2026-05-06",
    "fromLocation": "",
    "fromStockCenter": "",
    "toLocation": "",
    "toStockCenter": "",
    "itemNo": "SALMON",
    "lot": "OR-00001",
    "quantity": 6,
    "unitOfMeasure": "KG",
    "weight": 0,
    "tradeItemStage": "",
    "tradeItemLineNo": 0,
    "tradeItemBarcode": "",
    "lastModified": "2026-05-06T14:37:09.073Z"
}


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 Transfer

    • Activity Date will be the value of property dateor if not given, it will be set as today

    • For this API there it is possible to leave the fromStockCenter and fromLocation empty, and let these values be populated automatically from any of the following tables:

      • Terminal table

      • User Profile

  • Creation of the Transaction Line:

    • Line No. is set automatically

  • There are no default values set for To Location and To Stock Center.


Usage

Transfer a Trade Item between locations

In the following example, an transfer is created for 20 pieces of an item:

JSON
POST
.../mesTransfer

{   
    "externalReference": "06-may-t8",
    "itemNo": "SALMON",
    "quantity": 6,
    "lot": "OR-00001",
    "fromLocation": "OSLO",
    "fromStockCenter": "OWN",
    "toLocation": "BERGEN",
    "toStockCenter": "FRIEND"
}

The response will show all the properties of the endpoint:

JSON
{
    "@odata.etag": "W/\"JzIwOzEwMTIxMTg3NDgwMzgxMjMyMjgwMTswMDsn\"",
    "systemId": "46c55af7-5f49-f111-b032-ccc8a446a9f5",
    "transactionId": 432,
    "lineNo": 1,
    "terminal": "INNOVA",
    "externalReference": "06-MAY-T8",
    "date": "2026-05-06",
    "fromLocation": "OSLO",
    "fromStockCenter": "OWN",
    "toLocation": "BERGEN",
    "toStockCenter": "FRIEND",
    "itemNo": "SALMON",
    "lot": "OR-00001",
    "quantity": 6,
    "unitOfMeasure": "KG",
    "weight": 0,
    "tradeItemStage": "",
    "tradeItemLineNo": 0,
    "tradeItemBarcode": "",
    "lastModified": "2026-05-06T15:26:35.587Z"
}
  • 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.


Transfer standard Items between locations

When using standard items, it works in the same way, except stock centers are not used.

In this example the standard item is lot tracked:

JSON
POST
.../mesTransfer

Body:

{   
    "externalReference": "06-may-t9",
    "itemNo": "80216-T",
    "quantity": 1,
    "lot": "ETH-LOT-03",
    "fromLocation": "BERGEN",
    "toLocation": "OSLO"
}