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 release a pallet:
|
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. |
|
|
6 |
|
string |
20 |
The item number |
Mandatory |
|
7 |
|
string |
100 |
Description of the item |
|
|
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?) |
|
|
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?) |
|
|
10 |
|
string |
20 |
These properties tell which inventory should be sold. |
|
|
11 |
|
string |
20 |
These properties tell which inventory should be sold. |
|
|
12 |
|
integer |
|
Number of trade items. If this field is used, then quantity is calculated automatically. |
|
|
13 |
|
string |
10 |
Must be given when |
|
|
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. |
|
|
18 |
|
decimal |
|
Pricing and total amounts |
|
|
19 |
|
decimal |
|
Pricing and total amounts |
|
|
20 |
|
decimal |
|
Pricing and total amounts |
|
|
21 |
|
decimal |
|
Pricing and total amounts |
|
|
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 |
|
|
|
27 |
|
string |
20 |
|
|
|
28 |
|
decimal |
|
|
|
|
29 |
|
decimal |
|
TODO: Is this needed? |
|
|
30 |
|
datetime |
|
Timestamp of last modification |
|
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.
Procedures
Service-enabled procedures are the following, see below.
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.
Usage
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.
Usage
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.
Usage
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 Pallet
This method is used to reserve a pallet to the sales line:
Usage
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.
Release Pallet
To remove the reservation, this method is used:
Usage
POST
.../salesAgreementLines([record-id])/Microsoft.NAV.releasePallet
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 released.