eCommerce

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.

Product view

Make a call to this endpoint when a user views a product.

Request
Security:
OAuthFlow (ecommerce:write)
Request Body schema: application/json
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.

Responses
200

Ok

400

Invalid parameter in request query or body

401

Unauthorized

403

Access Denied

404

The specified resource was not found

500

Internal Server Error

post/events/ecommerce/product-view
Request samples
application/json
{
  • "items": [],
  • "occurredAt": "2021-03-30T14:38:29+0000",
  • "user": {
    }
}

Add to cart

Make a call to this endpoint when a user adds a product to their shopping cart.

Request
Security:
OAuthFlow (ecommerce:write)
Request Body schema: application/json
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.

Responses
200

Ok

400

Invalid parameter in request query or body

401

Unauthorized

403

Access Denied

404

The specified resource was not found

500

Internal Server Error

post/events/ecommerce/add-to-cart
Request samples
application/json
{
  • "items": [],
  • "occurredAt": "2021-03-30T14:38:29+0000",
  • "user": {
    }
}

Purchase

Make a call to this endpoint when a user generates an order or purchase.

Request
Security:
OAuthFlow (ecommerce:write)
Request Body schema: application/json
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.

Responses
200

Ok

400

Invalid parameter in request query or body

401

Unauthorized

403

Access Denied

404

The specified resource was not found

500

Internal Server Error

post/events/ecommerce/purchase
Request samples
application/json
{
  • "items": [],
  • "occurredAt": "2021-03-30T14:38:29+0000",
  • "user": {
    }
}