Purchase Order List API
curl --request GET \
--url https://api.pazy.io/v1.0/procurement/purchase-ordersimport requests
url = "https://api.pazy.io/v1.0/procurement/purchase-orders"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.pazy.io/v1.0/procurement/purchase-orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pazy.io/v1.0/procurement/purchase-orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pazy.io/v1.0/procurement/purchase-orders"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.pazy.io/v1.0/procurement/purchase-orders")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pazy.io/v1.0/procurement/purchase-orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyPurchase Order APIs
Purchase Order List API
Retrieve list of a purchase order including vendor, line items, matched invoices, and GRNs
Purchase Order List API
curl --request GET \
--url https://api.pazy.io/v1.0/procurement/purchase-ordersimport requests
url = "https://api.pazy.io/v1.0/procurement/purchase-orders"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.pazy.io/v1.0/procurement/purchase-orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pazy.io/v1.0/procurement/purchase-orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pazy.io/v1.0/procurement/purchase-orders"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.pazy.io/v1.0/procurement/purchase-orders")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pazy.io/v1.0/procurement/purchase-orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyAuthentication
All requests require an API key in the request headers. Headers:Authorization: Api-Key YOUR_API_KEY
Request
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
sortBy | string | No | Field to sort results by. Allowed values: amount, date_created, expected_delivery_date, identifier. |
sortOrder | string | No | Sort direction. Allowed values: asc (ascending), desc (descending). |
sortNullOrder | string | No | Where to place results with null values in the sorted field. Allowed values: first, last. |
limit | int | No | The max number of rows to be returned. Max 100, Default 30. |
cursor | string | No | The pagination cursor, rows to offset/skip. Default 0. |
Code Examples
curl -X GET https://api.pazy.io/v1.0/procurement/purchase-orders \
-H "Authorization: Api-Key YOUR_API_KEY"
const response = await fetch('https://api.pazy.io/v1.0/procurement/purchase-orders', {
method: 'GET',
headers: {
'Authorization': 'Api-Key YOUR_API_KEY'
}
});
const result = await response.json();
import requests
url = "https://api.pazy.io/v1.0/procurement/purchase-orders"
headers = {
"Authorization": "Api-Key YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
result = response.json()
Success Response
HTTP Status:200 OK
Response Fields:
| Field | Type | Description |
|---|---|---|
ok | boolean | Indicates whether the request was successful |
data | object | Contains the purchase order details |
data.purchaseOrders | array | List of purchase orders |
data.purchaseOrders[].poId | string | Unique slug identifier for the purchase order |
data.purchaseOrders[].poNumber | string | Purchase order number assigned to the document |
data.purchaseOrders[].state | string | Current state of the PO. Possible values: DRAFTED, PENDING, APPROVED, DECLINED, CLOSED, ARCHIVED |
data.purchaseOrders[].poType | string | Purchase order type. Possible values: GOODS, SERVICES |
data.purchaseOrders[].matchingType | string | Matching type. Possible values: TWO_WAY, THREE_WAY |
data.purchaseOrders[].currency | string | ISO 4217 currency code (e.g., INR) |
data.purchaseOrders[].amount | number | Total purchase order amount |
data.purchaseOrders[].description | string | Short description for the purchase order |
data.purchaseOrders[].poDate | string | Purchase order date (ISO 8601 format, YYYY-MM-DD) |
data.purchaseOrders[].deliveryDate | string | Requested delivery date (ISO 8601 format, YYYY-MM-DD) |
data.purchaseOrders[].termsAndConditions | string | Terms and conditions for the purchase order |
data.purchaseOrders[].additionalNotes | string | Additional notes for delivery or special requirements |
data.purchaseOrders[].paymentTerms | string | Agreed payment terms |
data.purchaseOrders[].vendor | object | Linked vendor information (null if no vendor linked) |
data.purchaseOrders[].vendor.displayName | string | Vendor display name |
data.purchaseOrders[].vendor.legalName | string | Vendor legal name |
data.purchaseOrders[].lineItems | array | List of line items on the purchase order |
data.purchaseOrders[].lineItems[].identifier | string | SKU or identifier for the line item |
data.purchaseOrders[].lineItems[].quantity | number | Quantity requested |
data.purchaseOrders[].lineItems[].rate | number | Unit rate |
data.purchaseOrders[].lineItems[].amount | number | Total amount for this line item (quantity × rate) |
data.purchaseOrders[].matchedInvoices | array | List of invoices matched against this purchase order |
data.purchaseOrders[].matchedInvoices[].invoiceId | string | Unique identifier of the matched invoice |
data.purchaseOrders[].matchedInvoices[].invoiceNumber | string | Invoice number |
data.purchaseOrders[].matchedInvoices[].state | string | Current state of the invoice |
data.purchaseOrders[].matchedInvoices[].amount | number | Invoice amount |
data.purchaseOrders[].matchedInvoices[].currency | string | Invoice currency |
data.purchaseOrders[].matchedInvoices[].invoiceDate | string | Invoice date (ISO 8601 format) |
data.purchaseOrders[].matchedGrns | array | List of Goods Receipt Notes matched against this purchase order |
data.purchaseOrders[].matchedGrns[].grnId | string | Unique identifier of the matched GRN |
data.purchaseOrders[].matchedGrns[].grnNumber | string | GRN number |
data.purchaseOrders[].matchedGrns[].state | string | Current state of the GRN |
data.purchaseOrders[].matchedGrns[].amount | number | GRN total amount |
data.purchaseOrders[].matchedGrns[].totalQuantity | number | Total quantity received in the GRN |
data.purchaseOrders[].matchedGrns[].createdAt | string | Date the GRN was created (ISO 8601 format) |
data.context.count | number | Total number of vendor payments |
data.context.hasMore | boolean | If there is more Purchase Order |
data.context.count | number | Total number of vendor payments |
PO State Values
| Value | Description |
|---|---|
DRAFTED | PO is in draft state and can be edited |
PENDING | PO is pending approval |
APPROVED | PO has been approved |
DECLINED | PO was declined and can be edited |
CLOSED | PO has been closed |
ARCHIVED | PO has been archived |
Response Example
{
"ok": true,
"data": {
"purchaseOrders": [
{
"poId": "po-id",
"poNumber": null,
"state": "CREATED",
"poType": null,
"matchingType": null,
"currency": "INR",
"amount": null,
"description": null,
"poDate": "2026-01-13T10:32:19.526Z",
"deliveryDate": null,
"termsAndConditions": null,
"additionalNotes": null,
"vendor": null,
"lineItems": [],
"matchedInvoices": [],
"matchedGrns": []
},
{
"poId": "po-id",
"poNumber": "PO123456",
"state": "ARCHIVED",
"poType": "GOODS",
"matchingType": "TWO_WAY",
"currency": "INR",
"amount": null,
"description": "Purchase order with SKU",
"poDate": "2025-04-28T05:13:47.507Z",
"deliveryDate": null,
"termsAndConditions": null,
"additionalNotes": null,
"vendor": {
"displayName": "Acme Suppliers",
"legalName": "ACME SUPPLIERS PRIVATE LIMITED"
},
"lineItems": [
{
"identifier": "item1",
"quantity": 10,
"rate": 100,
"amount": 1000,
"taxId": "132",
"taxAmount": 100
},
{
"identifier": "Item 1",
"quantity": 10,
"rate": 100,
"amount": 1000,
"taxId": "132",
"taxAmount": 100
}
],
"matchedInvoices": [],
"matchedGrns": []
},
...
],
"context": {
"count": 100,
"hasMore": true,
"nextCursor": "100"
}
}
}
Error Responses
Purchase Order Not Found
HTTP Status:404 Not Found
{
"ok": false,
"error": {
"code": "PURCHASE_ORDER_NOT_FOUND",
"message": "Purchase order not found"
}
}
Authentication Errors
HTTP Status:401 Unauthorized
{
"ok": false,
"error": {
"code": "MISSING_CREDENTIALS",
"message": "Missing Credentials"
}
}
{
"ok": false,
"error": {
"code": "INVALID_API_KEY",
"message": "Invalid API Key"
}
}
Permission Errors
HTTP Status:403 Forbidden
{
"ok": false,
"error": {
"code": "INSUFFICIENT_PERMISSIONS",
"message": "Permission check failed - PERMISSION_CHECK_FAILED"
}
}
Internal Error
HTTP Status:500 Internal Server Error
{
"ok": false,
"error": {
"code": "INTERNAL_ERROR",
"message": "Internal error"
}
}
Best Practices
- The
matchedInvoicesarray is populated when invoices are linked to the PO (TWO_WAY or THREE_WAY matching) - The
matchedGrnsarray is populated only for THREE_WAY matching POs - Check
stateto understand where the PO is in the approval workflow before taking further actions
Was this page helpful?