Send purchase event every time a user completes checkout, and at least one product in the order was accessed through Eureka search or listing pages.
Key differences from other Events
Feature | Purchase | Other Events |
|---|---|---|
Products | Array (multiple products) | Single object |
Source per product | Each product can have its own source | One source for the whole event |
allPurchasedProducts | Required, all product IDs in the order | Not applicable |
orderId | Required | Not applicable |
attributionWindow | Required (event-level, can be overridden per product) | Only for add-to-cart |
Event-Level Fields
Field | Required | Notes |
|---|---|---|
eventType | Yes | Must be "purchase" |
source | Yes | Event-level source. Products can override. One of: search-popup, search-listing, category-listing, brand-listing |
userId | Yes | Unique user identifier. No spaces. Defaults to "default" |
platform | Yes | One of: desktop-web, mobile-web, tablet-web, ios, android, other |
integrationType | Yes | One of: api, web, sdk, app |
searchSessionId | No | Deprecated. Use products[].traceId instead. Falls back to product-level traceId |
orderId | Yes | Unique order identifier. No spaces |
allPurchasedProducts | Yes | All product IDs in the order (including non-Eureka). Min 1 item. No spaces in items. |
products | Yes | Array of Eureka-related product objects. See product-level fields below |
referrer | Yes | Must be a valid URL |
createdAt | No | RFC 3339 timestamp. Defaults to current time if omitted or invalid |
campId | No | Campaign identifier. Defaults to 999999 |
attributionWindow | Yes | Required. Min 1 value. Products can override. Valid values: "session", "1", "7", "14", "30", "90" |
variationId | No | Variation identifier. Defaults to 999999 |
sessionId | No | Browser/app session identifier |
Refer to Common Properties for further details.
Product-Level Fields
Each item in the products array:
Field | Required | Notes |
|---|---|---|
id | Yes | Product identifier. No spaces |
groupCode | No | Product group code. Needed for group-level analytics |
price | Yes | Price of the product |
convertedPrice | No | Converted price in preferred currency. Defaults to price if not provided |
currency | Yes | ISO 4217 currency code. No spaces |
quantity | Yes | Min: 1. Defaults to 1 if 0 or negative |
source | Yes | Product-specific source. Overrides event-level. Triggers source-dependent validation |
isMerchandisedItem | No | Whether the product is a merchandised (promoted/sponsored) item. Defaults to false |
traceId | Yes | Links this product to the originating search/listing event |
searchSessionId | No | Deprecated. Use traceId instead. Bidirectional fallback with traceId |
query | Conditional | Required when product source is search-popup or search-listing. Defaults to "default" |
listValue | Conditional | Required when product source is category-listing or brand-listing |
displayPosition | Yes | Position when first displayed. Min: 1 |
clickPosition | Yes | Position when clicked. Min: 1 |
attributionWindow | No | Overrides event-level if provided. |
preferredCurrency | No | Main currency of your site. Defaults to currency if not specified |
sorting | Yes | Sorting method. Defaults to "Relevancy" |
resultCount | Yes | Number of results returned. Min: 1 |
itemsPerPage | Yes | Number of items per page. Min: 1 |
totalPages | Yes | Total number of pages. Min: 1 |
currentPage | Yes | Current page number. Min: 1 |
facets | No | Applied filters |
sessionId | No | Browser/app session identifier |
strategyId | No | Optional strategy identifier |
Refer to Common Properties for further details.
Attribution Window
Rule: Only include windows that encompass the event timeframe.
Example: If a user searched on day 1 and purchased on day 8:
Send: ["14", "30", "90"] (these windows include day 8)
Do not send: ["session", "1", "7"] (these expired)
Fallback: If a product does not have its own attributionWindow, the event-level value is used.
allPurchasedProducts vs products
Field | Contains | Purpose |
|---|---|---|
allPurchasedProducts | All product IDs in the order | Includes products not accessed through Eureka. Used for full order context |
products | Only Eureka-related products | Detailed product objects with tracking data (traceId, source, etc.) |
Example: Order has 3 products, but only 2 came from Eureka:
"allPurchasedProducts": ["prod-001", "prod-002", "prod-003"],
"products": [
{ "id": "prod-001", ... },
{ "id": "prod-002", ... }
]Sample Request - Mixed Sources (search + category in one order)
curl --location --request POST 'https://eurekaevent.api.useinsider.com/api/v1/events' \
--header 'x-auth-token: YOUR_AUTH_TOKEN' \
--header 'x-partner-config-key: YOUR_PARTNERID-YOUR_LOCALE' \
--header 'Content-Type: application/json' \
--data-raw '{
"eventType": "purchase",
"userId": "user-123",
"platform": "desktop-web",
"integrationType": "api",
"referrer": "https://example.com/checkout/success",
"orderId": "order-789",
"source": "search-listing",
"attributionWindow": ["session", "7", "30", "90"],
"allPurchasedProducts": ["product-001", "product-002", "product-003"],
"products": [
{
"id": "product-001",
"source": "search-listing",
"query": "queryA",
"price": 999.99,
"currency": "USD",
"quantity": 1,
"displayPosition": 3,
"clickPosition": 3,
"traceId": "sess-abc-123",
"sorting": "Relevancy",
"resultCount": 25,
"attributionWindow": ["session", "7", "30", "90"]
},
{
"id": "product-002",
"source": "category-listing",
"listValue": "categoryA~categoryB",
"price": 49.99,
"currency": "USD",
"quantity": 2,
"displayPosition": 5,
"clickPosition": 5,
"traceId": "trace-cat-456",
"sorting": "PriceAsc",
"resultCount": 80,
"attributionWindow": ["session", "7", "30"]
}
]
}'