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
| Field | Type | Required | Description |
|---|
| name | string | Optional | |
| description | string | Optional | |
| resources | AddProcurementRequestResource[] | Optional | |
| groups | AddProcurementRequestGroup[] | Optional | |
| departmentId | uuid | Optional | |
AddProcurementRequestResource
| Field | Type | Description |
|---|
| resourceTypeId | uuid | |
| quantity | number | |
| areaId | uuid| null | |
| groupIndex | integer| null | |
| attributeValues | AddProcurementRequestAttributeValue[]| null | |
| requestIds | uuid[]| null | |
| owner | uuid| null | |
| scheduleBlocks | AddProcurementRequestBlock[]| null | |
AddProcurementRequestGroup
| Field | Type | Description |
|---|
| name | string| null | |
| notes | string| null | |
AddProcurementRequestAttributeValue
| Field | Type | Description |
|---|
| resourceAttributeId | uuid | |
| value | JsonElement| null | |
AddProcurementRequestBlock
| Field | Type | Description |
|---|
| typeId | uuid | |
| name | string| null | |
| startDateTime | date-time | |
| endDateTime | date-time | |
| notes | string| null | |
Response
Type: uuid