Docs

Add Resource

POST /procurements/{procurementId}/resources

POST/procurements/{procurementId}/resources

Required Tokens

FieldTypeRequiredDescription
BearerAuthorization: Bearer <api-key>OptionalYour API key. Pass it as the Bearer token on every request.
Event tokenx-Event-TokenOptionalRun **Get Tokens** in the Authorization folder, or call `GET /Events/{eventId}/authorize` manually.

Adds a need to a procurement. Required Variant-role attribute values must be present.

Event scoping: This endpoint does not include {eventId} in the URL. The event is determined automatically from your x-Event-Token.

Path Parameters

FieldTypeRequiredDescription
procurementIdGuidRequiredThe procurement.

Request Body

FieldTypeRequiredDescription
resourceTypeIdGuidRequiredThe resource type.
quantitydecimalRequiredQuantity. A composite's must be a whole number of at least 1.
areaIdGuid?OptionalArea context (non-scheduled needs).
collaboratorIdGuid?OptionalCollaborator context (non-scheduled needs).
rateCardIdGuid?OptionalOne of the type's own cards.
ruleSetIdsGuid[]OptionalRule sets governing the need. `[]` for none.
groupIdGuid?OptionalA group on this procurement.
ownerGuid?OptionalOwning department. Omitted seeds from the type's `defaultOwner`.
attributeValuesarrayOptional`{ resourceAttributeId, value }`: values for attributes placed on the type and active on Procurement. A `Select` value is the option id.

Composite types

A resource type whose trackingType is Composite fans out: the need is created as the composite parent, plus one component need per slot the parent's inferred variant keeps. Each component need's quantity is the parent's quantity times the slot's quantity, and it is born with no schedule blocks. rateCardId and ruleSetIds apply to the parent only.

Response

201 Created with this body for every need. children is empty unless the type is a composite.

{
	"id": "<parent need id>",
	"children": [
		{
			"id": "<component need id>",
			"componentId": "<slot id>",
			"componentLabel": "Driver",
			"resourceTypeId": "<target type id>",
			"quantity": 2,
			"allowedResourceVariantIds": []
		}
	]
}

Response Fields

FieldTypeDescription
idGuidThe new need (the composite parent, for a composite).
childrenarrayOne per component need created by the fan-out.
children[].idGuidThe component need.
children[].componentIdGuidThe composite's slot it fills.
children[].componentLabelstringThe slot's label.
children[].resourceTypeIdGuidThe slot's effective target type.
children[].quantitydecimalParent quantity times the slot's quantity.
children[].allowedResourceVariantIdsGuid[]Empty = any, one = pinned, several = alternatives (the first is seeded).

Error Codes

HTTP StatusDescription
400A missing required variant value, a composite with a fractional or zero quantity, or a composite type with no components.
404Procurement or resource type not found.