Core APIs - Overview

This chapter is about the core APIs in the Wisefish APIs addon in Wisefish.


The contents of the APIs are selected as the most important fields in Wisefish. They should fulfill the needs for most users.






Contents

This module contains:

  • API endpoints needed to work with the main part of the Wisefish system. These are on the base url wisefish/base and allow the user to…

    • read and modify the most general setup of Wisefish

    • read and modify the main master data

    • create agreements (RA, DA, PA) and run the most common procedures on them

    • receive and ship through warehouse documents

    • do some simple inventory methods through journals

  • Change Log feature

    • The user can read the change log in order to monitor which data has been changed, for example master data, and then use the corresponding endpoints to retrieve that data - and mark the change log when data has been read.

  • Field List feature

Endpoint Groups

On page Core APIs - Endpoint Reference there is a detailed list of all the endpoints with a link to a documentation for each of them, but here is a short list of the main data tables included.

Endpoint Group

Contents

Main Endpoints / examples

Setup

Reading the main setup for Wisefish. Stock Centers and Lot Groups can be updated.

  1. User Profiles

  2. Locations and stock centers

  3. Inventory setup tables: Item categories, lot groups, raw material size groups etc.

  4. Fishing setup tables: Areas, harbors, equipment and landing types

Master data

Reading and modifying master data. All masterdata records can be updated.

for example

  1. Customers

  2. Vendors

  3. Vessels

  4. Items

Inventory

Reading inventory status and doing some general methods, like adjusting inventory and transferring stock between locations.

To get the list of inventory, either per item or trade item.

Lots can be updated.

Pallets can be created, and then ready to get trade items via inventory posting.

Example of endpoints:

  1. Inventory

  2. Lots

  3. Trade Items

  4. Pallets

Trading

Working with buying and selling, i.e. reading and inserting new agreements. Procedures for the most general actions, such as releasing, creating a posting document and posting the inventory change. For the logistics related to sales, there are endpoints for Scheduled Trips and Transport Units as well as for the most important actions.

  1. Purchase Agreements

  2. Sales Agreements

  3. Scheduled Trips

  4. Transport Units

Production

Production Lots can be created.

  1. Production Lots

  2. Production Agreements

Warehouse (standard documents)

For working with the standard warehouse since these are not available in standard Business Central APIs. These documents cannot be modified, but the API is to post the received or shipped items.

  1. Warehouse Receipts (for POs)

  2. Warehouse Shipments (for SOs)

Fishing

These endpoints are only available if the Fishing module is installed.

  1. Fishing Trips

  2. Product Lines




Installation

Wisefish API

By installing this app, this becomes available:

  • most of the data endpoints

  • the change log

  • endpoint overview within BC

Fishing & Quota

By installing this, the endpoints in group “Fishing” are added. They have the same base url: wisefish/base


Usage

Record ID

When interacting with specific records (e.g., a particular customer, item, or sales order), the record's unique ID is included in the URL to identify it.
For example, to retrieve a specific purchase agreement, the URL would include the agreement's ID:

<https://{businesscentralPrefix}/api/wisefish/base/v1.0/companies({companyId})/purchaseAgreements({agreementId})>

Where {agreementId} is the GUID of the agreement entry.
Similarly, for operations like deleting or updating a record, the record's ID is essential in the URL to target the correct entry.

In some cases, for better usability, the primary key of the entry could be used as a record ID, but not the GUID. The documentation mentions which field is used as a record ID.

Validating Data

When updating data, the API properties act in a very similar way as the fields on the pages within BC/Wisefish. The error handling that takes place when a user validates a field in Wisefish, is exactly the same as when the same field is populated with the API. The field order of the API will control the order of which fields are validated into the table. Changing the order of the payload (body object) will not have affect on how the fields are validated into the record.

Procedure Endpoints

There are also some specific procedure endpoints that modify data. They can have additional error handling and therefore return a runtime error (400) so that no entry is created in the database. Therefore these methods can safely be used when there is a human being watching the response.

Using these API procedures is not recommended for integration with production systems. In that case, it is usually better to use the MES inbound integration queue.

See: MES INTEGRATION
See older version of MES: External Production API - Endpoint Reference


Change Log - TODO


Field List - TODO