Overview
The list page that contains the lines of a Sales Agreement, i.e. the items, quantity, units, unit prices and total amount.
This endpoint is used for the child entries on salesAgreements, openSalesAgreements and closedSalesAgreements.
|
Endpoint name |
|
|
Source table |
|
|
Fixed view |
Shows only entries from the table with Status = Open or Released. |
|
Requests allowed |
GET, POST, PATCH, DELETE |
|
Primary key |
Document Type, Document No., Line No. |
|
Record ID |
|
|
Procedures |
For easier usage, there are procedures to update the main figures of the line:
Methods to reserve and unreserve a pallet:
Methods to reserve and unreserve a trade item:
|
Data
Field List
|
Property |
Type |
Max Len |
Description |
|
|
|---|---|---|---|---|---|
|
1 |
|
string uuid |
|
Since the primary key is combined of multiple fields, this must be used as the record Id of the API. |
record id |
|
2 |
|
string |
|
Options are: Blanket, Delivery Delivery is the default value when the property is skipped. See Wisefish documentation to understand the difference. |
primary key |
|
3 |
|
string |
20 |
The number of the sales agreement this line belongs to. |
primary key |
|
4 |
|
integer |
|
The key of this line within the document. |
primary key |
|
5 |
|
string |
|
Options are Item (the default). If this is blank, this line is just a text line put on the document for information. |
optional |
|
6 |
|
string |
20 |
The item number |
Mandatory |
|
7 |
|
string |
100 |
Description of the item |
optional |
|
8 |
|
string |
10 |
These properties tell which inventory should be sold. Usually set on the header. (Is it okay to use different locations for the lines on same document?) |
optional |
|
9 |
|
string |
20 |
These properties tell which inventory should be sold. Usually set on the header. (Is it okay to use different locations for the lines on same document?) |
optional |
|
10 |
|
string |
20 |
These properties tell which inventory should be sold. |
optional |
|
11 |
|
string |
20 |
These properties tell which inventory should be sold. |
optional |
|
12 |
|
integer |
|
Number of trade items. When creating new lines, either use one of the pairs:
If this field is used, then |
Mandatory * |
|
13 |
|
string |
10 |
Must be given when |
Mandatory * |
|
14 |
|
decimal |
|
Quantity to be sold. It is possible to sell in a unit that is not the base unit of the item. |
Mandatory * |
|
15 |
|
string |
10 |
The unit that belongs to field |
Mandatory * |
|
16 |
|
decimal |
|
The quantity to be sold in the base unit. |
|
|
17 |
|
integer |
|
The system estimates how many pallets are needed, according to a normal quantity on pallet. This does not set any restrictions on how many pallets can be reserved. |
optional |
|
18 |
|
decimal |
|
Pricing and total amounts |
optional |
|
19 |
|
decimal |
|
Pricing and total amounts |
optional |
|
20 |
|
decimal |
|
Pricing and total amounts |
|
|
21 |
|
decimal |
|
Pricing and total amounts |
optional |
|
22 |
|
decimal |
|
Pricing and total amounts |
|
|
23 |
|
decimal |
|
Pricing and total amounts |
|
|
24 |
|
decimal |
|
Pricing and total amounts |
|
|
25 |
|
decimal |
|
Pricing and total amounts |
|
|
26 |
|
string |
20 |
|
optional |
|
27 |
|
string |
20 |
|
optional |
|
28 |
|
decimal |
|
|
|
|
29 |
|
decimal |
|
TODO: Is this needed? |
|
|
30 |
|
datetime |
|
Timestamp of last modification |
non-editable |
Example Object
{
"@odata.etag": "W/\"JzIwOzE0NTI4MDI2MDc2NzYyMzU0Mjc0MTswMDsn\"",
"systemId": "de661423-7eaf-f011-b028-99c8bc4e8b83",
"documentType": "Delivery",
"documentNo": "DS-034",
"lineNo": 40000,
"type": "Item",
"itemNo": "70065",
"description": "Fiskinaggar ",
"locationCode": "BLUE",
"stockCenterCode": "",
"lotFilter": "",
"lotFilterOriginal": "",
"noOfTradeItems": 60,
"tradeItemUnit": "PACK",
"quantity": 600,
"unitOfMeasureCode": "PCS",
"quantityBase": 600,
"noOfPallets": 0,
"unitPrice": 23.153,
"purchPriceToVendor": 0,
"lineAmount": 13891.8,
"lineDiscount": 0,
"lineDiscountAmount": 0,
"amount": 13891.8,
"vat": 0,
"amountIncludingVAT": 13891.8,
"vendorNo": "",
"externalProducer": "",
"netWeight": 5,
"netWeightBWU": 3000,
"lastModified": "2025-10-28T09:30:22.037Z"
}
Usage
Read lines of a document
To read the lines with a filter on a single document:
GET
[server]/api/wisefish/wiFiEP/v1.0/companies([CompanyGUID])/salesAgreementLines?$filter=documentNo eq 'DS-034'
Add a line to a document
To add a new line on a sales agreement:
POST
[server]/api/wisefish/wiFiEP/v1.0/companies([CompanyGUID])/salesAgreementLines
{
"documentNo": "DS-037",
"itemNo": "70079",
"quantity": 10,
"unitOfMeasure": "BOX"
}
A successful request will…
-
Create a new line on the given agreement
-
Line No. is generated automatically
If the agreement is closed or in posting, an error is returned and a line cannot be added.
Specific modification methods
A vew service-enabled procedures are available to make modification of a specific line easier.
The record ID is systemId of the line so that must be retrieved first in order to use these endpoints.
Update Quantity
This method makes possible to use POST and only give one parameter, the new quantity.
This will be validated into field “Quantity” in BC which is the quantity in the base unit of measure for the Item.
POST
[server]/api/wisefish/wiFiEP/v1.0/companies([CompanyGUID])
/salesAgreementLines([record-id])/Microsoft.NAV.updateQuantity
Body:
{
"updateQty": 100
}
|
Parameters |
|
|---|---|
|
|
The new quantity |
Update Unit Price
This method makes possible to use POST and only give one parameter, the new unit price. This will be validated into field “Unit Price” in BC.
POST
[server]/api/wisefish/wiFiEP/v1.0/companies([CompanyGUID])
/salesAgreementLines([record-id])/Microsoft.NAV.updateUnitPrice
Body:
{
"updatePrice": 12.50
}
|
Parameters |
|
|---|---|
|
|
The new price |
Update Quantity and Unit Price
This method makes possible to use POST and only give both new quantity and price. Same as using both methods above.
POST
[server]/api/wisefish/wiFiEP/v1.0/companies([CompanyGUID])
/salesAgreementLines([record-id])/Microsoft.NAV.updateQuantityAndUnitPrice
Body:
{
"updateQty": 100,
"updatePrice": 12.50
}
|
Parameters |
|
|---|---|
|
|
The new quantity |
|
|
The new price |
Reserve
Reserve a Trade Item
To reserve a trade item for an agreement line, the 2 fields of the primary key of the trade item are given as parameters
POST
.../salesAgreementLines([record-id])/Microsoft.NAV.reserveTradeItem
Body:
{
"tradeItemStage" : "PRODUCTION",
"tradeItemlineNo" : 57
}
|
Parameters |
|
|---|---|
|
|
Give the value in field “Stage” of the Open Trade Item |
|
|
Give the value of field “Line No. of the Open Trade Item |
If successful, the trade item is shown on the Delivery Agreement as reserved.
Reserve a Pallet
This method is used to reserve a pallet to the sales line:
POST
.../salesAgreementLines([record-id])/Microsoft.NAV.reservePallet
Body:
{
"palletBarcode" : "00066666666000000141"
}
|
Parameters |
|
|---|---|
|
|
The barcode, which is the primary key of the pallet table. |
If successful, the pallet is shown on the Delivery Agreement as reserved.
The trade items on the pallet, become reserved automatically.
Unreserve
Unreserve a Trade Item
To remove the reservation of a trade item, for this particular agreement line, this method is used, with the same parameters as above:
POST
.../salesAgreementLines([record-id])/Microsoft.NAV.unreserveTradeItem
Body:
{
"tradeItemStage" : "PRODUCTION",
"tradeItemlineNo" : 57
}
Unreserve a Pallet
To remove the reservation of a pallet, this method is used, with the same single parameter as above:
POST
.../salesAgreementLines([record-id])/Microsoft.NAV.unreservePallet
Body:
{
"palletBarcode" : "00066666666000000141"
}
|
Parameters |
|
|---|---|
|
|
The barcode, which is the primary key of the pallet table. |
If successful, the pallet is no longer reserved on the Agreement.
The Trade Items are also unreserved.