Purchase Order Search API
curl --request GET \
--url https://api.pazy.io/v1.0/procurement/purchase-order/searchimport requests
url = "https://api.pazy.io/v1.0/procurement/purchase-order/search"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.pazy.io/v1.0/procurement/purchase-order/search', 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/search",
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/search"
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/search")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pazy.io/v1.0/procurement/purchase-order/search")
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 Search API
Search purchase orders by PO number or vendor. Returns up to 20 matching results.
Purchase Order Search API
curl --request GET \
--url https://api.pazy.io/v1.0/procurement/purchase-order/searchimport requests
url = "https://api.pazy.io/v1.0/procurement/purchase-order/search"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.pazy.io/v1.0/procurement/purchase-order/search', 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/search",
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/search"
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/search")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pazy.io/v1.0/procurement/purchase-order/search")
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
At least one ofpoNumber or vendorId must be provided.
| Parameter | Type | Required | Description |
|---|---|---|---|
poNumber | string | No | Partial or full PO number to search for (case-insensitive) |
vendorId | string | No | Exact vendor slug identifier to filter by |
Code Examples
# Search by PO number
curl -X GET "https://api.pazy.io/v1.0/procurement/purchase-order/search?poNumber=PO-2024" \
-H "Authorization: Api-Key YOUR_API_KEY"
# Search by vendor
curl -X GET "https://api.pazy.io/v1.0/procurement/purchase-order/search?vendorId=vendor_identifier" \
-H "Authorization: Api-Key YOUR_API_KEY"
# Search with both filters
curl -X GET "https://api.pazy.io/v1.0/procurement/purchase-order/search?poNumber=PO-2024&vendorId=vendor_identifier" \
-H "Authorization: Api-Key YOUR_API_KEY"
// Search by PO number
const params = new URLSearchParams({ poNumber: 'PO-2024' });
const response = await fetch(`https://api.pazy.io/v1.0/procurement/purchase-order/search?${params}`, {
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/search"
headers = {
"Authorization": "Api-Key YOUR_API_KEY"
}
# Search by PO number
params = { "poNumber": "PO-2024" }
response = requests.get(url, headers=headers, params=params)
result = response.json()
Success Response
HTTP Status:200 OK
Returns up to 20 purchase orders matching the search criteria, ordered by creation date (newest first). Archived POs are excluded from results.
Response Fields:
| Field | Type | Description |
|---|---|---|
ok | boolean | Indicates whether the request was successful |
data | object | Contains the search results |
data.purchaseOrders | array | List of matching purchase orders |
data.purchaseOrders[].poId | string | Unique slug identifier for the purchase order |
data.purchaseOrders[].poNumber | string | Purchase order number |
data.purchaseOrders[].state | string | Current state of the PO |
data.purchaseOrders[].amount | number | Total purchase order amount |
data.purchaseOrders[].currency | string | Currency code (e.g., INR) |
data.purchaseOrders[].poDate | string | Purchase order date (ISO 8601 format) |
data.purchaseOrders[].vendor | object | Linked vendor information (null if no vendor linked) |
data.purchaseOrders[].vendor.vendorId | string | Unique slug identifier of the vendor |
data.purchaseOrders[].vendor.name | string | Vendor display name |
Response Example
{
"ok": true,
"data": {
"purchaseOrders": [
{
"poId": "po_slug_identifier",
"poNumber": "PO-2024-001",
"state": "APPROVED",
"amount": 12500.00,
"currency": "INR",
"poDate": "2024-01-15",
"vendor": {
"vendorId": "vendor_identifier",
"name": "ABC Suppliers"
}
},
{
"poId": "po_slug_identifier_2",
"poNumber": "PO-2024-002",
"state": "DRAFTED",
"amount": 8000.00,
"currency": "INR",
"poDate": "2024-01-20",
"vendor": null
}
]
}
}
Empty Results
If no purchase orders match the search criteria, an empty array is returned:{
"ok": true,
"data": {
"purchaseOrders": []
}
}
Error Responses
Missing Search Parameters
HTTP Status:400 Bad Request
{
"ok": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "At least one of poNumber or vendorId is required"
}
}
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
- Provide at least one of
poNumberorvendorId— the API returns a400if neither is supplied poNumbersupports partial matching (e.g., searchingPO-2024will matchPO-2024-001,PO-2024-002, etc.)vendorIdrequires an exact match — use the vendor slug returned from the Vendor Creation API or Vendor Search API- Results are capped at 20 and sorted newest first — use more specific search terms to narrow results
- Archived POs are excluded from search results
Was this page helpful?