Purchase Order Details API
curl --request GET \
--url https://api.pazy.io/v1.0/procurement/purchase-order/:poIdimport requests
url = "https://api.pazy.io/v1.0/procurement/purchase-order/:poId"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.pazy.io/v1.0/procurement/purchase-order/:poId', 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-order/:poId",
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-order/:poId"
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-order/:poId")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pazy.io/v1.0/procurement/purchase-order/:poId")
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 Details API
Retrieve full details of a purchase order including vendor, line items, matched invoices, and GRNs
Purchase Order Details API
curl --request GET \
--url https://api.pazy.io/v1.0/procurement/purchase-order/:poIdimport requests
url = "https://api.pazy.io/v1.0/procurement/purchase-order/:poId"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.pazy.io/v1.0/procurement/purchase-order/:poId', 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-order/:poId",
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-order/:poId"
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-order/:poId")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pazy.io/v1.0/procurement/purchase-order/:poId")
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
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
poId | string | Yes | The unique slug identifier of the purchase order (returned from the PO creation or search API) |
Code Examples
curl -X GET https://api.pazy.io/v1.0/procurement/purchase-order/po_slug_identifier \
-H "Authorization: Api-Key YOUR_API_KEY"
const response = await fetch('https://api.pazy.io/v1.0/procurement/purchase-order/po_slug_identifier', {
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-order/po_slug_identifier"
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.poId | string | Unique slug identifier for the purchase order |
data.poNumber | string | Purchase order number assigned to the document |
data.state | string | Current state of the PO. Possible values: DRAFTED, PENDING, APPROVED, DECLINED, CLOSED, ARCHIVED |
data.poType | string | Purchase order type. Possible values: GOODS, SERVICES |
data.matchingType | string | Matching type. Possible values: TWO_WAY, THREE_WAY |
data.currency | string | ISO 4217 currency code (e.g., INR) |
data.amount | number | Total purchase order amount |
data.description | string | Short description for the purchase order |
data.poDate | string | Purchase order date (ISO 8601 format, YYYY-MM-DD) |
data.deliveryDate | string | Requested delivery date (ISO 8601 format, YYYY-MM-DD) |
data.termsAndConditions | string | Terms and conditions for the purchase order |
data.additionalNotes | string | Additional notes for delivery or special requirements |
data.paymentTerms | string | Agreed payment terms |
data.vendor | object | Linked vendor information (null if no vendor linked) |
data.vendor.displayName | string | Vendor display name |
data.vendor.legalName | string | Vendor legal name |
data.lineItems | array | List of line items on the purchase order |
data.lineItems[].identifier | string | SKU or identifier for the line item |
data.lineItems[].quantity | number | Quantity requested |
data.lineItems[].rate | number | Unit rate |
data.lineItems[].amount | number | Total amount for this line item (quantity × rate) |
data.matchedInvoices | array | List of invoices matched against this purchase order |
data.matchedInvoices[].invoiceId | string | Unique identifier of the matched invoice |
data.matchedInvoices[].invoiceNumber | string | Invoice number |
data.matchedInvoices[].state | string | Current state of the invoice |
data.matchedInvoices[].amount | number | Invoice amount |
data.matchedInvoices[].currency | string | Invoice currency |
data.matchedInvoices[].invoiceDate | string | Invoice date (ISO 8601 format) |
data.matchedGrns | array | List of Goods Receipt Notes matched against this purchase order |
data.matchedGrns[].grnId | string | Unique identifier of the matched GRN |
data.matchedGrns[].grnNumber | string | GRN number |
data.matchedGrns[].state | string | Current state of the GRN |
data.matchedGrns[].amount | number | GRN total amount |
data.matchedGrns[].totalQuantity | number | Total quantity received in the GRN |
data.matchedGrns[].createdAt | string | Date the GRN was created (ISO 8601 format) |
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": {
"poId": "po_slug_identifier",
"poNumber": "PO-2024-001",
"state": "APPROVED",
"poType": "GOODS",
"matchingType": "THREE_WAY",
"currency": "INR",
"amount": 12500.00,
"description": "Office supplies purchase order",
"poDate": "2024-01-15",
"deliveryDate": "2024-02-15",
"termsAndConditions": "All goods must be delivered in original packaging",
"additionalNotes": "Please deliver during business hours",
"paymentTerms": "Net 30 days",
"vendor": {
"displayName": "ABC Suppliers",
"legalName": "ABC Suppliers Private Limited"
},
"lineItems": [
{
"identifier": "SKU-001",
"quantity": 100,
"rate": 50.00,
"amount": 5000.00
},
{
"identifier": "SKU-002",
"quantity": 50,
"rate": 75.00,
"amount": 3750.00
}
],
"matchedInvoices": [
{
"invoiceId": "invoice_identifier",
"invoiceNumber": "INV-2024-001",
"state": "APPROVED",
"amount": 12500.00,
"currency": "INR",
"invoiceDate": "2024-01-20"
}
],
"matchedGrns": [
{
"grnId": "grn_identifier",
"grnNumber": "GRN-2024-001",
"state": "APPROVED",
"amount": 12500.00,
"totalQuantity": 150,
"createdAt": "2024-01-22T10:30:00Z"
}
]
}
}
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
- Use the
poIdreturned from the Purchase Order Creation API to retrieve details - 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?