Skip to main content

Update Purchase Order

PATCH/purchase-orders/{id}
Agency-scoped keys

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​

NameTypeRequiredDescription
idstringYesPurchase order object id or nanoid

Request Fields​

NameTypeRequiredDescription
referencestringNoUnique trimmed reference within the company
projectsarrayNoProject object ids in one accessible company
valuenumberNoNon-negative finite value
startDatestringNoISO date or timestamp
endDatestringNoISO date or timestamp, on or after startDate
tradeOptionenum(all, specific, tag)Noall applies to all company trades; specific uses trades; tag uses a company trade tag. Omit to keep the current selection
tradesarrayFor specific tradeOptionUse each trade’s id from List Trades, filtered by company; required and non-empty for specific tradeOption
tagstringFor tag tradeOptionUse the tag’s id from Get Company Tags with resourceType=trade; required for tag tradeOption
statusenum(active, inactive)Noactive 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 -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"
}'

Response Fields​

FieldTypeDescription
agencyobject
Show child attributes
  • id string - Agency id
  • name string - Agency name
allTradesbooleanWhether the purchase order applies to all trades
companyobject
Show child attributes
  • id string - Company id
  • name string - Company name
createdAtstringCreation timestamp
endDatestringPurchase order end date
idstringPurchase order id
projectsarray[object]
Show child attributes
  • id string - Project id
  • name string - Project name
referencestringPurchase order reference
reinstatedobjectOnly included when the purchase order has been reinstated.
Show child attributes
  • user object - User reference with id and name
  • date string - Reinstatement timestamp
revokedobjectOnly included when the purchase order has been revoked.
Show child attributes
  • user object - User reference with id and name
  • date string - Revocation timestamp
siteobject
Show child attributes
  • id string - Site id
  • name string - Site name
startDatestringPurchase order start date
statusstringPossible values: active, inactive (revoked), or expired
tagobjectOnly included when a tag is set.
Show child attributes
  • id string - Tag id
  • name string - Tag name
tradeOptionstringTrade selection mode
tradesarray[object]
Show child attributes
  • id string - Trade id
  • name string - Trade name
updatedAtstringLast update timestamp
valuenumberPurchase 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 StatusDescription
400Invalid fields, no effective changes, or linked-assignment restrictions
401Missing, invalid, revoked or expired API key
403Missing scope or agency-scoped key
404Purchase order or related resource not found in the accessible company
429Rate limit exceeded
500Unexpected internal error