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

Format

Description

non-editable

systemId

string

uuid

The system id of the record.

Record ID

orderNo

string

max 20

The number of the document

primary key non-editable

orderLineNo

integer


The number of the document

primary key non-editable

itemNo

string

max 20

Item number

non-editable

description

string

max 80

Item description

non-editable

locationCode

string

max 10

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

non-editable

quantityOrdered

number


The quantity ordered


quantityReceived

number


Quantity already received, which means this quantity has been posted into the inventory.

non-editable

quantityToReceive

number


The quantity to be received. When the posting method is run, this is the quantity that is going to be posted.

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


quantityTracked

number


Tracking information (lots and/or serial numbers) for quantity to be posted can be viewed on the page “Item Tracking Lines” in BC. This field shows the total quantity that already has got tracking info.

If item of this line requires lots and/or bins, the posting method will fail if that information has not been given.

non-editable

binCode

string

max 10

The Bin on 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

string

date-time

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 .../openPurchaseLines([systemId])/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 .../openPurchaseLines([systemId])/Microsoft.NAV.updateQuantityToReceiveToBin

Body:
{
    "quantity": [...],
    "bin": '[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 .../openPurchaseLines([systemId])/Microsoft.NAV.createItemTracking

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

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.