Skip to main content
Purchase Order Update API

Authentication

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

Request

Content-Type: application/json

Path Parameters

Body Parameters

All body fields are optional. Only the fields you provide will be updated.

Line Items Object

Each item in the lineItems array must contain:
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 the PO uses THREE_WAY matching and lineItems are included in the update, every line item must provide skuCode or skuName, and it must resolve to an existing SKU. If any line item is missing both fields or cannot be matched, the request is rejected with a 400 error and the PO is not updated.

Custom Fields

Custom fields use their organization-configured slugs. Dropdown values are organization tag IDs, date values use YYYY-MM-DD, and numeric values are sent as numbers. Include tags on a line item to set line-level custom fields. When lineItems is supplied, it replaces the existing line-item set together with its 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.

Editable States

A purchase order can only be updated when it is in one of the following states: Attempting to update a PO in any other state (PENDING, APPROVED, CLOSED, ARCHIVED) will return a 400 error.

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:

submitWarnings Object

Response Example — update only (no state change)

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

Response Example — fell back to draft (state: "ACTIVE", fields missing)

Error Responses

SKU Required (THREE_WAY match)

HTTP Status: 400 Bad Request

SKU Not Found (THREE_WAY match)

HTTP Status: 400 Bad Request

Purchase Order Not Found

HTTP Status: 404 Not Found

Invalid State

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 Currency

HTTP Status: 400 Bad Request

Vendor 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

  • Only POs in DRAFTED or DECLINED state can be updated. Check the PO state first using the Purchase Order Details API
  • All body fields are optional — send only the fields you want to change
  • If you provide lineItems, the entire list of line items will be replaced; ensure you include all intended line items in the request
  • Use the poId returned from the Purchase Order Creation API or Purchase Order Search API to obtain the identifier
  • Use ISO 8601 date format (YYYY-MM-DD) for all date fields
  • Pass state: "ACTIVE" to activate a draft PO in the same request as your field updates. Validation merges the body with what is already stored, so you only need to send the fields that are changing — already-set fields on the PO count toward the activation check
  • Check submitWarnings in the response when state: "ACTIVE" is sent — it identifies any remaining missing fields that prevented activation
  • Tags can be set both on the PO (tags in the body) and on individual line items (tags inside each lineItems entry). Use the tag APIs to look up valid tag slugs, types, and dropdown value ids before sending them