POST
/
v2
/
events
curl --request POST \
  --url https://api.topsort.com/v2/events \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "impressions": [
    {
      "id": "eb874c98-bf4d-40a9-ae6d-fcf4cecb535c",
      "occurredAt": "2019-01-01T12:59:59-05:00",
      "opaqueUserId": "71303ce0-de89-496d-8270-6434589615e8",
      "placement": {
        "path": "/categories/dairy",
        "position": 1,
        "page": 1,
        "pageSize": 15,
        "categoryId": "9BLIe"
      },
      "resolvedBidId": "WyJiX01mazE1IiwiMTJhNTU4MjgtOGVhZC00Mjk5LTgzMjctY2ViYjAwMmEwZmE4IiwibGlzdGluZ3MiLCJkZWZhdWx0IiwiIl0="
    }
  ],
  "clicks": [
    {
      "id": "b39d39ed-ea0e-4059-9d15-4990b39c85a2",
      "occurredAt": "2019-01-01T13:01:42-05:00",
      "opaqueUserId": "71303ce0-de89-496d-8270-6434589615e8",
      "placement": {
        "path": "/categories/dairy",
        "position": 1,
        "page": 1,
        "pageSize": 15,
        "categoryId": "9BLIe"
      },
      "resolvedBidId": "WyJiX01mazE1IiwiMTJhNTU4MjgtOGVhZC00Mjk5LTgzMjctY2ViYjAwMmEwZmE4IiwibGlzdGluZ3MiLCJkZWZhdWx0IiwiIl0="
    }
  ],
  "purchases": [
    {
      "id": "0e06c899-b2cd-4e0d-b0de-8aefb4b6d0a0",
      "items": [
        {
          "productId": "p_SA0238",
          "unitPrice": 12.95,
          "quantity": 2,
          "vendorId": "v_8fj2D"
        },
        {
          "productId": "p_oajf2D",
          "unitPrice": 1.49
        }
      ],
      "occurredAt": "2019-01-01T12:59:59-05:00",
      "opaqueUserId": "71303ce0-de89-496d-8270-6434589615e8"
    }
  ]
}'
This response does not have an example.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
impressions
object[]

An impression means a promotable has become visible to the consumer. For promoted entities, include the resolvedBidId field from the /v2/auctions response. For unpromoted entities, include the entity field to describe what was seen. In case you cannot send an impression when the product becomes visible, send us an impression event when the product was rendered in the HTML or, if that's also not possible, when your API returns the results. It is important to select the most specific event so that your vendors have more accurate CTR metrics, which will allow them to better predict their campaigns.

clicks
object[]

A click is sent to Topsort when the consumer has clicked on a promotable. For promoted entities, include the resolvedBidId field from the /v2/auctions response. For unpromoted entities, include the entity field to describe what was clicked. Topsort charges the vendor and pays the marketplace for clicks on ads in promoted placements on the marketplace app.

purchases
object[]

A purchase is sent to Topsort once a marketplace customer places an order. These events are used to measure the effectiveness of an ad campaign.

Response

204
_mintlify/placeholder

All events were reported successfully.