Use the eCommerce API to trigger an event when a user views a product, adds a product to their shopping cart, or makes a purchase.
Make a call to this endpoint when a user views a product.
ecommerce:write
) required | Array of objects (ProductRequest) List of items viewed. |
occurredAt | string <date-time> Timestamp of when the action occurred in ISO 8601 format. If the timestamp is older than 12 hours, it will not trigger any relevant journeys. If no timestamp is provided, it is assumed the event occurred when the endpoint is called. |
required | object (EventUser) User associated with the action. Note that this is a visitor to the site and does not need to be actively subscribed to Attentive. Phone, email, or an external identifier (clientUserId or another custom identifier) are required |
Ok
Invalid parameter in request query or body
Unauthorized
Access Denied
The specified resource was not found
The user has sent too many requests in a given amount of time
Internal Server Error
{- "items": [
- {
- "productId": "AB12345",
- "productVariantId": "CD12345",
- "name": "T-Shirt",
- "price": [
- {
- "value": 19.99,
- "currency": "USD"
}
], - "quantity": 1
}
], - "occurredAt": "2021-03-30T14:38:29+0000",
- "user": {
- "phone": "+13115552368",
- "email": "test@gmail.com",
- "externalIdentifiers": {
- "clientUserId": "string",
- "customIdentifiers": [
- {
- "name": "string",
- "value": "string"
}
]
}
}
}
Make a call to this endpoint when a user adds a product to their shopping cart.
ecommerce:write
) required | Array of objects (ProductRequest) List of items added to cart. |
occurredAt | string <date-time> Timestamp of when the action occurred in ISO 8601 format. If the timestamp is older than 12 hours, it will not trigger any relevant journeys. If no timestamp is provided, it is assumed the event occurred when the endpoint is called. |
required | object (EventUser) User associated with the action. Note that this is a visitor to the site and does not need to be actively subscribed to Attentive. Phone, email, or an external identifier (clientUserId or another custom identifier) are required |
Ok
Invalid parameter in request query or body
Unauthorized
Access Denied
The specified resource was not found
The user has sent too many requests in a given amount of time
Internal Server Error
{- "items": [
- {
- "productId": "AB12345",
- "productVariantId": "CD12345",
- "name": "T-Shirt",
- "price": [
- {
- "value": 19.99,
- "currency": "USD"
}
], - "quantity": 1
}
], - "occurredAt": "2021-03-30T14:38:29+0000",
- "user": {
- "phone": "+13115552368",
- "email": "test@gmail.com",
- "externalIdentifiers": {
- "clientUserId": "string",
- "customIdentifiers": [
- {
- "name": "string",
- "value": "string"
}
]
}
}
}
Make a call to this endpoint when a user generates an order or purchase.
ecommerce:write
) required | Array of objects (ProductRequest) List of items purchased. |
occurredAt | string <date-time> Timestamp of when the action occurred in ISO 8601 format. If the timestamp is older than 12 hours, it will not trigger any relevant journeys. If no timestamp is provided, it is assumed the event occurred when the endpoint is called. |
required | object (EventUser) User associated with the action. Note that this is a visitor to the site and does not need to be actively subscribed to Attentive. Phone, email, or an external identifier (clientUserId or another custom identifier) are required |
Ok
Invalid parameter in request query or body
Unauthorized
Access Denied
The specified resource was not found
The user has sent too many requests in a given amount of time
Internal Server Error
{- "items": [
- {
- "productId": "AB12345",
- "productVariantId": "CD12345",
- "name": "T-Shirt",
- "price": [
- {
- "value": 19.99,
- "currency": "USD"
}
], - "quantity": 1
}
], - "occurredAt": "2021-03-30T14:38:29+0000",
- "user": {
- "phone": "+13115552368",
- "email": "test@gmail.com",
- "externalIdentifiers": {
- "clientUserId": "string",
- "customIdentifiers": [
- {
- "name": "string",
- "value": "string"
}
]
}
}
}