Event Collection API: Purchase Event

Prev Next

The purchase event should be fired when a visitor completes checkout for a product they received an impression for via a search.

Endpoint

POST https://eurekaevent.api.useinsider.com/api/v1/event

Visit our Postman collection to test this request.

Request Parameters

The purchase event supports the following properties:

Attribute Name

Type

Validation

Default

Description

referrer

String

Required, url

-

Source URL of the referring page

campId

Integer

-

999999

The campId serves as a unique identifier. Refer to common fields for more details.

variationId

Integer

-

999999

The variationId represents the unique identifier for a specific campaign variation. Refer to common fields for more details.

platform

String

Required,
oneof=
- desktop-web
- mobile-web

- tablet-web
- ios
- android
- other

-

Platform used by the user

userId

String

Required

default

Unique identifier of the user. It is expected to provide for user-based calculations.

integrationType

String

Required,
oneof=
- api
- web

-

Type of integration

orderId

String

Required

-

Unique ID of the order with at least one product that received an impression from the search event

allPurchasedProducts

List of string

Required

-

List of all product IDs that were purchased

products

List of Product

Required

-

List of purchased products that received a click from the search event. Refer to common fields for more details.

eventType

String

Required, equals=purchase

-

Type of event

createdAt

String

Required, formatted in RFC3339

If omitted or invalid, it defaults to the current time

Time when the event is created. Refer to common fields for more details.

If your integration was implemented before the Advanced Analytics September 01, 2025, release, please note that new fields have been added to the expected product payload. Following this release, the event now retrieves currentPage, source, and related details from product-level fields instead of top-level fields. In addition, the product object has been enriched with several new fields.

For backward compatibility, you may continue sending these values at the event level. However, it is strongly recommended to update your implementation to the new product-level structure to ensure full alignment with the latest version and to benefit from more comprehensive analytics.

You can review the full list of changes on the Common Properties page.

Sample Request

In the example below, you see a sample request along with guidance on modifying the necessary fields. This will help you seamlessly integrate and make the most of the provided configuration.

Before usage, modifying the values such as x-auth-token and x-partner-config-key is essential.

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 '{
  "referrer": "https://example.com/cart",
  "userId": "user-12345",
  "platform": "android",
  "campId": 100,
  "variationId": 200,
  "orderId": "order-xyz789",
  "allPurchasedProducts": [
    "product-001",
    "product-002",
    "product-003"
  ],
  "products": [
    {
      "traceId": "search-session-abc123",
      "strategyId":"strategy-id-123",
      "sessionId":"session-id-123",
      "source": "category-listing",
      "id": "product-001",
      "groupCode": "laptop-group-1",
      "listValue": "pc~laptop",
      "resultCount": 25,
      "itemsPerPage": 10,
      "totalPages": 3,
      "currentPage": 1,
      "sorting": "PriceDesc",
      "facets": [
        {
          "label": "Fiyat",
          "field": "price",
          "values": ["500", "2000"]
        }
      ],
      "price": 1299.99,
      "convertedPrice": 1199.99,
      "currency": "USD",
      "preferredCurrency": "EUR",
      "clickPosition": 1,
      "displayPosition": 1,
      "quantity": 2,
      "attributionWindow": ["session", "1", "7", "30", "90"]
    },
    {
      "traceId": "search-session-def456",
      "strategyId":"strategy-id-123",
      "sessionId":"session-id-123",
      "source": "search-listing",
      "id": "product-002",
      "groupCode": "mouse-group-1",
      "query": "wireless mouse",
      "resultCount": 15,
      "itemsPerPage": 10,
      "totalPages": 2,
      "currentPage": 1,
      "sorting": "MostPopularFirst",
      "facets": [
        {
          "label": "Brand",
          "field": "brand_en",
          "values": ["Ltech"]
        }
      ],
      "price": 49.99,
      "convertedPrice": 45.99,
      "currency": "USD",
      "preferredCurrency": "EUR",
      "clickPosition": 2,
      "displayPosition": 2,
      "quantity": 1,
      "attributionWindow": ["session", "1", "7", "30", "90"]
    }
  ],
  "eventType": "purchase",
  "integrationType": "api",
  "createdAt": "2025-11-25T10:50:00Z"
}'