> ## Documentation Index
> Fetch the complete documentation index at: https://product-discovery.developer.voyado.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Add To Cart

> The add-to-cart notification is to be sent with a ticket when a visitor adds an Elevate variant to their cart.

The add-to-cart notification is to be sent with a ticket when a visitor adds an Elevate variant to their cart. The ticket is a unique string for an object generated by Elevate.

```http theme={null}
POST https://{cluster-id}.elevate-api.cloud/api/storefront/v3/notifications/add-to-cart
```

## Request

<AccordionGroup>
  <Accordion title="Request header parameters">
    | Name              | Description                                   | Example |
    | ----------------- | --------------------------------------------- | ------- |
    | `Accept-Encoding` | Allows responses to be compressed using Gzip. | `gzip`  |
  </Accordion>

  <Accordion title="Request query parameters">
    | Name            | Description                                                                                                                                                                                                                                                                                                                                                                                    | Example                                |
    | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- |
    | `customerKey`\* | A key that uniquely identifies the current visitor.<br />Using <a href="https://en.wikipedia.org/wiki/Universally_unique_identifier">UUIDs</a> as keys are recommended<br />This field is **required** unless `userContext` is set to `ANONYMOUS` or `UNPERSONALIZED` in which case it is not allowed.<br />If `userContext` is set to 'SYNTHETIC' this is optional.                           | `e3921377-18a2-47c9-a449-06b894898623` |
    | `market`\*      | Must match the corresponding market identifier in the <a href="https://docs.elevate.voyado.cloud/elevate/4/integration/essentials/markets-and-locales/#markets">data feed</a>.                                                                                                                                                                                                                 | `UK`                                   |
    | `sessionKey`\*  | A unique key, identifying the session.<br />Using <a href="https://en.wikipedia.org/wiki/Universally_unique_identifier">UUIDs</a> as keys are recommended.<br />This field is **required** unless `userContext` is set to `ANONYMOUS` in which case it is not allowed.<br />If `userContext` is set to `SYNTHETIC` this is optional.                                                           | `0b05119e-eeb8-418a-bbfb-defa0dde417e` |
    | `userContext`   | Specifies the level of consent for data tracking. If omitted, the request will be treated as if PERSONALIZED is used.<br /><br />See <a href="https://docs.elevate.voyado.cloud/elevate/4/integration/site-integration/query-integration/query-parameters/#user-context">user context</a> for more details.<br />Supported values: `PERSONALIZED`, `UNPERSONALIZED`, `ANONYMOUS`, `SYNTHETIC`. | `PERSONALIZED`                         |
  </Accordion>

  <Accordion title="Request body example">
    ```json title="application/json;charset=utf-8" theme={null}
    {
      "ticket" : "Oy9mYXNoaW9uL0RFU0tUT1AvQ09OVEVOVF9TRUFSQ0hfUEFHRS9QUklNQVJZX0xJU1Q7Iztjb250ZW50X2tleTtkMDAxOyM7IzsjOyM7"
    }
    ```
  </Accordion>

  <Accordion title="Request body schema">
    #### TicketNotification

    The ticket is a unique string for an object generated by Elevate. It is used with notifications as a method to collect behavioural data.

    | Name     | Type   | Description                                                                                                                                                             |
    | -------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | ticket\* | string | Unique ticket for the Elevate object.<br /><br />Examples: `"Oy9mYXNoaW9uL0RFU0tUT1AvQ09OVEVOVF9TRUFSQ0hfUEFHRS9QUklNQVJZX0xJU1Q7Iztjb250ZW50X2tleTtkMDAxOyM7IzsjOyM7"` |
  </Accordion>

  <Accordion title="Example request">
    ```bash title="bash" theme={null}
    curl -i \
    -X POST \
    -H 'Accept-Encoding: null' \
    -H 'Content-Type: application/json;charset=utf-8' \
    "https://{cluster-id}.elevate-api.cloud/api/storefront/v3/notifications/add-to-cart?customerKey=customerKey&market=market&sessionKey=sessionKey&userContext=userContext" \
    -T request-body.file
    ```
  </Accordion>
</AccordionGroup>

## Response

<AccordionGroup>
  <Accordion title="Response codes">
    | Status | Description                                                                                                       |
    | ------ | ----------------------------------------------------------------------------------------------------------------- |
    | `204`  | Notification was received successfully.                                                                           |
    | `400`  | Invalid or missing required arguments.                                                                            |
    | `500`  | Server error such as cluster unavailable or busy. The response body may contain more information about the error. |
  </Accordion>
</AccordionGroup>
