Report an event
Authentication
Topsort’s APIs are authenticated via bearer tokens. Requests must include an authorization header containing your private API key.
Don't have an API key yet? Learn how to generate one.
The header containing a private API key. Format this header as follows:
Authorization: Bearer <YOUR-API-KEY>
Request Body
Use the /events
endpoint to notify Topsort about significant consumer interactions on the e-commerce site: impressions — product links become visible to the consumer; clicks — the consumer clicks on a product link; and purchases — the consumer buys some products.
A product has become visible to the consumer. In case you cannot send the impression when the product is 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 allow them to better predict their campaigns.
object
Discriminator for the type of event.
The Session object allows correlating user activity during a session whether or not they are actually logged in.
object
Long-lived token identifying the customer interacting with the marketplace. If your users are always logged in you may use a hash of your customer ID. If your users may interact with your app or site while logged out we recommend generating a random identifier (UUIDv4) on first load and store it on local storage (cookie, local storage, etc) and let it live for at least a year.
object
object
A marketplace assigned name for a page.
A marketplace defined name for a page part.
The product that was rendered.
Required for promoted products. Must be the ID for the auction the product won.
The marketplace’s ID for the impression.
RFC3339 formatted timestamp including UTC offset
ClickEvents are sent to Topsort when the consumer has clicked on an impression. Topsort charges the vendor and pays the marketplace for clicks on impressions in promoted placements on the e-commerce site.
object
Discriminator for the type of event.
The Session object allows correlating user activity during a session whether or not they are actually logged in.
object
Long-lived token identifying the customer interacting with the marketplace. If your users are always logged in you may use a hash of your customer ID. If your users may interact with your app or site while logged out we recommend generating a random identifier (UUIDv4) on first load and store it on local storage (cookie, local storage, etc) and let it live for at least a year.
object
A marketplace assigned name for a page.
A marketplace defined name for a page part.
The product that was clicked.
Required for promoted products. Must be the ID for the auction the product won.
The marketplace’s unique ID for the click.
RFC3339 formatted timestamp including UTC offset
The consumer has purchased some products.
object
Discriminator for the type of event.
The Session object allows correlating user activity during a session whether or not they are actually logged in.
object
Long-lived token identifying the customer interacting with the marketplace. If your users are always logged in you may use a hash of your customer ID. If your users may interact with your app or site while logged out we recommend generating a random identifier (UUIDv4) on first load and store it on local storage (cookie, local storage, etc) and let it live for at least a year.
The marketplace assigned ID for the order.
RFC3339 formatted timestamp including UTC offset
Items purchased.
object
The marketplace ID of the product being purchased.
If known, the product’s auction ID if the consumer clicked on a promoted link before purchasing.
Count of product purchased.
The price of a single item in minor currency units. For example, in the US (currency code “USD”) the unit price is specified in cents.
Responses
An object containing the markeplace ID for the event and the Topsort ID for the same event. Logging this can facilitate debugging. The field name for the TopsortID will be “impressionID”, “clickId” or “purchaseId” depending on the event in the request.
object
The collection of all impressions that were processed correctly.
object
Topsort assigned ID for the impression.
The marketplace’s ID for the impression, if provided.
object
Topsort assigned ID for the click.
The marketplace’s ID for the click, if provided.
object
Topsort assigned ID for the purchase.
The marketplace’s ID for the purchase, if provided.
HTTP status codes as registered with IANA.
object
A short string uniquely identifying the problem.
A link to a documentation page providing more information about the error.
Human-readable explanation of or details about the error. The string for a given error may change over time; code should not parse or dispatch based on particular values for this field.
Access token is missing or invalid.