Overview
This API is for the lot table but with a fixed filter on Origin Lots, i.e. lots where Production Type is blank. Origin lots are used for stock that comes into the system, for example with a landing, a purchase or a receipt agreement.
Besides the general lot fields, the endpoint shows the origin information of the lot: landing date, vessel, fishing area, fishing trip, external producer and origin type, and the inbound document (type, number and line) that created the lot.
The endpoint is read-only. Notes can be added to an origin lot with the procedures AddNote and AddNoteToUser.
|
Endpoint name |
|
|
Source table |
|
|
Fixed view |
A lot list, but showing only origin lots, which is done by filtering on Production Type = blank. |
|
Requests allowed |
GET |
|
Primary Key |
|
|
Record ID |
|
|
Child objects |
|
|
Procedures |
Additionally POST requests can be done on procedure endpoints.
|
Origin lots are not created or changed through this endpoint. To create or change lots use the lots endpoint, see API - Lots. Production lots are read with API - Production Lots.
Data
Field List
|
Property |
Type |
Format |
Description |
|
|
|
string |
uuid |
The system id of the record. |
non-editable |
|
|
string |
max 20 |
Code (the lot number) |
Record ID primary key |
|
|
string |
max 50 |
Description |
|
|
|
string |
date |
Landing date of the raw material. It is stored in the lot field Creation Date. |
|
|
|
string |
max 20 |
Vessel Code (for origin lots of caught fish) |
|
|
|
string |
max 10 |
Fishing Area Code (for origin lots of caught fish) |
|
|
|
string |
max 20 |
Fishing Trip No. (for origin lots of caught fish) |
|
|
|
string |
max 20 |
External Producer (the field caption in Wisefish is External Stock Center) |
|
|
|
string |
enum |
Origin Type. Options: Wild, Farm Raised |
|
|
|
string |
enum |
Type of the inbound document that created the lot (Inbound Doc. Type (Creation)). Options: blank, FT Raw Material, FT Product, Purchase Document, Sales Document, Receipt Agreement, Storage Receipt Agreement |
|
|
|
string |
max 20 |
Number of the inbound document that created the lot (Inbound Doc. No. (Creation)) |
|
|
|
integer |
|
Line number of the inbound document line that created the lot (Inb. Doc. Line No. (Creation)) |
|
|
|
string |
max 20 |
Processing Stage |
|
|
|
string |
max 20 |
Stock Center Code |
|
|
|
string |
enum |
Certification Process. Options: No, Yes |
|
|
|
string |
max 20 |
Certification status of the lot, calculated from the lot's certification programs (e.g. "Certified" or "Decertified"). |
|
|
|
array |
json |
Array of object |
|
|
|
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 |
|
|
string |
|
The user who last modified the record |
non-editable |
Object Example
{
"systemId": "8c2d41a7-5be1-f011-b02a-8bca792786d1",
"code": "L-24117",
"description": "Þorskur - Sólbakur 3. sept",
"landingDate": "2026-09-03",
"vesselCode": "SOLBAKUR",
"fishingAreaCode": "VEST",
"fishingTripNo": "FT-2026-0412",
"externalProducer": "",
"originType": "Wild",
"inboundDocType": "Receipt Agreement",
"inboundDocNo": "MOT-001284",
"inboundDocLineNo": 10000,
"stage": "HRAEFNI",
"stockCenterCode": "FROSTI",
"certificationProcess": "Yes",
"certification": "Certified",
"systemRowVersion": 2604417,
"lastModified": "2026-09-03T14:12:08.317Z",
"modifiedByUser": "JOHN"
}
Lot Certification
The child object lotCertification (array certifications) lists the certification programs registered on the lot. It is read with $expand=certifications.
|
Property |
Type |
Format |
Description |
|
|
|
string |
uuid |
The system id of the record. |
Record ID non-editable |
|
|
string |
max 20 |
Lot Code |
|
|
|
number |
integer |
ID |
primary key |
|
|
string |
max 10 |
Certification Program Code |
|
|
|
string |
enum |
Certification Type. Options: blank, Certified, Decertified |
|
|
|
string |
max 50 |
Description |
|
|
|
string |
enum |
Type. Options: blank, MSC, IRF, ASC, AQIS |
|
|
|
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 |
Procedures
Procedures are called on a specific origin lot: POST originLots('<code>')/Microsoft.NAV.<procedureName> with a JSON body of parameters. Each procedure returns a text message in the value property of the response on success. On failure it returns an error with a readable message.
Parameter names are case-sensitive, and the procedure names start with a capital letter (AddNote, AddNoteToUser).
|
Procedure |
Parameters |
Description |
Details |
|---|---|---|---|
|
|
|
Add a note to the origin lot. The note is registered as from the API user. |
|
|
|
|
Add a note to the origin lot, registered as from the given Business Central user. The user must exist in User Setup. |
Notes
Add Note
The procedure AddNote adds a note to the origin lot. The note is a Business Central Note record link with the description “Sent through API”, and it is registered as from the API user (the user making the call).
POST
.../originLots([record-id])/Microsoft.NAV.AddNote
Body:
{
"noteText": [the text of the note]
}
|
Parameters |
Type |
Max Len |
Description |
|
|---|---|---|---|---|
|
|
string |
250 |
The text of the note. |
mandatory |
A note is added to the origin lot, and the value property of the response is Note successfully added.
Possible errors:
-
The origin lot does not exist (standard Business Central error, record not found). This includes a lot that exists but is a production lot, since it is outside the fixed view.
-
noteTextis longer than 250 characters (standard Business Central error, the text exceeds the parameter length).
Behaviour notes:
-
The note text is not validated: an empty
noteTextis not rejected, an empty note is added. -
The note is a Note type record link with the description “Sent through API”, created with the current date and time.
Notes can be read with the Record Notes API, see API - Record Notes in this space.
Add Note To User
The procedure AddNoteToUser works the same way as AddNote, but the note is registered as from the given Business Central user (fromUser) instead of the API user.
On this endpoint the procedure is named AddNoteToUser. On some other endpoints (for example lots and items) the same procedure is named AddNoteFromUser. Use the name exactly as shown here.
POST
.../originLots([record-id])/Microsoft.NAV.AddNoteToUser
Body:
{
"noteText": [the text of the note],
"fromUser": [the BC user ID the note is registered from]
}
|
Parameters |
Type |
Max Len |
Description |
|
|---|---|---|---|---|
|
|
string |
250 |
The text of the note. |
mandatory |
|
|
string |
50 |
The BC user ID the note is registered from. The user must exist in User Setup, otherwise the call fails with the error “User with ID X does not exist”. |
mandatory |
A note is added to the origin lot, and the value property of the response is Note successfully added and registered from user <fromUser>.
Possible errors:
-
The origin lot does not exist (standard Business Central error, record not found).
-
A parameter is longer than its maximum length (standard Business Central error, the text exceeds the parameter length).
-
User with ID <fromUser> does not exist(whenfromUseris not found in User Setup)
Behaviour notes:
-
fromUseris a code parameter, so the value is converted to upper case:"john"is registered and returned asJOHN. -
If
fromUseris empty, no user check is made and the note is registered as from the API user (same asAddNote), but the response text then ends with an empty user ID:Note successfully added and registered from user. -
The note text is not validated: an empty
noteTextis not rejected.
Examples
The URLs below are relative to .../api/wisefish/base/v1.0/companies([company-id])/.
Read origin lots
Read all origin lots
Reads all origin lots (lots where Production Type is blank). The response is a list of objects, as shown in Object Example.
GET .../originLots
Read one origin lot
The record id is the lot number itself:
GET .../originLots('L-24117')
Read origin lots from a vessel
Reads the lot number, landing date and fishing trip of all origin lots from vessel SOLBAKUR landed in September 2026, using $filter and $select:
GET .../originLots?$filter=vesselCode eq 'SOLBAKUR' and landingDate ge 2026-09-01 and landingDate le 2026-09-30&$select=code,landingDate,fishingTripNo
Read origin lots created by an inbound document
Finds the origin lots created by receipt agreement MOT-001284:
GET .../originLots?$filter=inboundDocType eq 'Receipt Agreement' and inboundDocNo eq 'MOT-001284'
Read an origin lot with its certifications
Adds the certification programs of the lot to the response as the array certifications:
GET .../originLots('L-24117')?$expand=certifications
Response:
{
"@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#companies(cf9f7b85-dd11-ef11-9f8b-6045bde9cc61)/originLots(certifications())/$entity",
"@odata.etag": "W/\"JzE5OzEyMzQ1Njc4OTAxMjM0NTY3ODkwOzAwOyc=\"",
"systemId": "8c2d41a7-5be1-f011-b02a-8bca792786d1",
"code": "L-24117",
"description": "Þorskur - Sólbakur 3. sept",
"landingDate": "2026-09-03",
"vesselCode": "SOLBAKUR",
"fishingAreaCode": "VEST",
"fishingTripNo": "FT-2026-0412",
"externalProducer": "",
"originType": "Wild",
"inboundDocType": "Receipt Agreement",
"inboundDocNo": "MOT-001284",
"inboundDocLineNo": 10000,
"stage": "HRAEFNI",
"stockCenterCode": "FROSTI",
"certificationProcess": "Yes",
"certification": "Certified",
"systemRowVersion": 2604417,
"lastModified": "2026-09-03T14:12:08.317Z",
"modifiedByUser": "JOHN",
"certifications": [
{
"@odata.etag": "W/\"JzE4OzU1NTY2Nzc4ODk5MDAxMTIyMzswMDsn\"",
"systemId": "5e7f0a12-5be1-f011-b02a-8bca792786d1",
"lot": "L-24117",
"entryId": 1187,
"cpCode": "MSC",
"certificationType": "Certified",
"description": "MSC certified",
"type": "MSC",
"systemRowVersion": 2604420,
"lastModified": "2026-09-03T14:12:09.004Z"
}
]
}
Add notes
Add a note to an origin lot
Adds the note “Temperature checked at receipt” to origin lot L-24117 with AddNote; the note is registered as from the API user.
Request:
POST .../originLots('L-24117')/Microsoft.NAV.AddNote
{
"noteText": "Temperature checked at receipt"
}
Response:
{
"@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#Edm.String",
"value": "Note successfully added"
}
Add a note to an origin lot from a specific user
Adds the same note to origin lot L-24117 with AddNoteToUser, registered as from user JOHN.
Request:
POST .../originLots('L-24117')/Microsoft.NAV.AddNoteToUser
{
"noteText": "Temperature checked at receipt",
"fromUser": "JOHN"
}
Response:
{
"@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#Edm.String",
"value": "Note successfully added and registered from user JOHN"
}
Add a note to an origin lot from a user that does not exist
Calls AddNoteToUser with a user ID that is not in User Setup; the call fails and no note is added (the error message is shortened).
Request:
POST .../originLots('L-24117')/Microsoft.NAV.AddNoteToUser
{
"noteText": "Temperature checked at receipt",
"fromUser": "NOBODY"
}
Response:
{
"error": {
"code": "Application_DialogException",
"message": "User with ID NOBODY does not exist"
}
}