Breadcrumbs

API - Open Purchase Orders


Overview

This API is used for receiving items being purchased with Purchase Orders.

If the Location has a checkmark in field Require Receive, this method cannot be used.

Endpoint name

openPurchaseOrders

Source table

Purchase Header

Fixed view

Only has orders which are not fully received:

  • Document Type = Order

  • Received Not Invoiced = false

Requests allowed

GET

Primary Key

Document Type, Document No.

Record ID

number

Procedures

  • postReceipt
    Before posting, for the lines with items that are tracked (require a lot or serial number), the quantity to receive is modified to match the quantity in created Item Tracking Lines.


Data

Field List

Property

Type

Max Len

Description

non-editable

systemId

string uuid


The system id of the record.


number

string

20

No. of the Purchase Order.

Record ID

vendorNo

string

20

The number of the vendor


vendorName

string

100

The vendor name


yourReference

string

35

Your Reference. This field can be used for all kinds of info.


locationCode

string

10

Location Code. If given on the header, usually all lines have that same location.


status

enum


The status of the order, it can be both Open or Released when items are being received. When released, the order is not editable.


expectedReceiptDate

date


The expected receipt date.


vendorShipmentNo

string

35

A shipment reference or delivery note.


vendorInvoicetNo

string

35

If the invoice number has already been registered on the order, but often it is done after receipt of the items.


noOfLines

integer


The number of lines (items) on the order.


openPurchaseLines

array


An array that contains the lines of the order.

API - Open Purchase Lines

Will only be shown by using URL parameter $expand=openPurchaseLines


lastModified

date-time utc


Timestamp.



Example Object

Expand to see the example json

An example of one object, where the lines are also shown with expand:

JSON
{
    "number": "106091",
    "systemId": "7f683dec-24f2-f011-b02d-b0f7742eb803",
    "vendorNo": "50000",
    "vendorName": "Service Electronics Ltd.",
    "yourReference": "",
    "location": "BLUE",
    "status": "Released",
    "expectedReceiptDate": "0001-01-01",
    "vendorShipmentNo": "",
    "vendorInvoiceNo": "TEST-3-TVO-SKREF",
    "noOfLines": 1,
    "openPurchaseLines": [
        {
            "@odata.etag": "W/\"JzE5OzM2MTA1MjQ4OTk0MzM1NTQzMjgxOzAwOyc=\"",
            "systemId": "13c5c764-25f2-f011-b02d-b0f7742eb803",
            "orderNumber": "106091",
            "orderLineNo": 10000,
            "itemNumber": "80218-T",
            "description": "Hard disk Drive",
            "quantityTotal": 10,
            "quantityReceived": 6,
            "quantityToReceive": 4,
            "lastBinCode": "",
            "lastModified": "2026-01-15T15:52:05.533Z"
        },
    "lastModified": "2026-01-15T15:52:05.53Z"      
    ]
}


Usage

Read all open purchase orders

JSON
GET .../openPurchaseOrders


Read a specific order

For this endpoint, it is enough to give the number of the order:

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

Example:

Reading order 106091 and get all the lines as well:

JSON
GET .../openPurchaseOrders('106091')?$expand=openPurchaseLines


Post Receipt

Usage of the procedures on openPurchaseOrders and API - Open Purchase Lines must be as follows:

  1. Send in all received items for the order - on line level:

    1. For item with item tracking (see below), use endpoint openPurchaseLines(..)/..createItemTracking for each line to send in the Lot numbers.

    2. For every item without item tracking, use endpoint openPurchaseLines(..)/..updateQuantityToReceive to modify how many pieces were received.

    3. If a bin is used, use openPurchaseLines(..)/..updateQuantityToReceiveToBin instead.

  2. When all lines have got the correct quantity, lots and bins registered, the receipt can be posted either

    1. manually

    2. or with this procedure openPurchaseOrders(id)/...postReceipt/as shown here below:


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

Body:
{
  // no parameters
}

After a successful run when the receipt is for a Purchase Order, the following has happened.

  • Posted Purchase Receipt has been created, for all the received items

  • One Item Ledger Entry for each combination of item and lot

  • The columns Qty. Received has been updated on all the lines of the order