Overview
The table behind this API page is the one that contains the sales agreements in Wisefish, often called “Sales Orders” but are not the same as the Sales Orders in standard Business Centra. The sales agreements are mainly used as Delivery Agreements. The endpoint also contains Blanket Sales Agreements.
There are 3 endpoints with same properties, but a different fixed filter on Status and can give access to different procedures:
-
Endpoint
salesAgreementsshows both open and posted agreements. -
Agreements which are open for changes, because the posting document has not been created:
openSalesAgreements -
Closed agreements. these are non-editable, because the posting document has been created:
closedSalesAgreements
|
Endpoint names |
|
|
Source table |
|
|
Fixed view |
Only shows unposted sales, i.e. where invoice has not been posted. |
|
Requests allowed |
GET, POST, PATCH, DELETE - for GET for |
|
Primary key |
|
|
Record ID |
|
|
Child entry endpoint(s) |
|
|
Procedures |
|
Procedures
-
Only the open sales agreements can be changed, so if trying to run some procedures on closed agreements an error will be returned which is correct.
-
The record Id of the entry must be known in order to use procedures
-
The URL will be:
[server]/api/wisefish/wiFiEP/v1.0/companies([CompanyGUID])/openSalesAgreements([record-id])/Microsoft.NAV.[procedureName]
In general, if the request is successful, the response is 200 OK and could also possibly contain something in the value property:
{
"@odata.context": "https://api.businesscentral.dynamics.com/v2.0/b33a6a3b-244c-4295-84b3-0ad90823c736/AB_Test_191125/api/wisefish/base/v1.0/$metadata#Edm.String",
"value": "Success"
}
Data
Field List
|
1 |
Property |
Type |
Format |
Description |
|
|
2 |
|
string |
uuid |
The record ID must be used when reading only one entry or when using procedures on the endpoint. |
RECORD ID |
|
3 |
|
string |
|
Options are: Blanket, Delivery Delivery is the default value when the property is skipped. See Wisefish documentation to understand the difference. |
Primary key |
|
4 |
|
string |
max 20 |
The unique id within each This is the most commonly used reference for a sales document. It often starts with a “DA” to relate to a “Delivery Agreement”. |
Primary key |
|
5 |
|
string |
date |
Order date, will be set by default but can be changed. |
optional |
|
6 |
|
string |
max 20 |
The salesperson code. |
optional |
|
7 |
|
string |
max 35 |
Use to make a reference to external documents, such as the customer order. |
optional |
|
8 |
|
string |
enum |
Options are: Open and Released. Released documents are mostly un-editable. A procedure must be used to release a document. |
non-editable |
|
9 |
|
string |
max 20 |
The number of the customer, this field has table relation to the Customer table. |
Mandatory |
|
10 |
|
string |
max 100 |
Customer info, default value from the Customer |
optional |
|
11 |
|
string |
max 100 |
Customer info, default value from the Customer |
optional |
|
12 |
|
string |
max 20 |
Customer info, default value from the Customer |
optional |
|
13 |
|
string |
max 30 |
Customer info, default value from the Customer |
optional |
|
14 |
|
string |
max 10 |
Customer info, default value from the Customer |
optional |
|
15 |
|
string |
max 100 |
Customer info, default value from the Customer |
optional |
|
16 |
|
string |
max 35 |
Field used for some info that is relevant for the customer. |
optional |
|
17 |
|
string |
max 10 |
The language code of the customer. This can in some cases affect the language of printed documents. |
optional |
|
18 |
|
string |
max 10 |
From which Location the items will be taken. |
optional |
|
19 |
|
string |
max 20 |
From which Stock Center the items will be taken. |
optional |
|
20 |
|
string |
max 10 |
Shipping info |
optional |
|
21 |
|
string |
max 10 |
Shipping info |
optional |
|
22 |
|
string |
date |
Shipping info |
optional |
|
23 |
|
string |
date |
Shipping info |
optional |
|
24 |
|
string |
max 10 |
Shipping info - linked to table |
optional |
|
25 |
|
string |
max 10 |
Shipping info - linked to table |
optional |
|
26 |
|
string |
max 10 |
Shipping info - linked to table |
optional |
|
27 |
|
string |
max 10 |
Shipping info - linked to table |
optional |
|
28 |
|
string |
max 10 |
Shipping info - field “Shipping Agent Code” |
optional |
|
29 |
|
string |
max 10 |
Shipping info - field “Shipping Agent Service Code” |
optional |
|
30 |
|
string |
max 10 |
Shipping info |
optional |
|
31 |
|
string |
max 20 |
The Scheduled Trip to use for this sales. Related to table “Scheduled Trip”. |
optional |
|
32 |
|
integer |
|
If only a specific transport has been designated for this sales. Related to table “Transport Unit” |
optional |
|
33 |
|
integer |
|
Shows the number of transport units linked to the Scheduled Trip |
non-editable |
|
34 |
|
string |
max 10 |
If the customer has multiple addresses, an address can be selected from that list and this field will contain the Code of that address entry in the Ship-to Address list. |
optional |
|
35 |
|
string |
max 100 |
Ship-to information |
optional |
|
36 |
|
string |
max 50 |
Ship-to information |
optional |
|
37 |
|
string |
max 100 |
Ship-to information |
optional |
|
38 |
|
string |
max 50 |
Ship-to information |
optional |
|
39 |
|
string |
max 20 |
Ship-to information |
optional |
|
40 |
|
string |
max 30 |
Ship-to information |
optional |
|
41 |
|
string |
|
Ship-to information |
optional |
|
42 |
|
string |
max 10 |
Ship-to information |
optional |
|
43 |
|
string |
max 100 |
Ship-to information |
optional |
|
44 |
|
number |
|
The total amount of the order |
non-editable |
|
45 |
|
string |
max 10 |
Currency for the total amount |
non-editable |
|
46 |
|
string |
date |
On which posting date it will be posted. |
optional |
|
47 |
|
string |
max 20 |
If should be billed to another customer, i.e. can be different from the sellToCustomerNo. |
optional |
|
48 |
|
string |
max 10 |
Country or region. |
optional |
|
49 |
|
string |
2max 0 |
Payment bank account, this can be set as mandatory with a setting. |
optional |
|
50 |
|
integer |
|
No. of lines on this agreement. This will be the number of child entries in |
non-editable |
|
51 |
|
number |
|
Total number of trade items to be sold. |
non-editable |
|
52 |
|
number |
|
Total number of trade items already reserved. |
non-editable |
|
53 |
|
number |
|
Total number of trade items already shipped. |
non-editable |
|
54 |
|
integer |
|
Total number of pallets reserved. Trade items do not necessarily belong to a pallet. |
non-editable |
|
55 |
|
string |
date-time |
Automatic time stamp of last modification. |
non-editable |
Example Object
{
"systemId": "db17585a-4eab-f011-b028-e5231dc67468",
"documentType": "Delivery",
"documentNo": "DS-034",
"orderDate": "2026-01-22",
"externalDocumentNo": "",
"status": "Open",
"sellToCustomerNo": "01905899",
"sellToCustomerName": "Elkhorn Airport",
"sellToAddress": "105 Buffalo Dr.",
"sellToPostCode": "CA-MB R0M 0N0",
"sellToCity": "Elkhorn",
"sellToCountryRegion": "CA",
"sellToContact": "Mr. Ryan Danner",
"yourReference": "",
"languageCode": "ENC",
"locationCode": "BLUE",
"stockCenterCode": "OWN",
"transportMethodCode": "",
"shipmentMethod": "EXW",
"shipmentDate": "2026-01-22",
"requestedDeliveryDate": "2026-01-22",
"placeOfLoading": "",
"placeOfDischarge": "",
"placeOfDelivery": "",
"placeOfDestination": "",
"shippingAgent": "",
"shippingAgentService": "",
"shippingReferenceNo": "",
"scheduledTripNo": "",
"transportUnitId": 0,
"noOfTransportUnits": 0,
"shipToCode": "",
"shipToName": "Elkhorn Airport",
"shipToName2": "",
"shipToAddress": "105 Buffalo Dr.",
"shipToAddress2": "",
"shipToPostCode": "CA-MB R0M 0N0",
"shipToCity": "Elkhorn",
"shipToCounty": "",
"shipToCountry": "CA",
"shipToContact": "Mr. Ryan Danner",
"amount": 31351.86,
"currencyCode": "CAD",
"postingDate": "2026-01-22",
"billToCustomerNo": "01905899",
"billToCountryRegion": "CA",
"paymentBankAccount": "",
"noOfLines": 0,
"noOfTradeItems": 1706,
"noOfTradeItemsReserved": 1726,
"noOfTradeItemsShipped": 0,
"noOfPalletsReserved": 12,
"lastModified": "2025-10-29T11:55:38.107Z"
}
Usage
Read one agreement with lines
Reading one entry of this table must be done with the record Id which is in this case the systemId.
Lines are shown by adding to the URL $expand=salesAgreementLines
GET ... salesAgreements([system-id])?$expand=salesAgreementLines
Create an agreement with lines
POST .../openSalesAgreements?$expand=salesAgreementLines
Body:
{
"orderDate": "2025-12-07",
"sellToCustomerNo": "4203690429",
"locationCode": "001",
"externalDocumentNo": "ORD-0123",
"salesAgreementLines": [
{
"itemNo": "ZZZ1003",
"noOfTradeItems": 2,
"tradeItemUnitOfMeasure": "kassi",
"unitPrice": 10.0
}
]
}
The response contains the the new entry, both header and lines.
Status Changes
Release
This will release the agreement, same as clicking on the Release button within BC.
POST
[server]/api/wisefish/wiFiEP/v1.0/companies([CompanyGUID])/openSalesAgreements([record-id])/Microsoft.NAV.release
(no parameters)
After a successful request:
-
The Status becomes Released.
Reopen
If an already released agreement needs to be reopened, in order to do some changes.
POST
[server]/api/wisefish/wiFiEP/v1.0/companies([CompanyGUID])/openSalesAgreements([record-id])/Microsoft.NAV.reopen
(no parameters)
After a successful request:
-
The Status becomes Open.
Posting
Create Posting Document
When all lines have been registered on the sales agreement, the posting document can be created, i.e. either a Sales Order or a Sales Invoice. Before this is run, the agreement must be released.
POST
[server]/api/wisefish/wiFiEP/v1.0/companies([CompanyGUID])
/openSalesAgreements([record-id])/Microsoft.NAV.createPostingDocument
(no parameters)
After a successful request:
-
A standard BC posting document (Sales Order or Sales Invoice, depends on settings) has been created for the agreement.
Create Posting Document and Post Shipment
This method can be used if the API user is allowed to both create the posting document and then immediately post the items out of inventory.
POST
[server]/api/wisefish/wiFiEP/v1.0/companies([CompanyGUID])
/openSalesAgreements([record-id])/Microsoft.NAV.createPostingDocumentAndPostShipment
(no parameters)
This method does both:
-
Creates a a Sales Order for the agreement.
-
The sales order is posted with the “Ship” option, which means that items are removed from stock, but the order waits for the invoice to be created later.