API - Sales Agreement Lines


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.

It is also used for the child entries salesAgreementLines on transportUnits (the lines of delivery agreements that are designated to the transport unit). On closedSalesAgreements the lines are read-only.

Endpoint name

salesAgreementLines

Source table

WiFi Sales Agreement Line

Fixed view

Only lines with documentType = Blanket or Delivery are shown. The lines are sorted by item no. (itemNo) in descending order.

Requests allowed

GET, POST, PATCH, DELETE

Primary key

Document Type, Document No., Line No.

Record ID

systemId

Procedures

For easier usage, there are procedures to update the main figures of the line:

updateQuantity, updateUnitPrice, updateQuantityAndUnitPrice

Methods to reserve and unreserve a pallet:

reservePallet, unreservePallet

Methods to reserve and unreserve a trade item:

reserveTradeItem, unreserveTradeItem

Method to check if a trade item is reserved to the line:

checkReservation

Creating, changing and deleting lines

The endpoint allows inserting, modifying and deleting lines. When a line is created, properties that are not given get default values: documentType = Delivery and type = Item.

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.

Possible errors from the endpoint itself (the normal Business Central and Wisefish validation also applies):

  • Cannot insert lines in a Sales Agreement that is Posted or Closed. (POST, when the line status is Posting or Closed)

  • Cannot modify lines of a Sales Agreement that is Posted or Closed. (PATCH, when the line status is Posting or Closed)

If lineNo is not given (or 0), the line no. is the last line no. on the document + 100 (100 for the first line).


Data

Field List

Property

Type

Format

Description


1

systemId

string

uuid

Since the primary key is combined of multiple fields, this must be used as the record Id of the API.

Record ID

non-editable

2

documentType

string

enum

Options are: Blanket, Delivery

Delivery is the default value when the property is skipped.

See Wisefish documentation to understand the difference.

primary key

optional

3

documentNo

string

max 20

The number of the sales agreement this line belongs to.

primary key

optional

4

lineNo

integer


The key of this line within the document.

If not given (or 0), it is assigned automatically: the last line no. on the document + 100 (100 for the first line).

primary key

optional

5

type

string

enum

Options are Item (the default). If this is blank, this line is just a text line put on the document for information.

optional

6

itemNo

string

max 20

The item number

mandatory

7

description

string

max 100

Description of the item

optional

8

description2

string

max 50

Description 2

optional

9

lotFilter

string

max 20

These properties tell which inventory should be sold.

optional

10

lotFilterOriginal

string

max 20

These properties tell which inventory should be sold.

optional

11

noOfTradeItems

number

decimal

Number of trade items.

When creating new lines, either use one of the pairs:

  • noOfTradeItems and tradeItemUnitOfMeasure

  • quantity and unitOfMeasure

If this field is used, then quantity is calculated automatically.

mandatory *

12

tradeItemUnitOfMeasure

string

max 10

Must be given when noOfTradeItems is used.

mandatory *

13

quantity

number

decimal

Quantity to be sold. It is possible to sell in a unit that is not the base unit of the item.

mandatory *

14

unitOfMeasure

string

max 10

The unit that belongs to field quantity

mandatory *

15

quantityBase

number

decimal

The quantity to be sold in the base unit.

optional

16

baseUnitOfMeasure

string

max 10

Base Unit of Measure of the item (from the Item card). Empty when the line type is not Item.

non-editable

17

reservedTradeItemsBase

number

decimal

Allocated No. of TIs (Base): the number of trade items (base unit) reserved to this agreement line.

non-editable

18

expectedNoOfPallets

number

decimal

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.

Calculated as noOfTradeItems divided by the number of trade items per pallet (from the pallet standard of the line), rounded to 2 decimals. 0 if the number of trade items per pallet is not found.

non-editable

19

unitPrice

number

decimal

Pricing and total amounts

optional

20

purchPriceToVendor

number

decimal

Pricing and total amounts

optional

21

lineAmount

number

decimal

Pricing and total amounts

optional

22

lineDiscount

number

decimal

Pricing and total amounts

optional

23

lineDiscountAmount

number

decimal

Pricing and total amounts

optional

24

amount

number

decimal

Pricing and total amounts

non-editable

25

vat

number

decimal

Pricing and total amounts

non-editable

26

amountIncludingVAT

number

decimal

Pricing and total amounts

non-editable

27

transportUnitId

string


If a specific transport has been designated for this line, it is either set on the line, or on the header. Related to table “Transport Unit”. This field is not editable, this value is changed from BC.

non-editable

28

vendorNo

string

max 20

Vendor No.

optional

29

externalProducer

string

max 20

External Stock Center

optional

30

netWeight

number

decimal

Net Weight

optional

31

netWeightBWU

number

decimal

Net Weight (BWU)

TODO: Is this needed?

non-editable

32

systemRowVersion

integer


System row version. Increments every time the record is modified.

non-editable

33

lastModified

string

date-time

SystemModifiedAt (date and time of last change)

non-editable

34

modifiedByUser

string

max 50

The user who last modified the record

non-editable


Object Example

JSON
{
    "systemId": "de661423-7eaf-f011-b028-99c8bc4e8b83",
    "documentType": "Delivery",
    "documentNo": "DS-034",
    "lineNo": 40000,
    "type": "Item",
    "itemNo": "70065",
    "description": "Fiskinaggar ",
    "description2": "",
    "lotFilter": "",
    "lotFilterOriginal": "",
    "noOfTradeItems": 60,
    "tradeItemUnitOfMeasure": "PACK",
    "quantity": 600,
    "unitOfMeasure": "PCS",
    "quantityBase": 600,
    "baseUnitOfMeasure": "PCS",
    "reservedTradeItemsBase": 0,
    "expectedNoOfPallets": 0,
    "unitPrice": 23.153,
    "purchPriceToVendor": 0,
    "lineAmount": 13891.8,
    "lineDiscount": 0,
    "lineDiscountAmount": 0,
    "amount": 13891.8,
    "vat": 0,
    "amountIncludingVAT": 13891.8,
    "transportUnitId": "0",
    "vendorNo": "",
    "externalProducer": "",
    "netWeight": 5,
    "netWeightBWU": 3000,
    "systemRowVersion": 2583412,
    "lastModified": "2025-10-28T09:30:22.037Z",
    "modifiedByUser": ""
}


Procedures

Procedures are called on a specific line: POST salesAgreementLines(<systemId>)/Microsoft.NAV.<procedureName> with a JSON body of parameters. Each procedure returns a text message in the value property of the response on success. On failure it returns an error with a readable message.

Parameter names are case-sensitive (note tradeItemlineNo with a lower-case l).

A few 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.

Procedure

Parameters

Description

Details

updateQuantity

updateQty (decimal)

Set a new quantity on the line (validated into Quantity).

Show more

updateUnitPrice

updatePrice (decimal)

Set a new unit price on the line (validated into Unit Price).

Show more

updateQuantityAndUnitPrice

updateQty (decimal), updatePrice (decimal)

Set both a new quantity and a new unit price on the line.

Show more

reserveTradeItem

tradeItemStage (text, max 20), tradeItemlineNo (int)

Reserve an open trade item, identified by stage and line no., to this agreement line.

Show more

reservePallet

palletBarcode (text, max 20)

Reserve a pallet, i.e. all the trade items on it, to this agreement line.

Show more

unreserveTradeItem

tradeItemStage (text, max 20), tradeItemlineNo (int)

Remove the reservation of a trade item from this agreement line.

Show more

unreservePallet

palletBarcode (text, max 20)

Remove the reservation of a pallet, i.e. all the trade items on it, from this agreement line.

Show more

checkReservation

tradeItemStage (text, max 20), tradeItemlineNo (int)

Check if a trade item is reserved to this agreement line.

Show more


Quantity and price

Update Quantity

This method makes it 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 unit of measure of the line (unitOfMeasure).

JSON
POST
[server]/api/wisefish/base/v1.0/companies([CompanyGUID])
  /salesAgreementLines([record-id])/Microsoft.NAV.updateQuantity

Body:
{
  "updateQty": 100
}

Parameters

Type

Max Len

Description


updateQty

number


The new quantity

mandatory

The quantity of the line is changed, and the value property of the response is Quantity updated successfully.

Possible errors (checked in this order):

  • The agreement line does not exist (standard Business Central error, record not found).

  • Parameter updateQty may not be negative!

  • Errors from the validation of field Quantity or from modifying the line (standard Business Central / Wisefish errors).

Behaviour notes:

  • updateQty = 0 is allowed.

  • The Posted/Closed check of the endpoint (Cannot modify lines of a Sales Agreement that is Posted or Closed.) is made on PATCH requests only; it is not made by this procedure, which modifies the line directly. Only the validation in Business Central and Wisefish applies.


Update Unit Price

This method makes it possible to use POST and only give one parameter, the new unit price. This will be validated into field “Unit Price” in BC.

JSON
POST
[server]/api/wisefish/base/v1.0/companies([CompanyGUID])
  /salesAgreementLines([record-id])/Microsoft.NAV.updateUnitPrice

Body:
{
  "updatePrice": 12.50  
}

Parameters

Type

Max Len

Description


updatePrice

number


The new price

mandatory

The unit price of the line is changed, and the value property of the response is Unit Price updated successfully.

Possible errors (checked in this order):

  • The agreement line does not exist (standard Business Central error, record not found).

  • Parameter updatePrice may not be negative!

  • Errors from the validation of field Unit Price or from modifying the line (standard Business Central / Wisefish errors).

Behaviour notes:

  • updatePrice = 0 is allowed.

  • The Posted/Closed check of the endpoint (Cannot modify lines of a Sales Agreement that is Posted or Closed.) is made on PATCH requests only; it is not made by this procedure, which modifies the line directly. Only the validation in Business Central and Wisefish applies.


Update Quantity and Unit Price

This method makes it possible to use POST and only give both the new quantity and price. Same as using both methods above.

JSON
POST
[server]/api/wisefish/base/v1.0/companies([CompanyGUID])
  /salesAgreementLines([record-id])/Microsoft.NAV.updateQuantityAndUnitPrice

Body:
{
  "updateQty": 100,
  "updatePrice": 12.50
}

Parameters

Type

Max Len

Description


updateQty

number


The new quantity

mandatory

updatePrice

number


The new price

mandatory

The quantity and the unit price of the line are changed, and the value property of the response is Quantity and Unit Price updated successfully.

Possible errors (checked in this order):

  • The agreement line does not exist (standard Business Central error, record not found).

  • Parameter updateQty may not be negative!

  • Parameter updatePrice may not be negative!

  • Errors from the validation of fields Quantity and Unit Price or from modifying the line (standard Business Central / Wisefish errors).

Behaviour notes:

  • Quantity is validated before Unit Price. Both parameters are checked before anything is changed.

  • The Posted/Closed check of the endpoint (Cannot modify lines of a Sales Agreement that is Posted or Closed.) is made on PATCH requests only; it is not made by this procedure, which modifies the line directly. Only the validation in Business Central and Wisefish applies.



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

JSON
POST
.../salesAgreementLines([record-id])/Microsoft.NAV.reserveTradeItem

Body:
{
    "tradeItemStage" : "PRODUCTION",
    "tradeItemlineNo" : 57
}

Parameters

Type

Max Len

Description


tradeItemStage

string

20

Give the value in field “Stage” of the Open Trade Item

mandatory

tradeItemlineNo

integer


Give the value of field “Line No.” of the Open Trade Item

mandatory

If successful, the trade item is shown on the Delivery Agreement as reserved.

The value property of the response is Trade Item <Stage> <Line No.> successfully reserved for <Agreement No.>

  • If the trade item is already reserved to this agreement line, this is not an error. The call succeeds and the response is: Trade Item is already reserved to agreement <Agreement No.> and line <Line No.>!

Possible errors (checked in this order):

  • The agreement line does not exist (standard Business Central error, record not found).

  • The open trade item (tradeItemStage / tradeItemlineNo) does not exist (standard Business Central error, record not found).

  • The trade item is not available. The error message is the reason:

    • Reserved for <Agreement Type> <Agreement No.> (the trade item is reserved to another agreement, or to another line of this agreement)

    • Reserved for journal entry.

    • Reserved for outbound document.

    • Reserved for consumption entry.

    • <Hold Status> <Hold Reason Code> (when the trade item is on hold)

  • Reservation failed: <error text> when the Wisefish reservation fails, for example if the agreement header does not exist. The error text from Wisefish/Business Central follows the colon.

Behaviour notes:

  • tradeItemStage is cut to 20 characters without an error.

  • The reservation is made with the standard Wisefish reservation of trade items to an agreement line (demand driven).

Reserve a Pallet

This method is used to reserve a pallet to the sales line:

JSON
POST
.../salesAgreementLines([record-id])/Microsoft.NAV.reservePallet

Body:
{
    "palletBarcode" : "00066666666000000141"
}

Parameters

Type

Max Len

Description


palletBarcode

string

20

The barcode, which is the primary key of the pallet table.

mandatory

If successful, the pallet is shown on the Delivery Agreement as reserved.

The trade items on the pallet, become reserved automatically.

The value property of the response is Pallet <Pallet No.> successfully reserved for <Agreement No.>

  • If all the trade items on the pallet are already reserved to this agreement line, this is not an error. The call succeeds and the response is: Pallet is already reserved to agreement <Agreement No.>!

Possible errors (checked in this order):

  • The agreement line does not exist (standard Business Central error, record not found).

  • The pallet does not exist (standard Business Central error, record not found).

  • Pallet Status is <Status>! (when the pallet status is Empty or Gone)

  • There are no Trade Items on the pallet!

  • A trade item on the pallet is not available. The error message is the reason:

    • Reserved for <Agreement Type> <Agreement No.> (the trade item is reserved to another agreement, or to another line of this agreement)

    • Reserved for journal entry.

    • Reserved for outbound document.

    • Reserved for consumption entry.

    • <Hold Status> <Hold Reason Code> (when the trade item is on hold)

  • Errors from the Wisefish reservation itself (standard Wisefish/Business Central errors, not prefixed), for example if the agreement header does not exist.

Behaviour notes:

  • Reserving a pallet reserves every trade item on it to the agreement line, one by one.

  • If the pallet has a scheduled trip no., the trip no. and transport unit ID of the pallet are also set on the trade items (and their trade item ledger entries).

  • If only some of the trade items on the pallet are already reserved to this line, the call fails with Reserved for <Agreement Type> <Agreement No.>.

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:

JSON
POST
.../salesAgreementLines([record-id])/Microsoft.NAV.unreserveTradeItem

Body:
{
    "tradeItemStage" : "PRODUCTION",
    "tradeItemlineNo" : 57
}

Parameters

Type

Max Len

Description


tradeItemStage

string

20

Give the value in field “Stage” of the Open Trade Item

mandatory

tradeItemlineNo

integer


Give the value of field “Line No.” of the Open Trade Item

mandatory

If successful, the trade item is no longer reserved on the Agreement, and the value property of the response is Trade Item <Stage> <Line No.> un-reserved from agreement <Agreement No.>.

Possible errors (checked in this order):

  • The agreement line does not exist (standard Business Central error, record not found).

  • The open trade item (tradeItemStage / tradeItemlineNo) does not exist (standard Business Central error, record not found).

  • Trade Item is not reserved to the specified agreement line!

  • The agreement header does not exist (standard Business Central error, record not found).

  • Errors from the Wisefish release of the reservation.

Behaviour notes:

  • tradeItemStage is cut to 20 characters without an error.


Unreserve a Pallet

To remove the reservation of a pallet, this method is used, with the same single parameter as above:

JSON
POST
.../salesAgreementLines([record-id])/Microsoft.NAV.unreservePallet

Body:
{
    "palletBarcode" : "00066666666000000141"
}

Parameters

Type

Max Len

Description


palletBarcode

string

20

The barcode, which is the primary key of the pallet table.

mandatory

If successful, the pallet is no longer reserved on the Agreement.

The Trade Items are also unreserved.

The value property of the response is Pallet <Pallet No.> successfully un-reserved for <Agreement No.>.

Possible errors (checked in this order):

  • The agreement line does not exist (standard Business Central error, record not found).

  • The pallet does not exist (standard Business Central error, record not found).

  • Pallet is not reserved to the specified agreement! (when the agreement no. on the pallet is another one, there are no trade items on the pallet, or at least one trade item on the pallet is not reserved to this agreement line)

  • The agreement header does not exist (standard Business Central error, record not found).

  • Errors from the Wisefish release of the reservation.


Reservation status

Check Reservation of a Trade Item

To check if a trade item is reserved to this particular agreement line, the 2 fields of the primary key of the trade item are given as parameters to procedure checkReservation. Nothing is changed.

JSON
POST
.../salesAgreementLines([record-id])/Microsoft.NAV.checkReservation

Body:
{
    "tradeItemStage" : "PRODUCTION",
    "tradeItemlineNo" : 57
}

Parameters

Type

Max Len

Description


tradeItemStage

string

20

Give the value in field “Stage” of the Open Trade Item

mandatory

tradeItemlineNo

integer


Give the value of field “Line No.” of the Open Trade Item

mandatory

The value property of the response is Already reserved if the trade item is reserved to this agreement line, otherwise Not reserved.

Possible errors:

  • The agreement line does not exist (standard Business Central error, record not found).

  • The open trade item (tradeItemStage / tradeItemlineNo) does not exist (standard Business Central error, record not found).

Behaviour notes:

  • Not reserved is also returned when the trade item is reserved to another agreement, or to another line of the same agreement.



Examples

Read sales agreement lines

Read lines of a document

To read the lines with a filter on a single document:

JSON
GET
[server]/api/wisefish/base/v1.0/companies([CompanyGUID])/salesAgreementLines?$filter=documentNo eq 'DS-034'
Expand to see the example json

Response:

JSON
{
    "@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#companies(cf9f7b85-dd11-ef11-9f8b-6045bde9cc61)/salesAgreementLines",
    "value": [
        {
            "@odata.etag": "W/\"JzIwOzE0NTI4MDI2MDc2NzYyMzU0Mjc0MTswMDsn\"",
            "systemId": "de661423-7eaf-f011-b028-99c8bc4e8b83",
            "documentType": "Delivery",
            "documentNo": "DS-034",
            "lineNo": 40000,
            "type": "Item",
            "itemNo": "70065",
            "description": "Fiskinaggar ",
            "description2": "",
            "lotFilter": "",
            "lotFilterOriginal": "",
            "noOfTradeItems": 60,
            "tradeItemUnitOfMeasure": "PACK",
            "quantity": 600,
            "unitOfMeasure": "PCS",
            "quantityBase": 600,
            "baseUnitOfMeasure": "PCS",
            "reservedTradeItemsBase": 0,
            "expectedNoOfPallets": 0,
            "unitPrice": 23.153,
            "purchPriceToVendor": 0,
            "lineAmount": 13891.8,
            "lineDiscount": 0,
            "lineDiscountAmount": 0,
            "amount": 13891.8,
            "vat": 0,
            "amountIncludingVAT": 13891.8,
            "transportUnitId": "0",
            "vendorNo": "",
            "externalProducer": "",
            "netWeight": 5,
            "netWeightBWU": 3000,
            "systemRowVersion": 2583412,
            "lastModified": "2025-10-28T09:30:22.037Z",
            "modifiedByUser": ""
        }
    ]
}

Read a single line

The record ID is the systemId of the line, so one line is read with a GET request on the following format. The response is one line object, as shown in Object Example.

JSON
GET .../salesAgreementLines(de661423-7eaf-f011-b028-99c8bc4e8b83)

Read selected properties of the lines of an agreement

Reads the lines of agreement DS-034 that have item 70065, and returns only a few properties with $select.

Request:

JSON
GET .../salesAgreementLines?$filter=documentNo eq 'DS-034' and itemNo eq '70065'&$select=lineNo,itemNo,quantity,unitOfMeasure,unitPrice,reservedTradeItemsBase

Response:

JSON
{
    "@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#companies(cf9f7b85-dd11-ef11-9f8b-6045bde9cc61)/salesAgreementLines(lineNo,itemNo,quantity,unitOfMeasure,unitPrice,reservedTradeItemsBase)",
    "value": [
        {
            "@odata.etag": "W/\"JzIwOzE0NTI4MDI2MDc2NzYyMzU0Mjc0MTswMDsn\"",
            "lineNo": 40000,
            "itemNo": "70065",
            "quantity": 600,
            "unitOfMeasure": "PCS",
            "unitPrice": 23.153,
            "reservedTradeItemsBase": 0
        }
    ]
}

Read an agreement with its lines

Reads sales agreement DS-034 (by the systemId of the agreement) and adds its lines to the response as the array salesAgreementLines with $expand. The same works on openSalesAgreements and closedSalesAgreements.

JSON
GET .../salesAgreements(c25d1a17-7eaf-f011-b028-99c8bc4e8b83)?$expand=salesAgreementLines


Create, change and delete lines

Add a line to a document

To add a new line on a sales agreement:

JSON
POST
[server]/api/wisefish/base/v1.0/companies([CompanyGUID])/salesAgreementLines

{
    "documentNo": "DS-037",
    "itemNo": "70079",
    "quantity": 10,
    "unitOfMeasure": "BOX"
}

Response (shortened):

JSON
{
    "@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#companies(cf9f7b85-dd11-ef11-9f8b-6045bde9cc61)/salesAgreementLines/$entity",
    "@odata.etag": "W/\"JzIwOzE3NzQ1NjEyMzQ1Njc4OTAxMjM0MTswMDsn\"",
    "systemId": "7a1c5e90-3b2f-f011-b02b-99c8bc4e8b83",
    "documentType": "Delivery",
    "documentNo": "DS-037",
    "lineNo": 100,
    "type": "Item",
    "itemNo": "70079",
    "quantity": 10,
    "unitOfMeasure": "BOX",
    "systemRowVersion": 2583501,
    "lastModified": "2025-10-29T10:12:44.210Z",
    "modifiedByUser": ""
}

Change a line

Changes the line discount of the new line on DS-037. A PATCH request needs the If-Match header with the @odata.etag of the record (or *).

Request:

JSON
PATCH .../salesAgreementLines(7a1c5e90-3b2f-f011-b02b-99c8bc4e8b83)
If-Match: *

Body:
{
    "lineDiscount": 5
}

Response (shortened):

JSON
{
    "@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#companies(cf9f7b85-dd11-ef11-9f8b-6045bde9cc61)/salesAgreementLines/$entity",
    "@odata.etag": "W/\"JzIwOzE3NzQ1NjEyMzQ1Njc4OTAxMjM5OTswMDsn\"",
    "systemId": "7a1c5e90-3b2f-f011-b02b-99c8bc4e8b83",
    "documentNo": "DS-037",
    "lineNo": 100,
    "itemNo": "70079",
    "lineDiscount": 5,
    "systemRowVersion": 2583522,
    "lastModified": "2025-10-29T10:20:03.517Z"
}

Delete a line

Deletes the new line on DS-037. The same checks apply as when a line is deleted in Wisefish. On success the response is empty (HTTP status 204 No Content).

JSON
DELETE .../salesAgreementLines(7a1c5e90-3b2f-f011-b02b-99c8bc4e8b83)


Change quantity and price

Change the quantity of a line

Sets the quantity of line 40000 on DS-034 to 650 with updateQuantity.

Request:

JSON
POST .../salesAgreementLines(de661423-7eaf-f011-b028-99c8bc4e8b83)/Microsoft.NAV.updateQuantity

Body:
{
    "updateQty": 650
}

Response:

JSON
{
    "@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#Edm.String",
    "value": "Quantity updated successfully."
}

Change the unit price of a line

Sets the unit price of line 40000 on DS-034 to 24.5 with updateUnitPrice.

Request:

JSON
POST .../salesAgreementLines(de661423-7eaf-f011-b028-99c8bc4e8b83)/Microsoft.NAV.updateUnitPrice

Body:
{
    "updatePrice": 24.5
}

Response:

JSON
{
    "@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#Edm.String",
    "value": "Unit Price updated successfully."
}

Change both quantity and unit price of a line

Sets both the quantity and the unit price of line 40000 on DS-034 with updateQuantityAndUnitPrice.

Request:

JSON
POST .../salesAgreementLines(de661423-7eaf-f011-b028-99c8bc4e8b83)/Microsoft.NAV.updateQuantityAndUnitPrice

Body:
{
    "updateQty": 650,
    "updatePrice": 24.5
}

Response:

JSON
{
    "@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#Edm.String",
    "value": "Quantity and Unit Price updated successfully."
}

Change the quantity to a negative value

Calls updateQuantity with a negative quantity; the call fails and the line is not changed.

Request:

JSON
POST .../salesAgreementLines(de661423-7eaf-f011-b028-99c8bc4e8b83)/Microsoft.NAV.updateQuantity

Body:
{
    "updateQty": -5
}

Response:

JSON
{
    "error": {
        "code": "Application_DialogException",
        "message": "Parameter updateQty may not be negative!"
    }
}


Reserve and unreserve

Reserve a trade item to a line

Reserves trade item PRODUCTION-57 to line 40000 of delivery agreement DS-034 with reserveTradeItem.

Request:

JSON
POST .../salesAgreementLines(de661423-7eaf-f011-b028-99c8bc4e8b83)/Microsoft.NAV.reserveTradeItem

Body:
{
    "tradeItemStage" : "PRODUCTION",
    "tradeItemlineNo" : 57
}

Response:

JSON
{
    "@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#Edm.String",
    "value": "Trade Item PRODUCTION 57 successfully reserved for DS-034"
}

Reserve a trade item that is reserved elsewhere

Calls reserveTradeItem for a trade item that is already reserved to agreement DS-031; the call fails and the message is the reason.

Request:

JSON
POST .../salesAgreementLines(de661423-7eaf-f011-b028-99c8bc4e8b83)/Microsoft.NAV.reserveTradeItem

Body:
{
    "tradeItemStage" : "PRODUCTION",
    "tradeItemlineNo" : 57
}

Response:

JSON
{
    "error": {
        "code": "Application_DialogException",
        "message": "Reserved for Delivery DS-031"
    }
}

Reserve a pallet to a line

Reserves pallet 00066666666000000141, with all its trade items, to line 40000 of DS-034 with reservePallet.

Request:

JSON
POST .../salesAgreementLines(de661423-7eaf-f011-b028-99c8bc4e8b83)/Microsoft.NAV.reservePallet

Body:
{
    "palletBarcode" : "00066666666000000141"
}

Response:

JSON
{
    "@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#Edm.String",
    "value": "Pallet 000000000141 successfully reserved for DS-034"
}

Unreserve a trade item from a line

Removes the reservation of trade item PRODUCTION-57 from line 40000 of DS-034 with unreserveTradeItem.

Request:

JSON
POST .../salesAgreementLines(de661423-7eaf-f011-b028-99c8bc4e8b83)/Microsoft.NAV.unreserveTradeItem

Body:
{
    "tradeItemStage" : "PRODUCTION",
    "tradeItemlineNo" : 57
}

Response:

JSON
{
    "@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#Edm.String",
    "value": "Trade Item PRODUCTION 57 un-reserved from agreement DS-034."
}

Unreserve a pallet from a line

Removes the reservation of pallet 00066666666000000141 from line 40000 of DS-034 with unreservePallet.

Request:

JSON
POST .../salesAgreementLines(de661423-7eaf-f011-b028-99c8bc4e8b83)/Microsoft.NAV.unreservePallet

Body:
{
    "palletBarcode" : "00066666666000000141"
}

Response:

JSON
{
    "@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#Edm.String",
    "value": "Pallet 000000000141 successfully un-reserved for DS-034."
}

Check if a trade item is reserved to a line

Checks with checkReservation if trade item PRODUCTION-57 is reserved to line 40000 of DS-034.

Request:

JSON
POST .../salesAgreementLines(de661423-7eaf-f011-b028-99c8bc4e8b83)/Microsoft.NAV.checkReservation

Body:
{
    "tradeItemStage" : "PRODUCTION",
    "tradeItemlineNo" : 57
}

Response:

JSON
{
    "@odata.context": "https://containers.wisefish.com/BC/api/wisefish/base/v1.0/$metadata#Edm.String",
    "value": "Already reserved"
}