# Check a shift before adding it to the cart

Asks whether you can take this shift, given the shifts already in your cart.
Nothing is applied for and nothing is stored - this is the check the portal runs as
a shift goes into the cart, so that a shift you cannot take is refused there rather
than at the end.
A 200 with an empty body means yes. A refusal is a 422 whose `errors` names the
shift and says why: the shift is full, its applications are not open, it clashes
with something else in the cart, or you already hold a place on it.
Send the cart's other shifts in `cartItems` so clashes between them and this one
are caught. They are checked against this shift but are not themselves re-checked.
Applying for the shifts once the cart is settled is a separate call - see
apply to many shifts.

Endpoint: POST /api/v2/event/{event_id}/shift/{shift_id}/add-to-cart
Version: 2.0.0
Security: default

## Path parameters:

  - `event_id` (integer, required)
    The ID of the event.

  - `shift_id` (integer, required)
    The ID of the shift being added.

## Header parameters:

  - `Rosterfy-Platform` (string)

## Request fields (application/json):

  - `cartItems` (array)
    The shifts already in the cart, so they are taken into account when checking whether this one can be added. Unpublished shifts and shifts outside the account are dropped from the list. The name is camelCase because that is what the endpoint reads.

  - `asLeader` (boolean)
    Check whether the person can take this shift as its leader rather than as an ordinary place. The name is camelCase because that is what the endpoint reads.

## Response 422 fields (application/json):

  - `message` (string)

  - `errors` (array)

  - `errors.event_shift_id` (integer)

  - `errors.message` (string)

