# Add an item to an allocation rule

Adds a catalogue item to the list a rule hands out, so that everyone who meets
the rule's condition receives it. A rule can hand out several different items;
add each one separately.
Adding an item does not give it to anyone who already qualified - the list is
read each time the rule runs, so it applies from here on.
When the rule does run, an item is quietly skipped for that person if there is
not enough of it left or if giving it would take them over the limit the item
sets per person. The rest of the list is still handed out, so check what people
actually hold rather than assuming everything on the list was given.
**The created line comes back with only the fields that were set on it**, so
`valid_duration` is absent rather than null when it was not sent.

Endpoint: POST /api/v2/inventory/allocation/{allocation_id}/item
Version: 2.0.0
Security: default

## Path parameters:

  - `allocation_id` (integer, required)
    The ID of the allocation rule.

## Header parameters:

  - `Rosterfy-Platform` (string)

## Request fields (application/json):

  - `inventory_item_id` (integer, required)
    The ID of the catalogue item to give out.

  - `quantity` (integer, required)
    How many of the item each qualifying person receives, as a whole number of 1 or more. Each one is allocated separately, so a quantity of 3 produces three allocations.

  - `valid_duration` (integer)
    How long the allocation stays valid, in seconds, counted from the moment it is granted. Leave it unset for an allocation that does not expire.

## Response 201 fields (application/json):

  - `object` (object)

  - `object.id` (integer)

  - `object.inventory_item_id` (integer)

  - `object.quantity` (integer)

  - `object.valid_duration` (integer)

  - `object.created_at` (string)

  - `object.updated_at` (string)

  - `nice` (array)

  - `relations` (array)

  - `permissions` (object)

  - `permissions.read` (boolean)

  - `permissions.update` (boolean)

  - `permissions.delete` (boolean)

