> ## 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.

# Payment

> The payment notification is to be sent when the visitor has placed an order of one or more products and completed payment.

The payment notification is to be sent when the visitor has placed an order of one or more products and completed payment.

```http theme={null}
POST https://{cluster-id}.elevate-api.cloud/api/admin/v3/notifications/payment
```

## Request

<AccordionGroup>
  <Accordion title="Request header parameters">
    | Name        | Description                         | Example       |
    | ----------- | ----------------------------------- | ------------- |
    | `Api-Key`\* | API key supplied during onboarding. | `123456789..` |
  </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}
    {
      "lines" : [ {
        "quantity" : 2,
        "variantKey" : "<VARIANT_KEY_FROM_YOUR_FEED>",
        "cost" : 15.2,
        "sellingPrice" : 39.0
      } ],
      "orderId" : "68ee0b2d-a12c-470c-94de-a9776fad7bbb"
    }
    ```
  </Accordion>

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

    The payment notification should be sent when the visitor has placed an order on one or more products and completed payment.

    | Name    | Type                           | Description                                                                                                                                                                                                                                                                                                                                                            |
    | ------- | ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | lines\* | [PaymentLine](#paymentline)\[] | Array with payment information.                                                                                                                                                                                                                                                                                                                                        |
    | orderId | string                         | An optional ID for the purchase order as a whole. Used for tracking purchases in the Retail Media system. If not included, the purchase order will be assigned a random id instead.<br /><br />**For <a href="https://docs.elevate.voyado.cloud/elevate/4/addons/retail-media/">retail media</a> only.**<br /><br />Examples: `"68ee0b2d-a12c-470c-94de-a9776fad7bbb"` |
  </Accordion>

  <Accordion title="Example request">
    ```bash title="bash" theme={null}
    curl -i \
    -X POST \
    -H 'Api-Key: 123456789..' \
    -H 'Content-Type: application/json;charset=utf-8' \
    "https://{cluster-id}.elevate-api.cloud/api/admin/v3/notifications/payment?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`  | There were no order lines in the payment notification, missing or invalid required arguments, one or more order lines had incorrect variant keys. Order lines with correct variant keys are accepted even if one or more order lines had incorrect variant keys. |
    | `403`  | Incorrect cluster credentials.                                                                                                                                                                                                                                   |
    | `500`  | Server error such as cluster unavailable or busy. The response body may contain more information about the error.                                                                                                                                                |
  </Accordion>
</AccordionGroup>

## Inner Schemas

### PaymentLine

| Name         | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                          |
| ------------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| quantity\*   | integer | The quantity of the purchased product.<br /><br />Examples: `2`                                                                                                                                                                                                                                                                                                                                                      |
| variantKey\* | string  | The unique key of the variant.<br /><br />Examples: `"<VARIANT_KEY_FROM_YOUR_FEED>"`                                                                                                                                                                                                                                                                                                                                 |
| cost         | number  | The unit cost of the purchased product. It is strongly recommended to provide cost, either included in a payment notification or as an attribute in the data feed. For more information about cost, see <a href="https://docs.elevate.voyado.cloud/elevate/4/integration/essentials/best-practices/#cost">Best practices</a>.<br /><br />Examples: `15.2`                                                            |
| sellingPrice | number  | The unit selling price of the purchased product. If excluded, Elevate will use the selling price from the data feed. When using <a href="https://docs.elevate.voyado.cloud/elevate/4/integration/data-feed/xml-format-specification/#custom-prices">custom prices</a> in other currencies this should be the price in the base currency, i.e. the same currency as the non-custom price.<br /><br />Examples: `39.0` |
