Skip to content

Report a conversion

POST
/api/sites/{siteId}/conversions
curl --request POST \
--url https://tracker.adstrike.io/api/sites/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/conversions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "clientId": "USER_12345", "orderId": "ORDER-10042", "type": "purchase", "value": 129.5, "currency": "EUR", "occurredAt": "2026-07-22T10:32:00Z" }'

Reports a conversion from your backend, independently of the pixel (ad blockers, purchases validated outside the browser, delayed payments). The conversion is attached to the visitor’s most recent session within the site’s attribution window, then goes through the same attribution pipeline as pixel events.

202 means “accepted and queued”: processing (attribution, currency conversion) is asynchronous.

Best practices

  • Call at order validation, not at checkout — cancelled or failed orders are never counted.
  • Always send orderId + clientId.
  • Keep the pixel purchase event active: the orderId deduplication makes both sources idempotent.
  • On 422 for a FRESH order, retry once after a short delay (1-2 minutes): the pixel batch creating the session may still be in flight. If it persists, treat it as permanent (the user never visited with the pixel active). Retry with backoff on 503.
siteId
required
string format: uuid

The site’s UUID (visible in the dashboard) — not the tracker identifier.

Media typeapplication/json
Any of:

At least one of clientId, visitorId or sessionId is required to resolve the visitor’s session.

object
clientId
required

The user id previously passed to identify() on the pixel side. Recommended join key — no cookie plumbing needed on your backend.

string
>= 1 characters <= 256 characters
visitorId

Value of the _astr_vid cookie (fallback).

string
>= 1 characters <= 256 characters
sessionId

Session id (fallback).

string format: uuid
orderId

Order id, unique per site. REQUIRED when type is purchase. Deduplication key against pixel events: the same order sent by the pixel and by your server is counted once, and retries are safe.

string
>= 1 characters <= 128 characters
type

Conversion type.

string
default: purchase >= 1 characters <= 64 characters
value

Conversion amount.

number
currency

ISO 4217 currency code.

string
default: USD >= 3 characters <= 3 characters
occurredAt

When the order was validated (ISO 8601). Defaults to the time of the call. Send the validation time, not the checkout time.

string format: date-time
Example
{
"clientId": "USER_12345",
"orderId": "ORDER-10042",
"type": "purchase",
"value": 129.5,
"currency": "EUR",
"occurredAt": "2026-07-22T10:32:00Z"
}

Conversion accepted and queued.

Media typeapplication/json
object
success
boolean
sessionId

The session the conversion was attached to.

string format: uuid
eventId

Id of the created conversion event.

string format: uuid
Examplegenerated
{
"success": true,
"sessionId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"eventId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}

Validation error (missing or invalid field).

Media typeapplication/json
object
error
string
code

Machine-readable code on some errors (e.g. NO_SESSION).

string
Examplegenerated
{
"error": "example",
"code": "example"
}

Missing or invalid API key.

Media typeapplication/json
object
error
string
code

Machine-readable code on some errors (e.g. NO_SESSION).

string
Examplegenerated
{
"error": "example",
"code": "example"
}

The site does not belong to the key’s organization.

Media typeapplication/json
object
error
string
code

Machine-readable code on some errors (e.g. NO_SESSION).

string
Examplegenerated
{
"error": "example",
"code": "example"
}

Unknown site.

Media typeapplication/json
object
error
string
code

Machine-readable code on some errors (e.g. NO_SESSION).

string
Examplegenerated
{
"error": "example",
"code": "example"
}

No session resolvable from the provided identifiers (unknown visitor, or outside the attribution window). For a fresh order, retry once after 1-2 minutes (the pixel batch may still be in flight); otherwise permanent.

Media typeapplication/json
object
error
string
code

Machine-readable code on some errors (e.g. NO_SESSION).

string
Examplegenerated
{
"error": "example",
"code": "example"
}

Queue unavailable — retry with exponential backoff.

Media typeapplication/json
object
error
string
code

Machine-readable code on some errors (e.g. NO_SESSION).

string
Examplegenerated
{
"error": "example",
"code": "example"
}