Skip to main content
Purchase Order Details API
curl --request GET \
  --url https://api.pazy.io/v1.0/procurement/purchase-order/:poId

Authentication

All requests require an API key in the request headers. Headers:
Authorization: Api-Key YOUR_API_KEY

Request

Path Parameters

ParameterTypeRequiredDescription
poIdstringYesThe 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"

Success Response

HTTP Status: 200 OK Response Fields:
FieldTypeDescription
okbooleanIndicates whether the request was successful
dataobjectContains the purchase order details
data.poIdstringUnique slug identifier for the purchase order
data.poNumberstringPurchase order number assigned to the document
data.statestringCurrent state of the PO. Possible values: DRAFTED, PENDING, APPROVED, DECLINED, CLOSED, ARCHIVED
data.poTypestringPurchase order type. Possible values: GOODS, SERVICES
data.matchingTypestringMatching type. Possible values: TWO_WAY, THREE_WAY
data.currencystringISO 4217 currency code (e.g., INR)
data.amountnumberTotal purchase order amount
data.descriptionstringShort description for the purchase order
data.poDatestringPurchase order date (ISO 8601 format, YYYY-MM-DD)
data.deliveryDatestringRequested delivery date (ISO 8601 format, YYYY-MM-DD)
data.termsAndConditionsstringTerms and conditions for the purchase order
data.additionalNotesstringAdditional notes for delivery or special requirements
data.paymentTermsstringAgreed payment terms
data.vendorobjectLinked vendor information (null if no vendor linked)
data.vendor.displayNamestringVendor display name
data.vendor.legalNamestringVendor legal name
data.lineItemsarrayList of line items on the purchase order
data.lineItems[].identifierstringSKU or identifier for the line item
data.lineItems[].quantitynumberQuantity requested
data.lineItems[].ratenumberUnit rate
data.lineItems[].amountnumberTotal amount for this line item (quantity × rate)
data.matchedInvoicesarrayList of invoices matched against this purchase order
data.matchedInvoices[].invoiceIdstringUnique identifier of the matched invoice
data.matchedInvoices[].invoiceNumberstringInvoice number
data.matchedInvoices[].statestringCurrent state of the invoice
data.matchedInvoices[].amountnumberInvoice amount
data.matchedInvoices[].currencystringInvoice currency
data.matchedInvoices[].invoiceDatestringInvoice date (ISO 8601 format)
data.matchedGrnsarrayList of Goods Receipt Notes matched against this purchase order
data.matchedGrns[].grnIdstringUnique identifier of the matched GRN
data.matchedGrns[].grnNumberstringGRN number
data.matchedGrns[].statestringCurrent state of the GRN
data.matchedGrns[].amountnumberGRN total amount
data.matchedGrns[].totalQuantitynumberTotal quantity received in the GRN
data.matchedGrns[].createdAtstringDate the GRN was created (ISO 8601 format)

PO State Values

ValueDescription
DRAFTEDPO is in draft state and can be edited
PENDINGPO is pending approval
APPROVEDPO has been approved
DECLINEDPO was declined and can be edited
CLOSEDPO has been closed
ARCHIVEDPO 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 poId returned from the Purchase Order Creation API to retrieve details
  • The matchedInvoices array is populated when invoices are linked to the PO (TWO_WAY or THREE_WAY matching)
  • The matchedGrns array is populated only for THREE_WAY matching POs
  • Check state to understand where the PO is in the approval workflow before taking further actions