Skip to main content
Purchase Order Creation API

Authentication

All requests require an API key in the request headers. Headers:

Request

Content-Type: application/json

Body Parameters

Fields Required for Active State (when state: "ACTIVE")

When state: "ACTIVE" is passed, the following fields must be present in addition to the schema-required fields for the PO to be activated: If any of the above are missing, the PO is still created in draft state and submitWarnings in the response identifies exactly which fields were absent.

Line Items Object

Each item in the lineItems array must contain the following fields:
GST on line items: Provide taxId to apply GST to a line item. When taxAmount is provided, it must match the calculated tax for that line item or the request returns a 400 error. Line items without taxId are unaffected.
SKU matching (THREE_WAY): When matchingType is THREE_WAY, every line item must include either skuCode or skuName, and it must resolve to an existing SKU in your inventory. If any line item is missing both fields, or if the provided code/name cannot be matched, the request is rejected with a 400 error and the purchase order is not created. See Bulk SKU Creation to pre-populate your inventory.

Custom Fields

Custom fields use their organization-configured slugs. The value type is resolved from the configured field; dropdown values are organization tag IDs, date values use YYYY-MM-DD, and numeric values are sent as numbers. The same tags object can be included on a line item for line-level custom fields. To get the slugs and field types available to your organization, call the Tag List API and use each data.tags[].id value as the key in tags. For dropdown fields, use the Tag Detail API with that slug to retrieve valid option IDs.

PO Type Values

The poType field accepts the following values:
  • GOODS: Purchase order for physical goods or products
  • SERVICES: Purchase order for services

Matching Type Values

The matchingType field accepts the following values:
  • TWO_WAY: Purchase order matching based on purchase order and invoice (2-way match)
  • THREE_WAY: Purchase order matching based on purchase order, invoice, and goods receipt note (3-way match)

Tags and Custom Fields

Tags can be applied both at the PO level (tags in the request body) and at the line-item level (tags inside each lineItems entry). In both cases tags is an object that maps a tag slug to a { value } object:
To discover the available tag slugs, their types, and (for DROPDOWN tags) the valid value ids, see the tag APIs: the Tag List API, and Tag Detail API.
The value you send depends on the tag’s type:

Code Examples

Success Response

HTTP Status: 200 OK Response Fields:

skuMatchWarnings Object

submitWarnings Object

Response Example — draft (no state field or state: "DRAFTED")

Response Example — active (state: "ACTIVE", all fields present)

Response Example — draft despite state: "ACTIVE" (fields missing)

Response Example — state: "ACTIVE" with SKU warnings

Error Responses

Missing Required Fields

HTTP Status: 400 Bad Request

Invalid Procurement Type

HTTP Status: 400 Bad Request

Invalid Matching Type

HTTP Status: 400 Bad Request

Invalid Date

HTTP Status: 400 Bad Request

Invalid Expected Delivery Date

HTTP Status: 400 Bad Request

SKU Required (THREE_WAY match)

HTTP Status: 400 Bad Request

SKU Not Found (THREE_WAY match)

HTTP Status: 400 Bad Request

Invalid Tax ID

HTTP Status: 400 Bad Request

Invalid Tax Amount

HTTP Status: 400 Bad Request

Invalid Line Items

HTTP Status: 400 Bad Request
HTTP Status: 400 Bad Request
HTTP Status: 400 Bad Request

Invalid Currency

HTTP Status: 400 Bad Request

Invalid Description Length

HTTP Status: 400 Bad Request

Vendor Not Found

HTTP Status: 404 Not Found

Invalid GSTIN

HTTP Status: 400 Bad Request

Invalid State

HTTP Status: 400 Bad Request

Authentication Errors

HTTP Status: 401 Unauthorized

Permission Errors

HTTP Status: 403 Forbidden

Purchase Order Creation Errors

HTTP Status: 500 Internal Server Error

Internal Error

HTTP Status: 500 Internal Server Error

Best Practices

Purchase Order Creation

  • Ensure all required fields (poNumber, lineItems, poType, matchingType, poDate) are provided
  • Use ISO 8601 date format (YYYY-MM-DD) for all date fields
  • Provide at least one line item with valid quantity, rate, and identifier values
  • Use INR for the currency field (only INR is currently supported)
  • Choose the appropriate matchingType based on your procurement process:
    • Use TWO_WAY for simpler matching between PO and invoice
    • Use THREE_WAY when goods receipt verification is required
  • Link the purchase order to a vendor using vendorId if available
  • Include gstin for tax compliance in Indian markets
  • Keep description concise (max 255 characters) for better readability
  • Use termsAndConditions to specify important contractual terms
  • Add additionalNotes for delivery instructions or special requirements

Activating a PO on Creation

Pass state: "ACTIVE" when the PO is complete and ready to be activated immediately:
  • The response state will be ACTIVE if all required fields are present, or DRAFTED if anything was missing
  • Check submitWarnings in the response — it lists exactly which PO-level or line item fields prevented activation
  • A PO created in DRAFTED state can be activated later by calling the update API with state: "ACTIVE"
  • Omitting state (or passing state: "DRAFTED") always creates in draft, regardless of what fields are present

Line Items

  • Ensure each line item has a unique identifier
  • Use positive numbers for quantity and rate