Overview
This API is for posting output on Production Lots. Lines are created into the Trade Item Output Journal, linked to a specific production Lot. Then a user within BC needs to review the journal and post manually.
If a more automated process for inventory changes is required, use the MES Transactions. See chapter MES - Overview
|
Endpoint name |
|
|
Source table |
|
|
Fixed view |
|
|
Requests allowed |
GET, POST, PATCH, DELETE |
|
Primary key |
"Journal Template Name", "Journal Batch Name", "Line No." |
|
Record ID |
|
|
Child objects |
None |
|
Procedures |
None. In this version, the line is only inserted, then it needs to be posted from within BC. |
Creating lines
To create a new line in the journal, use POST and all necessary values.
When a line is created, the API sets the Entry Type to Output and fills in default values for the journal and the line number:
-
templateName: the first non-recurring Trade Item Journal Template of type Output. -
batchName: the first non-recurring batch of that template. -
lineNo: the last line number in that batch + 100 (100 for an empty batch).
Values given in the request replace these defaults. Note that the default lineNo is calculated for the default batch, so give lineNo as well when another templateName/batchName is given. If no Output journal template or batch exists, the request fails (standard Business Central error, record not found).
Before the line is inserted, the following fields are checked, in this order. If a field is empty (or zero), the line is not inserted and an error is returned:
-
lot(Trade Item Lot Code) -
processingStage(Stage) -
locationCode(Location Code) -
stockCenterCode(Stock Center Code) -
itemNumber(Item No.) -
quantity(Quantity)
The error is the standard Business Central field check (TestField), for example:
Trade Item Lot Code must have a value in Trade Item Journal Line: Journal Template Name=OUTPUT, Journal Batch Name=BOXES, Line No.=30000. It cannot be zero or empty.
The field and table names in the message are captions, so they may appear in the language of the API user.
The fields productionDate and tradeItems are not checked when the line is inserted, but they are needed when the journal is posted.
→ Next step - or any time it suits the user - this journal needs to be posted.
Data
Field List
Some fields marked mandatory may be skipped in the request without getting an error, but when the line is posted, the posting method will return an error. See Creating lines in the Overview for the fields that are checked when a line is inserted.
|
Property |
Type |
Format |
Description |
|
|
|
string |
uuid |
The system id of the record. |
Record ID non-editable |
|
|
string |
max 10 |
Needs to exist in the Trade Item Journal Templates list. If skipped, the default Output template is used (see Creating lines). |
primary key optional |
|
|
string |
max 10 |
Needs to exist in the Trade Item Journal Batches list. If skipped, the default batch is used. |
primary key optional |
|
|
integer |
|
Line number. If skipped, the next line number in the batch is used. |
primary key optional |
|
|
string |
max 20 |
The production lot |
mandatory |
|
|
string |
max 20 |
Processing stage |
mandatory |
|
|
string |
date |
The posting date, if skipped it will get a default value. |
optional |
|
|
string |
date |
The production date, if skipped it will get a default value, but this should rather be given for every request. |
mandatory |
|
|
string |
max 20 |
Stock Center, must match the lot, if the lot has specific stock center. |
mandatory |
|
|
string |
max 10 |
Location Code |
mandatory |
|
|
string |
max 20 |
The item needs to be either a WIP item or a Product item. |
mandatory |
|
|
string |
max 100 |
Description |
optional |
|
|
number |
decimal |
Trade Items |
mandatory |
|
|
string |
max 10 |
The unit for the |
optional |
|
|
number |
decimal |
Quantity |
mandatory |
|
|
string |
max 10 |
The unit for the |
optional |
|
|
string |
max 22 |
If the created trade item is to be barcoded. |
optional |
|
|
string |
max 20 |
This pallet needs to exist. First it can be created with the |
optional |
|
|
string |
enum |
These fields are used to instantly reserve the created trade item to an agreement.
reserveToNo is then the delivery agreement no. reserveToLineNo is the line number on the agreement Options for reserveToType: Delivery, Production, (blank), ShipmentWh (Storage Shipment), BlanketSA (Blanket Sales). |
optional |
|
|
string |
max 20 |
optional |
|
|
|
integer |
|
optional |
|
|
|
integer |
|
System row version. Increments every time the record is modified. |
non-editable |
|
|
string |
date-time |
SystemModifiedAt (date and time of last change) |
non-editable |
Object Example
An example of one object:
{
"systemId": "a1bedbfb-6bf8-f011-b02e-b42d5a9dc7e2",
"templateName": "OUTPUT",
"batchName": "BOXES",
"lineNo": 10000,
"lot": "LANDING-LOT-1",
"processingStage": "LANDED",
"postingDate": "2026-01-22",
"productionDate": "2025-12-09",
"stockCenterCode": "FROSTI",
"locationCode": "BLUE",
"itemNumber": "0900",
"description": "Þorskflök",
"tradeItems": 20,
"tradeItemUnitOfMeasure": "BOX",
"quantity": 200,
"unitOfMeasure": "KG",
"tradeItemBarcode": "",
"palletBarcode": "",
"reserveToType": "Delivery",
"reserveToNo": "",
"reserveToLineNo": 0,
"systemRowVersion": 2611034,
"lastModified": "2026-01-23T14:59:00.827Z"
}
Examples
Read output journal lines
Read all lines
Reads all lines in the output journals. The response is a list of objects, as shown in Object Example.
GET
.../outputJournalLines
Read the lines of a lot
Reads the output lines for lot LANDING-LOT-1, and returns only a few fields with $select.
Request:
GET .../outputJournalLines?$filter=lot eq 'LANDING-LOT-1'&$select=systemId,lineNo,itemNumber,tradeItems,quantity
Response:
{
"@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#companies(cf9f7b85-dd11-ef11-9f8b-6045bde9cc61)/outputJournalLines(systemId,lineNo,itemNumber,tradeItems,quantity)",
"value": [
{
"@odata.etag": "W/\"JzIwOzE0NTY3ODkwMTIzNDU2Nzg5MDEyOzAwOyc=\"",
"systemId": "a1bedbfb-6bf8-f011-b02e-b42d5a9dc7e2",
"lineNo": 10000,
"itemNumber": "0900",
"tradeItems": 20,
"quantity": 200
}
]
}
Read a specific line
Reads one line by its Record ID (systemId).
GET
.../outputJournalLines(a1bedbfb-6bf8-f011-b02e-b42d5a9dc7e2)
Create, change and delete output journal lines
Create an output journal line
Creates an output line of 20 trade items (200 KG) of item 0900 on lot LANDING-LOT-1 in the journal OUTPUT / BOXES.
Example:
POST .../outputJournalLines
{
"templateName": "OUTPUT",
"batchName": "BOXES",
"lineNo": 30000,
"lot": "LANDING-LOT-1",
"processingStage": "LANDED",
"postingDate": "2026-01-20",
"productionDate": "2026-01-18",
"stockCenterCode": "FROSTI",
"locationCode": "BLUE",
"itemNumber": "0900",
"tradeItems": 20,
"quantity": 200
}
Response (example values):
{
"@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#companies(cf9f7b85-dd11-ef11-9f8b-6045bde9cc61)/outputJournalLines/$entity",
"@odata.etag": "W/\"JzIwOzE3NzI2MzU0MTkwODgyNzM2NDUxOzAwOyc=\"",
"systemId": "c4d1e2f3-7af8-f011-b02e-b42d5a9dc7e2",
"templateName": "OUTPUT",
"batchName": "BOXES",
"lineNo": 30000,
"lot": "LANDING-LOT-1",
"processingStage": "LANDED",
"postingDate": "2026-01-20",
"productionDate": "2026-01-18",
"stockCenterCode": "FROSTI",
"locationCode": "BLUE",
"itemNumber": "0900",
"description": "Þorskflök",
"tradeItems": 20,
"tradeItemUnitOfMeasure": "BOX",
"quantity": 200,
"unitOfMeasure": "KG",
"tradeItemBarcode": "",
"palletBarcode": "",
"reserveToType": "Delivery",
"reserveToNo": "",
"reserveToLineNo": 0,
"systemRowVersion": 2611102,
"lastModified": "2026-01-20T10:15:31.207Z"
}
Change an output journal line
Changes the number of trade items and the quantity on the line. A PATCH request needs the If-Match header with the @odata.etag of the record (or *).
Request:
PATCH .../outputJournalLines(c4d1e2f3-7af8-f011-b02e-b42d5a9dc7e2)
If-Match: *
Body:
{
"tradeItems": 25,
"quantity": 250
}
Response (shortened):
{
"@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#companies(cf9f7b85-dd11-ef11-9f8b-6045bde9cc61)/outputJournalLines/$entity",
"@odata.etag": "W/\"JzIwOzE5ODc2NTQzMjEwOTg3NjU0MzIxOzAwOyc=\"",
"systemId": "c4d1e2f3-7af8-f011-b02e-b42d5a9dc7e2",
"lineNo": 30000,
"lot": "LANDING-LOT-1",
"itemNumber": "0900",
"tradeItems": 25,
"quantity": 250,
"systemRowVersion": 2611140,
"lastModified": "2026-01-20T10:21:05.640Z"
}
Delete an output journal line
Deletes the line before it is posted. On success the response is empty (HTTP status 204 No Content).
DELETE .../outputJournalLines(c4d1e2f3-7af8-f011-b02e-b42d5a9dc7e2)
Errors
Create a line without a quantity
Creates a line without quantity; the line is not inserted (the error code and correlation ID are left out of the response).
Request:
POST .../outputJournalLines
Body:
{
"lot": "LANDING-LOT-1",
"processingStage": "LANDED",
"stockCenterCode": "FROSTI",
"locationCode": "BLUE",
"itemNumber": "0900",
"tradeItems": 20
}
Response:
{
"error": {
"message": "Quantity must have a value in Trade Item Journal Line: Journal Template Name=OUTPUT, Journal Batch Name=BOXES, Line No.=30100. It cannot be zero or empty."
}
}