Overview
The list page that contains the sales agreements in Wisefish, which are mainly used as Delivery Agreements.
In this case there are 3 endpoints with same properties, but different filter or usage:
-
All entries in the table, i.e. all Sales Agreement Header entries :
salesAgreements -
Sales Agreements which are open for changes, because the posting document has not been created:
openSalesAgreements -
Closed entries. i.e. non-editable, because the posting document has been created:
closedAgreements
|
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 |
|
Data
Field List
|
1 |
Property |
Type |
Max Len |
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 |
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 |
|
date |
|
|
Mandatory |
|
6 |
|
string |
20 |
The sales person code. |
|
|
7 |
|
string |
35 |
Use to make a reference to external documents, such as the customer order. |
|
|
8 |
|
string |
|
Options are: Open and Released. Released documents are mostly un-editable. A procedure must be used to release a document. |
non-editable 10 |
|
9 |
|
string |
20 |
The number of the customer, this field has table relation to the Customer table. |
Mandatory |
|
10 |
|
string |
100 |
Customer info, default value from the Customer |
|
|
11 |
|
string |
100 |
Customer info, default value from the Customer |
|
|
12 |
|
string |
20 |
Customer info, default value from the Customer |
|
|
13 |
|
string |
30 |
Customer info, default value from the Customer |
|
|
14 |
|
string |
10 |
Customer info, default value from the Customer |
|
|
15 |
|
string |
100 |
Customer info, default value from the Customer |
|
|
16 |
|
string |
35 |
|
|
|
17 |
|
string |
10 |
|
|
|
18 |
|
string |
10 |
From which Location the items will be taken. |
|
|
19 |
|
string |
20 |
From which Stock Center the items will be taken. |
|
|
20 |
|
string |
10 |
Shipping info |
|
|
21 |
|
string |
10 |
Shipping info |
|
|
22 |
|
date |
|
Shipping info |
|
|
23 |
|
date |
|
Shipping info |
|
|
24 |
|
string |
10 |
Shipping info - linked to table |
|
|
25 |
|
string |
10 |
Shipping info - linked to table |
|
|
26 |
|
string |
10 |
Shipping info - linked to table |
|
|
27 |
|
string |
10 |
Shipping info - linked to table |
|
|
28 |
|
string |
10 |
Shipping info - field “Shipping Agent Code” |
|
|
29 |
|
string |
10 |
Shipping info - field “Shipping Agent Service Code” |
|
|
30 |
|
string |
10 |
Shipping info |
|
|
31 |
|
string |
20 |
The Scheduled Trip to use for this sales. Related to table “Scheduled Trip”. |
|
|
32 |
|
integer |
|
If only a specific transport has been designated for this sales. Related to table “Transport Unit” |
|
|
33 |
|
integer |
|
Shows the number of transport units linked to the Scheduled Trip |
non-editable |
|
34 |
|
string |
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. |
|
|
35 |
|
string |
100 |
Ship-to information |
|
|
36 |
|
string |
50 |
Ship-to information |
|
|
37 |
|
string |
100 |
Ship-to information |
|
|
38 |
|
string |
50 |
Ship-to information |
|
|
39 |
|
string |
20 |
Ship-to information |
|
|
40 |
|
string |
30 |
Ship-to information |
|
|
41 |
|
string |
|
Ship-to information |
|
|
42 |
|
string |
10 |
Ship-to information |
|
|
43 |
|
string |
100 |
Ship-to information |
|
|
44 |
|
decimal |
|
The total amount of the order |
|
|
45 |
|
string |
10 |
Currency for the total amount |
|
|
46 |
|
date |
|
On which posting date it will be posted. |
|
|
47 |
|
string |
20 |
If should be billed to another customer, i.e. can be different from the sellToCustomerNo. |
|
|
48 |
|
string |
10 |
|
|
|
49 |
|
string |
20 |
|
|
|
50 |
|
integer |
|
No. of lines on this agreement. This will be the number of child entries in |
non-editable |
|
51 |
|
integer |
|
Total number of trade items to be sold. |
non-editable |
|
52 |
|
integer |
|
Total number of trade items already reserved. |
non-editable |
|
53 |
|
integer |
|
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 |
|
datetime |
|
Automatic time stamp of last modification. |
non-editable |
Example Object
{
"@odata.etag": "W/\"JzIwOzE0Njc0NjI1MTg3MTc1MjQzNTY1MTswMDsn\"",
"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",
"tradeItems": 2,
"tradeItemUnitOfMeasure": "kassi"
}
]
}
The response contains the the new entry, both header and lines.
Procedures
Service-enabled procedures are the following, see below.
Only the open sales agreements have procedures.
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"
}
Release
This will release the agreement, same as clicking on the Release button within BC.
Usage
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.
Usage
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.
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.
Usage
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.
Usage
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.