Update Purchase Order
/purchase-orders/{id}This endpoint is not available for agency-scoped API keys.
Summary
Requires write:purchase-orders. Updates a purchase order by object id or nanoid. Omitted fields retain their existing values. Agency, site and company cannot be changed.
Projects and trades used by linked assignments cannot be removed. Changing trade selection or tag cannot exclude trades used by linked assignments. Reference changes also update linked assignments and timesheets. References must remain unique within the company.
Set status to inactive to revoke the PO and remove it from pending assignments. Set status to active to reinstate it; previously unlinked assignments are not automatically relinked. Updating the end date recalculates expiry for a PO that is not revoked. An explicit status is applied after date changes. Fields and status are saved together. A request with no effective changes returns 400.
URL Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Purchase order object id or nanoid |
Request Fields
| Name | Type | Required | Description |
|---|---|---|---|
| reference | string | No | Unique trimmed reference within the company |
| projects | array | No | Project object ids in one accessible company |
| value | number | No | Non-negative finite value |
| startDate | string | No | ISO date or timestamp |
| endDate | string | No | ISO date or timestamp, on or after startDate |
| tradeOption | enum(all, specific, tag) | No | all applies to all company trades; specific uses trades; tag uses a company trade tag. Omit to keep the current selection |
| trades | array | For specific tradeOption | Use each trade’s id from List Trades, filtered by company; required and non-empty for specific tradeOption |
| tag | string | For tag tradeOption | Use the tag’s id from Get Company Tags with resourceType=trade; required for tag tradeOption |
| status | enum(active, inactive) | No | active reinstates the PO; inactive revokes it and unlinks pending assignments |
Related-resource identifiers must be object ids. Dates accept ISO date-only strings (midnight UTC) or timestamps with a timezone. Choose the end timestamp to cover the intended final day. Currency is always set to the company default and cannot be supplied in the request.
Request Example
- cURL
- JavaScript
- Python
- Go
curl -X PATCH 'https://api.requidex.com/api/open/v1/purchase-orders/{id}' \
-H 'Authorization: Bearer <API_KEY>' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"value": 175000,
"status": "inactive"
}'
const response = await fetch(
"https://api.requidex.com/api/open/v1/purchase-orders/{id}",
{
method: "PATCH",
headers: {
Authorization: "Bearer <API_KEY>",
Accept: "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({
value: 175000,
status: "inactive",
}),
},
);
const json = await response.json();
import requests
response = requests.patch(
'https://api.requidex.com/api/open/v1/purchase-orders/{id}',
headers={
'Authorization': 'Bearer <API_KEY>',
'Accept': 'application/json',
},
json={'value': 175000, 'status': 'inactive'},
timeout=30,
)
print(response.json())
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{
"value": 175000,
"status": "inactive"
}`)
req, err := http.NewRequest("PATCH", "https://api.requidex.com/api/open/v1/purchase-orders/{id}", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer <API_KEY>")
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
payload, err := io.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(string(payload))
}
Response Fields
| Field | Type | Description |
|---|---|---|
| agency | object | Show child attributes
|
| allTrades | boolean | Whether the purchase order applies to all trades |
| company | object | Show child attributes
|
| createdAt | string | Creation timestamp |
| endDate | string | Purchase order end date |
| id | string | Purchase order id |
| projects | array[object] | Show child attributes
|
| reference | string | Purchase order reference |
| reinstated | object | Only included when the purchase order has been reinstated. Show child attributes
|
| revoked | object | Only included when the purchase order has been revoked. Show child attributes
|
| site | object | Show child attributes
|
| startDate | string | Purchase order start date |
| status | string | Possible values: active, inactive (revoked), or expired |
| tag | object | Only included when a tag is set. Show child attributes
|
| tradeOption | string | Trade selection mode |
| trades | array[object] | Show child attributes
|
| updatedAt | string | Last update timestamp |
| value | number | Purchase order value |
Response Example (200)
{
"success": true,
"data": {
"id": "67bc36db80a1616ec3f48001",
"status": "inactive",
"reference": "PO-44321",
"startDate": "2026-01-01T00:00:00.000Z",
"endDate": "2026-12-31T22:00:00.000Z",
"value": 175000,
"company": {
"id": "67bc36db80a1616ec3f47001",
"name": "Requidex Construction Ltd"
},
"projects": [
{
"id": "67bc36db80a1616ec3f47011",
"name": "Project Alpha"
}
],
"site": null,
"agency": {
"id": "67bc36db80a1616ec3f47060",
"name": "Agency One"
},
"trades": [],
"allTrades": true,
"tradeOption": "all",
"revoked": {
"user": {
"id": "67bc36db80a1616ec3f49998",
"name": "Alex Carter"
},
"date": "2026-02-01T10:00:00.000Z"
},
"createdAt": "2026-01-10T12:00:00.000Z",
"updatedAt": "2026-02-20T14:03:12.111Z"
}
}
Errors
| HTTP Status | Description |
|---|---|
| 400 | Invalid fields, no effective changes, or linked-assignment restrictions |
| 401 | Missing, invalid, revoked or expired API key |
| 403 | Missing scope or agency-scoped key |
| 404 | Purchase order or related resource not found in the accessible company |
| 429 | Rate limit exceeded |
| 500 | Unexpected internal error |