Docs

Create Procurement

POST /procurements

POST/procurements

Creates a procurement, optionally with groups and needs in the same call; a need references a group by its index in the groups list. Returns the new procurement's id. To add a need to an existing procurement, use Procurements_AddProcurementResource. Resource type ids come from ResourceTypes_Get and area ids from Events_GetAreas. Attribute values are for attributes placed on the type and active on Procurement; a Select value is the option id. A need's requestIds (from Advances_GetAdvanceRequests) are linked to it in the same write; each must be an approved resource request, and one that is not refuses the whole create. With an org token (resource inventory edit) it creates an organization-level procurement: departmentId names the requesting department, at least one need is required, and each need may carry an owner and scheduleBlocks (its plan). Groups, areaId and requestIds are event-only.

Request Body

FieldTypeRequiredDescription
namestringOptional
descriptionstringOptional
resourcesAddProcurementRequestResource[]Optional
groupsAddProcurementRequestGroup[]Optional
departmentIduuidOptional

AddProcurementRequestResource

FieldTypeDescription
resourceTypeIduuid
quantitynumber
areaIduuid| null
groupIndexinteger| null
attributeValuesAddProcurementRequestAttributeValue[]| null
requestIdsuuid[]| null
owneruuid| null
scheduleBlocksAddProcurementRequestBlock[]| null

AddProcurementRequestGroup

FieldTypeDescription
namestring| null
notesstring| null

AddProcurementRequestAttributeValue

FieldTypeDescription
resourceAttributeIduuid
valueJsonElement| null

AddProcurementRequestBlock

FieldTypeDescription
typeIduuid
namestring| null
startDateTimedate-time
endDateTimedate-time
notesstring| null

Response

Type: uuid