Skip to main content

Create Purchase Order

POST/purchase-orders
Agency-scoped keys

This endpoint is not available for agency-scoped API keys.

Summary​

Requires write:purchase-orders. Creates an active purchase order for projects belonging to one company attached to the key. The company is inferred from the projects.

Set massLink to true to link matching existing assignments currently without a PO. Matching uses company, projects, agency, site and trade applicability, excludes cancelled assignments and assignments with an invoice, and does not replace an existing PO. A tag matching no trades links no assignments. The default is false.

Request Fields​

NameTypeRequiredDescription
referencestringYesUnique trimmed reference within the company
projectsarrayYesProject object ids in one accessible company
agencystringYesUse agency.id from List Connected Agencies for the company; creation only
sitestringNoSite object id in the single selected project, or null for all sites; creation only
valuenumberYesNon-negative finite value
startDatestringYesISO date or timestamp
endDatestringYesISO date or timestamp, on or after startDate
massLinkbooleanNoLink matching existing assignments without a PO or invoice, excluding cancelled assignments; creation only
tradeOptionstringNoall, specific or tag; defaults to all on creation
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

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 POST 'https://api.requidex.com/api/open/v1/purchase-orders' \
-H 'Authorization: Bearer <API_KEY>' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"reference": "PO-44321",
"projects": [
"67bc36db80a1616ec3f47011"
],
"agency": "67bc36db80a1616ec3f47060",
"value": 150000,
"startDate": "2026-01-01",
"endDate": "2026-12-31T22:00:00Z",
"massLink": false,
"tradeOption": "all"
}'

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
siteobject
Show child attributes
  • id string - Site id
  • name string - Site name
startDatestringPurchase order start date
statusstringPossible values: active, inactive (revoked), or expired; always active on creation
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": "active",
"reference": "PO-44321",
"startDate": "2026-01-01T00:00:00.000Z",
"endDate": "2026-12-31T22:00:00.000Z",
"value": 150000,
"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",
"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