API - Stock Centers


Overview

The list page that contains the Stock Centers of Wisefish. All Trade Items must belong to a stock center at every point of time.

The number series for production lot is on the stock center, therefore it has procedures to create lots, either an origin lot or a production lot.

Endpoint name

stockCenters

Source table

WiFi Stock Center

Fixed view


Requests allowed

GET, POST, PATCH, DELETE

Primary key

Code

Record ID

code

Procedures

createOriginLot

createProductionLot

createPalletBarcode

createPalletWithKeyItem


Data

Field List

Property

Type

Format

Description


code

string

max 10

The unique id of this stock center.

Record ID

primary key

systemId

string

uuid

SystemId

non-editable

name

string


Name

mandatory

address

string

max 50

Address

optional

address2

string

max 50

Address 2

optional

postCode

string

max 20

Post Code

optional

city

string

max 30

City

optional

countryCode

string

max 10

Country Code

optional

contact

string

max 50

Contact Name

optional

eMail

string


Email

optional

gln

string

max 13

Global location number (GLN)

optional

vendorId

string

uuid

Stock centers can be linked to a Vendor. Then this field will show the GUID of the Vendor.

non-editable

vendorCode

string

max 20

The number of a linked Vendor

optional

customerId

string

uuid

Stock centers can be linked to a Customer. Then this field will show the GUID of the Customer.

non-editable

customerCode

string

max 20

The number of a linked Customer

optional

stockCenterType

string

enum

Options:

  • (blank) - this is the default

  • External Producer

  • 3rd Party Producer

optional

itemMixOnPalletAllowed

boolean


Default value is false.

optional

palletBarcodeUsage

string


Options:

  • SSCC (GS1)

  • Not Used

optional

ssccAllocationCode

string

max 20

SSCC Allocation Code

optional

certificationProcess

string

enum

Options:

  • No Certification

  • Single Certification

  • Multiple Certifications

optional

transferCertificateRequired

boolean


Transfer Certificate Required

optional

certificationPrograms

array

json

Certification Programs.

This can be added as a child array with
?$expand=certificationPrograms


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


Object Example

An example of one object:

JSON
{
    "code": "OWN",
    "systemId": "04daea07-a0a1-ef11-b017-aa2d6f3d6955",
    "name": "Our Stock Center",
    "address": "Katrínartún 4",
    "address2": "",
    "postCode": "105",
    "city": "Reykjavik",
    "countryCode": "IS",
    "contact": "",
    "eMail": "",
    "gln": "0000123456784",
    "vendorId": "00000000-0000-0000-0000-000000000000",
    "vendorCode": "",
    "customerId": "00000000-0000-0000-0000-000000000000",
    "customerCode": "",
    "stockCenterType": " ",
    "itemMixOnPalletAllowed": true,
    "palletBarcodeUsage": "SSCC (GS1) Nos.",
    "ssccAllocationCode": "OUR",
    "certificationProcess": "Single Certification",
    "transferCertificateRequired": false,
    "systemRowVersion": 2581230,
    "lastModified": "2025-12-15T11:54:10.823Z"
}


Procedures

Procedures are called on a specific stock center: POST stockCenters('<code>')/Microsoft.NAV.<procedureName> with a JSON body of parameters. Each procedure returns the code of the record it created (a lot code or a pallet barcode) in the value property of the response, no other text. On failure it returns an error with a readable message.

Procedure

Parameters

Description

Details

createOriginLot

description (text, max 50), lotGroup (code, max 20)

Create an origin lot on this stock center and return the new lot code.

Show more

createProductionLot

startingDate (date), description (text, max 50), lotGroup (code, max 20)

Create a production lot on this stock center, active in production from the starting date, and return the new lot code.

Show more

createPalletBarcode

location (code, max 10), fishingTripNo (code, max 20)

Create a new empty pallet on this stock center with a barcode generated according to the stock center settings, and return the barcode.

Show more

createPalletWithKeyItem

location (code, max 10), fishingTripNo (code, max 20), itemNo (code, max 20)

Same as createPalletBarcode, but the pallet gets a key item from the start.

Show more


Lots

Create Origin Lot

Usually origin lots are created automatically by the system when received items are posted, but they could also be made beforehand.

JSON
POST
.../stockCenters([record-id])/Microsoft.NAV.createOriginLot

Body:
{
    "description" : [some description],
    "lotGroup" : [a code for Lot Group that exists]
}

Parameters

Type

Max Len

Description


description

string

50

The description to put on the lot.
If skipped, it will be set as “Origin lot”

optional

lotGroup

string

20

If the lot is to be put into a Lot Group.
Only the first 10 characters are used. If skipped, the Lot Group may be derived from the User Profile.

optional

An entry in the table Lot is created, and the number is shown in the value property of the response.

Possible errors:

  • An error from assigning the new lot code from the number series when the lot is inserted (standard Business Central error, e.g. if the number series is missing or exhausted).

  • An error from validating the description on the lot.

  • The Lot Group given in lotGroup does not exist or is not valid (standard Business Central validation error on the Group field of the lot).

  • An error from validating the Stock Center Code on the lot.

  • A parameter value longer than its maximum length is rejected by Business Central (standard error).

Note: The lot gets this stock center as its Stock Center Code (replacing any value from the User Profile), a blank Production Type, a blank Default Hold Status and today as Creation Date. There are no custom error messages in this procedure; all errors come from Business Central / Wisefish validation.


Create Production Lot

Creates a lot that is active in production, starting on the given date.

JSON
POST
.../stockCenters([record-id])/Microsoft.NAV.createProductionLot

Body:
{
    "description" : [some description],
    "lotGroup" : [a code for a Lot Group that exists],
    "startingDate": [a date]
}

Parameters

Type

Max Len

Description


description

string

50

The description to put on the lot.
If skipped, it will be set as “Production lot”

optional

lotGroup

string

20

If the lot is to be put into a Lot Group.
Only the first 10 characters are used. If skipped, the Lot Group may be derived from the User Profile.

optional

startingDate

date


The starting date of the lot.

mandatory

An entry in the table Lot is created, and the number is shown in the value property of the response.

Possible errors:

  • An error from assigning the new lot code from the number series when the lot is inserted (standard Business Central error, e.g. if the number series is missing or exhausted).

  • An error from validating the description on the lot.

  • The Lot Group given in lotGroup does not exist or is not valid (standard Business Central validation error on the Group field of the lot).

  • An error from validating the Stock Center Code on the lot.

  • An error from validating Production Type, Active in Production or Starting Date on the lot (standard Business Central / Wisefish validation error).

  • A parameter value longer than its maximum length is rejected by Business Central (standard error).

Note: The lot gets this stock center as its Stock Center Code, Production Type Production, Active in Production set to true, the given Starting Date, a blank Default Hold Status and NAV Inv. Production Posting Lot. There are no custom error messages in this procedure; all errors come from Business Central / Wisefish validation.


Pallets

Create Pallet Barcode

This method is used to create a new entry in the Pallet table, where the barcode is generated according to the settings on the Stock Center.

The procedure is named createPalletBarcode (not createPallet, which is the name of a separate API endpoint, createPallets).

JSON
POST
.../stockCenters([record-id])/Microsoft.NAV.createPalletBarcode

Body:
{
    "location": "BLUE",
    "fishingTripNo" : [if the pallet should be connected to a fishing trip]
}

Parameters

Type

Max Len

Description


location

string

10

If left blank, the Location Code will be taken from the User Profile

optional

fishingTripNo

string

20

Fishing Trip No. to connect the pallet to

optional

A barcode will be generated and an entry in the Pallet list is created. The response is the new pallet barcode in the value property, e.g. 00050000000000001101.

  • The pallet gets the current Stock Center Code.

  • Location Code must be populated, either with the parameter, or taken from the User Profile of the current user

  • Key Item No. on this pallet is blank, but will be populated when trade items are posted on the pallet.

  • Date Created is set as the date today

  • Status of the pallet is Empty

Possible errors:

  • No User Setup exists for the current user (standard Business Central error, record not found).

  • The WiFi User Profile Code on the User Setup of the current user is blank (standard Business Central TestField error).

  • The User Profile does not exist (standard Business Central error, record not found).

  • Only when location is blank: the Location Code on the User Profile is blank (standard Business Central TestField error).

  • Pallet Barcode Usage on the stock center is not SSCC (GS1) (standard Business Central TestField error).

  • SSCC Allocation Code on the stock center is blank (standard Business Central TestField error).

  • The GS1 SSCC Allocation does not exist (standard Business Central error, record not found).

  • SSCC Circle on the GS1 SSCC Allocation is blank (standard Business Central TestField error).

  • An error from inserting the pallet, e.g. if a pallet with the generated barcode already exists (standard Business Central error).

  • A parameter value longer than its maximum length is rejected by Business Central (standard error).

Note: The barcode is always generated (it cannot be given as a parameter). The Pallet No. is derived from the barcode, and the Physical Pallet ID is set as 99 followed by characters 3-20 of the barcode. The fishing trip no., location code and item no. are not validated by this procedure.


Create Pallet With Key Item

Creates a new pallet in the same way as createPalletBarcode, and sets the given item as the key item of the pallet.

JSON
POST
.../stockCenters([record-id])/Microsoft.NAV.createPalletWithKeyItem

Body:
{
    "location": "BLUE",
    "fishingTripNo" : [if the pallet should be connected to a fishing trip],
    "itemNo" : [the item no. of the key item]
}

Parameters

Type

Max Len

Description


location

string

10

If left blank, the Location Code will be taken from the User Profile

optional

fishingTripNo

string

20

Fishing Trip No. to connect the pallet to

optional

itemNo

string

20

The item no. to set as Key Item No. of the pallet

mandatory

A barcode will be generated and an entry in the Pallet list is created. The response is the new pallet barcode in the value property.

The pallet gets the same values as with createPalletBarcode, except that Key Item No. is set to itemNo.

Possible errors: the same as for createPalletBarcode (see Create Pallet Barcode).


Examples

Read stock centers

Read all entries

Reads all stock centers. The response is a list of stock center objects, as shown in Object Example.

JSON
GET
.../stockCenters

Read a specific entry

Reads one stock center by its Record ID (code).

JSON
GET
.../stockCenters('OWN')

Read stock centers of a given type

For example, to read all stock centers that are external producers:

JSON
GET .../stockCenters?$filter=stockCenterType eq 'External Producer'

Read a stock center with its certification programs

Reads stock center OWN with its certification programs as a child array.

JSON
GET .../stockCenters('OWN')?$expand=certificationPrograms

Create lots

Create an origin lot on a stock center

Creates an origin lot on stock center OWN in Lot Group WEEK-1 using createOriginLot.

JSON
POST .../stockCenters('OWN')/Microsoft.NAV.createOriginLot
{
    "description" : "Received items",
    "lotGroup" : "WEEK-1"
}

Response:
{
    "@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#Edm.String",
    "value": "LOT0206"
}

Create an origin lot with default values

Creates an origin lot on stock center OWN without parameters; the description is set to “Origin lot”.

Request:

JSON
POST
.../stockCenters('OWN')/Microsoft.NAV.createOriginLot

Body:
{
}

Response:

JSON
{
    "@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#Edm.String",
    "value": "LOT0208"
}

Create a production lot on a stock center

Creates a production lot on stock center OWN starting 2 December 2025 using createProductionLot.

JSON
POST .../stockCenters('OWN')/Microsoft.NAV.createProductionLot
{
    "startingDate": "2025-12-02",
    "description": "Production 2nd Dec - 2",
    "lotGroup": "Arna"
}

Response:
{
    "@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#Edm.String",
    "value": "LOT0207"
}

Create pallets

Create a pallet with a generated barcode

Creates an empty pallet on stock center OWN at location BLUE using createPalletBarcode.

Request:

JSON
POST
.../stockCenters('OWN')/Microsoft.NAV.createPalletBarcode

Body:
{
    "location": "BLUE"
}

Response:

JSON
{
    "@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#Edm.String",
    "value": "00050000000000001101"
}

Create a pallet connected to a fishing trip

Creates a pallet on stock center OWN connected to fishing trip FT-0012; the location is taken from the User Profile.

Request:

JSON
POST
.../stockCenters('OWN')/Microsoft.NAV.createPalletBarcode

Body:
{
    "fishingTripNo": "FT-0012"
}

Response:

JSON
{
    "@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#Edm.String",
    "value": "00050000000000001118"
}

Create a pallet with a key item

Creates a pallet on stock center OWN at location BLUE with key item 1000 using createPalletWithKeyItem.

Request:

JSON
POST
.../stockCenters('OWN')/Microsoft.NAV.createPalletWithKeyItem

Body:
{
    "location": "BLUE",
    "itemNo": "1000"
}

Response:

JSON
{
    "@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#Edm.String",
    "value": "00050000000000001125"
}