Breadcrumbs

API - Open Purchase Lines


Overview

This API is for the lines on openPurchaseOrders, see API - Open Purchase Orders

Endpoint name

openPurchaseLines

Source table

Purchase Line

Fixed view

Fixed filter on orders:

  • Document Type = Order

Requests allowed

GET, PATCH

Modifications are only allowed if the order is Open.

Primary Key

Document Type, Document No., Line No.

Record ID

systemId

Procedures

  • updateQuantityToReceive

  • updateQuantityToReceiveToBin

  • createItemTracking
    For lines with items that are tracked (require a lot or serial)


Data

Field List

Property

Type

Max Len

Description

non-editable

systemId

string uuid


The system id of the record.

Record ID

orderNo

Decimal

20

The number of the document

primary key non-editable

orderLineNo

Decimal

20

The number of the document

primary key non-editable

itemNo

string

20

Item number

non-editable

description

string

80

Item description

non-editable

locationCode

string

10

Location Code. Cannot be modified if anything has been received.

non-editable

quantityOrdered

decimal


The quantity ordered


quantityReceived

decimal


Quantity already received

non-editable

quantityToReceive

decimal


The quantity to be received. When the posting method is run, this is the quantity that is going to be posted. If the items require lots and/or bins, the posting method will fail if that information has not been given.

For easier usage, there are methods available to modify this value. See below.


lastBinCode

string

10

The Bin in the purchase order line can act as a suggested/default bin. If received repeatedly to different bins, the value is changes and just contains the last one used.


lastModified

date-time utc


Timestamp.

non-editable


Example Object

An example of one object, a purchase line:

JSON
 {
    "systemId": "13c5c764-25f2-f011-b02d-b0f7742eb803",
    "orderNo": "106091",
    "orderLineNo": 10000,
    "itemNo": "80218-T",
    "description": "Hard disk Drive",
    "location": "BLUE",
    "quantityOrdered": 10,
    "quantityReceived": 6,
    "quantityToReceive": 4,
    "lastBinCode": "",
    "lastModified": "2026-01-15T15:52:05.533Z"
}


Usage

Read all open purchase lines of one order

JSON
GET .../openPurchaseOrders([No.])/openPurchaseLines


Read a specific order line

For this endpoint, the systemId is used as a record id:

JSON
GET .../openPurchaseLines([systemId])


Receiving quantity

This method will only update the “Qty. To Receive” field.

JSON
POST .../openPurchaseOrders([No.])/Microsoft.NAV.updateQuantityToReceive

Body:
{
    "quantity": [how many items were receeived]
}

Parameters


quantity

How many items to receive in the unit of the purchase (does not have to be the same as the base unit).


Receiving quantity with a Bin

JSON
POST .../openPurchaseOrders([No.])/Microsoft.NAV.updateQuantityToReceiveToBin

Body:
{
    "quantity": [...],
    "binCode": '[Bin Code]'
}

Parameters


quantity

How many items to receive in the base unit

bin

The bin code, which must exist on the location


Create Tracking Lines

JSON
POST .../openPurchaseOrders([No.])/Microsoft.NAV.createItemTracking

Body:
{
    "quantity": [...],
    "lotNumber": '[...]'
}

Parameters


quantity

How many items to receive in the base unit

lot

Lot number can be any string, it does not need to be registered in the system beforehand.

After a successful run entries have been created in table Reservation Entry, this info is visible on page Item Tracking Lines liked to the order line.


This method does not have parameter for bin, because it should not be used if a Bin is required. If both Bin and Lot is required for Location, then the module Warehouse Receipts must be used. Item tracking lines are then linked to the warehouse receipt lines.