API - Origin Lots


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

originLots

Source table

WiFi Lot

Fixed view

A lot list, but showing only origin lots, which is done by filtering on Production Type = blank.

Requests allowed

GET

Primary Key

code

Record ID

code

Child objects

certifications (array of lotCertification), can be added with $expand=certifications. See Lot Certification under Data.

Procedures

Additionally POST requests can be done on procedure endpoints.

  • AddNote

  • AddNoteToUser

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

systemId

string

uuid

The system id of the record.

non-editable

code

string

max 20

Code (the lot number)

Record ID

primary key

description

string

max 50

Description


landingDate

string

date

Landing date of the raw material. It is stored in the lot field Creation Date.


vesselCode

string

max 20

Vessel Code (for origin lots of caught fish)


fishingAreaCode

string

max 10

Fishing Area Code (for origin lots of caught fish)


fishingTripNo

string

max 20

Fishing Trip No. (for origin lots of caught fish)


externalProducer

string

max 20

External Producer (the field caption in Wisefish is External Stock Center)


originType

string

enum

Origin Type. Options: Wild, Farm Raised


inboundDocType

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


inboundDocNo

string

max 20

Number of the inbound document that created the lot (Inbound Doc. No. (Creation))


inboundDocLineNo

integer


Line number of the inbound document line that created the lot (Inb. Doc. Line No. (Creation))


stage

string

max 20

Processing Stage


stockCenterCode

string

max 20

Stock Center Code


certificationProcess

string

enum

Certification Process. Options: No, Yes


certification

string

max 20

Certification status of the lot, calculated from the lot's certification programs (e.g. "Certified" or "Decertified").


certifications

array

json

Array of object lotCertification. Can be added as a child array with ?$expand=certifications


systemRowVersion

integer


System row version. Increments every time the record is modified.

non-editable

lastModified

string

date-time

SystemModifiedAt (date and time of last change)

non-editable

modifiedByUser

string


The user who last modified the record

non-editable


Object Example

JSON
{
    "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

systemId

string

uuid

The system id of the record.

Record ID

non-editable

lot

string

max 20

Lot Code


entryId

number

integer

ID

primary key

cpCode

string

max 10

Certification Program Code


certificationType

string

enum

Certification Type. Options: blank, Certified, Decertified


description

string

max 50

Description


type

string

enum

Type. Options: blank, MSC, IRF, ASC, AQIS


systemRowVersion

integer


System row version. Increments every time the record is modified.

non-editable

lastModified

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

AddNote

noteText (text, max 250)

Add a note to the origin lot. The note is registered as from the API user.

Show more

AddNoteToUser

noteText (text, max 250), fromUser (code, max 50)

Add a note to the origin lot, registered as from the given Business Central user. The user must exist in User Setup.

Show more


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

JSON
POST
.../originLots([record-id])/Microsoft.NAV.AddNote

Body:
{
    "noteText": [the text of the note]
}

Parameters

Type

Max Len

Description


noteText

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.

  • noteText is longer than 250 characters (standard Business Central error, the text exceeds the parameter length).

Behaviour notes:

  • The note text is not validated: an empty noteText is 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.

JSON
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


noteText

string

250

The text of the note.

mandatory

fromUser

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 (when fromUser is not found in User Setup)

Behaviour notes:

  • fromUser is a code parameter, so the value is converted to upper case: "john" is registered and returned as JOHN.

  • If fromUser is empty, no user check is made and the note is registered as from the API user (same as AddNote), 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 noteText is 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.

JSON
GET .../originLots

Read one origin lot

The record id is the lot number itself:

JSON
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:

JSON
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:

JSON
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:

JSON
GET .../originLots('L-24117')?$expand=certifications

Response:

JSON
{
    "@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:

JSON
POST .../originLots('L-24117')/Microsoft.NAV.AddNote
{
    "noteText": "Temperature checked at receipt"
}

Response:

JSON
{
    "@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:

JSON
POST .../originLots('L-24117')/Microsoft.NAV.AddNoteToUser
{
    "noteText": "Temperature checked at receipt",
    "fromUser": "JOHN"
}

Response:

JSON
{
    "@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:

JSON
POST .../originLots('L-24117')/Microsoft.NAV.AddNoteToUser
{
    "noteText": "Temperature checked at receipt",
    "fromUser": "NOBODY"
}

Response:

JSON
{
    "error": {
        "code": "Application_DialogException",
        "message": "User with ID NOBODY does not exist"
    }
}