Add to Cart¶
The add-to-cart notification is to be sent with a ticket when a visitor adds an eSales product to their cart. The ticket is a unique string for an object generated by eSales.
Request¶
Request method¶
POST
Request URL¶
https://{cluster-id}.api.esales.apptus.cloud/api/v2/notifications/add-to-cart?market={market}&customerKey={customerKey}&sessionKey={sessionKey}
Request parameters¶
Name | Type | Description | Example |
---|---|---|---|
market | string | The visitor market. Must match the corresponding market identifier in the data feed. Required | UK |
customerKey | string | A key that uniquely identifies the current visitor. Using UUIDs as keys are recommended. Required | 0b05119e-eeb8-418a-bbfb-defa0dde417e |
sessionKey | string | A unique key, identifying the session. Using UUIDs as keys are recommended. Required | 0b05119e-eeb8-418a-bbfb-defa0dde417e |
ticket | string | Unique ticket for the eSales object. Required | L2RvY...ztDMDs |
Request headers¶
All request headers are optional, but recommended when eligible.
Content-Type
-application/json
. To prevent automatic browser preflight requests,text/plain
is also supported.Accept-Encoding
-gzip
. Allows responses to be compressed using Gzip.User-Agent
- User agent. Enables internal tracking.
Request body¶
{
"ticket": "string"
}
Request example¶
An add-to-cart notification example is demonstrated using cURL below.
request-body.json¶
{
"ticket": "Oy9keW5hbWljLXBhZ2VzL3N0YXJ0L2VzYWxlcy1zdGFydC0xOyM7cHJvZHVjdF9rZXk7UF8xMjUzODMtMDAxNF9VSzsjOztOT05FOk5PTkU7NjE7"
}
cURL¶
#!/bin/bash
curl -i \
-X POST \
-T request-body.json \
-H "Content-Type: text/plain" \
-H "Accept-Encoding: gzip" \
-H "User-Agent: {client user agent}" \
"https://{cluster-id}.api.esales.apptus.cloud/api/v2/notifications/add-to-cart?market=UK&customerKey=d9528030-509c-4e0f-b585-7168f1e9feca&sessionKey=b106299c-eac0-4f6f-96d2-93e57c255784"
Response¶
Response headers¶
N/A
Response content-type¶
HTTP response code
Response codes¶
Response | Description |
---|---|
204 | Notifications was received successfully. |
400 | Invalid or missing required arguments. |
5xx | Server error such as cluster unavailable or busy. The response body may contain more information about the error. |
Response objects¶
Response example
HTTP/1.1 204 No Content