Purchase Order List API
Purchase Order APIs
Purchase Order List API
Retrieve list of a purchase order including vendor, line items, matched invoices, and GRNs
Purchase Order List API
Documentation Index
Fetch the complete documentation index at: https://docs.pazy.io/llms.txt
Use this file to discover all available pages before exploring further.
Authentication
All requests require an API key in the request headers. Headers:Request
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
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
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
Error Responses
Purchase Order Not Found
HTTP Status:404 Not Found
Authentication Errors
HTTP Status:401 Unauthorized
Permission Errors
HTTP Status:403 Forbidden
Internal Error
HTTP Status:500 Internal Server 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