Overview
The is an API to create a consumption 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 (with the
transactionLinesendpoint) and a new one created instead, unless it has already been processed, then it is not possible to delete it. -
When a Consumption Transaction is processed by the MES processor, the trade items are consumed.
-> See more information about the workflow: MES Use Case: Production
|
Endpoint name |
|
|
Source table |
|
|
Fixed view/defaults |
This endpoint will only create/show transactions with Type = Consumption. |
|
Requests allowed |
|
|
Primary key |
The primary key of a transaction line is |
|
Record ID |
The record ID is |
|
Procedures |
None |
Data
Field List
|
Property |
Type |
Format |
Description |
|
|
|---|---|---|---|---|---|
|
1 |
|
string |
uuid |
The automatic system ID, which is in GUID format. |
record id non-editable |
|
2 |
|
integer |
|
The Transaction this line belongs to.
|
PRIMARY KEY OPTIONAL |
|
3 |
|
integer |
|
The sequence number of this line, within the transaction which has ID = This is set automatically as next number.. |
PRIMARY KEY non-editable |
|
4 |
|
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 |
|
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 |
|
string |
max 10 |
The production lot to post this consumption on. |
Mandatory |
|
7 |
|
string |
date |
Date of the consumption. |
Mandatory |
|
8 |
|
string |
max 20 |
Item No. of the consumed item. |
Mandatory |
|
9 |
|
decimal |
|
|
Mandatory * |
|
10 |
|
string |
max 10 |
The unit of measure that belongs to the This can be skipped if the Terminal is marked with Populate Unit Automatically. In that case, the unit for standard item will be set as the Base Unit of Measure but for trade items the Trade Item Unit of Measure. |
Mandatory * |
|
11 |
|
decimal |
|
Weight, if used, it is the weight in the base weight unit of Wisefish. |
OPTIONAL |
|
12 |
|
string |
max 20 |
A relation to the consumed Trade Item can be given with |
OPTIONAL |
|
13 |
|
number |
|
A relation to the consumed Trade Item can be given with |
OPTIONAL |
|
14 |
|
string |
max 20 |
The lot of the consumed item. |
Mandatory |
|
15 |
|
string |
max 22 |
A relation to the consumed Trade Item can be given with it’s barcode. |
OPTIONAL |
|
16 |
|
string |
date-time |
Timestamp. |
non-editable |
Example Object
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 Consumption
-
Activity Date will be the value of property
productionDateor if not given, it will be set as today -
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 an consumption 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:
POST
.../mesConsumption
{
"terminal": "INNOVA",
"externalReference": "27-apr-c2",
"productionDate": "2026-04-27",
"itemNo": "100",
"lot": "COD-01",
"quantity": 150,
"unitOfMeasure": "kg",
"consumedLot": "OR-35456"
}
The response will show all the properties of the endpoint. See object above.
-
The primary key of the created transaction can be seen in property
transactionId -
The primary key of the transaction line is in 2 properties:
transactionIdandlineNo -
lineNohas value 1, which means that this is the first item line for this transaction.
Add trade item to an existing consumption transaction
As for other endpoints, Posting again, with the transactionId just created, will add a new line on the same transaction. See examples on API - MES Output
Create a bulk transaction of multiple consumed items for the same lot production
Even if it is a consumption, the Transactions endpoint can be used to create a bulk transaction:
POST
.../transactions?$expand=transactionLines
{
"terminal": "PACKING",
"externalReference": "27-4-B-C1",
"type": "Consumption",
"lot": "15-04-01",
"transactionLines": [
{
"itemNo": "100",
"quantity": 10,
"unitOfMeasure": "KG",
"consumedLot": "LOT-03-01"
},
{
"itemNo": "70064",
"quantity": 9,
"unitOfMeasure": "KG",
"consumedLot": "CREDIT-TEST5"
}
]
}
=> A transaction with 2 line will be created