Update an existing purchase order by its identifier. Only POs in DRAFTED or DECLINED state can be updated.
application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
poId | string | Yes | The unique slug identifier of the purchase order to update (returned from the PO creation or search API) |
| Parameter | Type | Required | Description |
|---|---|---|---|
poNumber | string | No | Purchase order number (minimum 1 character) |
lineItems | array | No | List of line items. Replaces all existing line items if provided (minimum 1 item) |
poType | string | No | Purchase order type. Valid values: GOODS, SERVICES |
matchingType | string | No | Matching type. Valid values: TWO_WAY, THREE_WAY |
poDate | string | No | Purchase order date in ISO-8601 format (YYYY-MM-DD) |
vendorId | string | No | Slug identifier of the vendor to link to the PO |
description | string | No | Short description for the purchase order (1-255 characters) |
currency | string | No | ISO 4217 currency code (3 characters, e.g., INR) |
paymentTerms | string | No | Free form outline of the agreed payment terms |
deliveryDate | string | No | Requested delivery date in ISO-8601 format (YYYY-MM-DD) |
termsAndConditions | string | No | Terms and conditions for the purchase order |
additionalNotes | string | No | Additional notes for delivery or special requirements |
state | string | No | Target state: DRAFTED or ACTIVE. When ACTIVE is requested the API validates required fields (merging body with what is already on the PO). If all required fields are present the PO is activated; otherwise it stays in DRAFTED and the response includes submitWarnings. |
lineItems array must contain:
| Parameter | Type | Required | Description |
|---|---|---|---|
quantity | number | Yes | Quantity requested for the line item |
rate | number | Yes | Unit rate to be applied to the line item |
identifier | string | Yes | Free-text label for the line item (minimum 1 character) |
skuCode | string | Required for THREE_WAY | Item code of an existing SKU in your inventory. Takes priority over skuName |
skuName | string | Required for THREE_WAY | Name of an existing SKU in your inventory (used when skuCode is not provided) |
SKU matching (THREE_WAY): When the PO usesTHREE_WAYmatching andlineItemsare included in the update, every line item must provideskuCodeorskuName, 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 a400error and the PO is not updated.
| State | Description |
|---|---|
DRAFTED | PO is in draft — editable |
DECLINED | PO was declined and returned for revision — editable |
PENDING, APPROVED, CLOSED, ARCHIVED) will return a 400 error.
200 OK
Response Fields:
| Field | Type | Description |
|---|---|---|
ok | boolean | Indicates whether the request was successful |
data | object | Contains the update response data |
data.poId | string | Unique slug identifier of the updated purchase order |
data.state | string | Present when state was requested. ACTIVE if activation succeeded, DRAFTED if it fell back |
data.skuMatchWarnings | array | Present when one or more line items could not be matched to a SKU |
data.submitWarnings | object | Present when state: ACTIVE was requested but required fields were missing |
submitWarnings Object| Field | Type | Description |
|---|---|---|
po | array of strings | PO-level fields that were missing (e.g. "vendorId", "paymentTerms") |
lineItems | object | Map of line item identifier to missing fields (e.g. "quantity", "rate") |
state: "ACTIVE", all fields present)state: "ACTIVE", fields missing)400 Bad Request
400 Bad Request
404 Not Found
400 Bad Request
400 Bad Request
400 Bad Request
400 Bad Request
400 Bad Request
404 Not Found
401 Unauthorized
403 Forbidden
500 Internal Server Error
DRAFTED or DECLINED state can be updated. Check the PO state first using the Purchase Order Details APIlineItems, the entire list of line items will be replaced; ensure you include all intended line items in the requestpoId returned from the Purchase Order Creation API or Purchase Order Search API to obtain the identifierstate: "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 checksubmitWarnings in the response when state: "ACTIVE" is sent — it identifies any remaining missing fields that prevented activation