Skip to main content
POST
Record a conversion

Authorizations

Authorization
string
header
required

A scoped token minted in Settings → API tokens. Send it as Authorization: Bearer tplt_… or X-API-Key: tplt_….

Headers

Idempotency-Key
string

Retry-safe key. The first response for a given key is cached for 24 hours and replayed on a repeat, with Idempotency-Replayed: true set. Send one on every call. A retried payment webhook without it will double count the sale.

Body

application/json
video_code
string
required

The video the sale is credited to. Required. A conversion with no video cannot be attributed to anything.

Maximum string length: 64
session_code
string

The viewer's session. Optional, but without it the sale cannot be joined to the play that caused it, and your play-to-sale rate stays blind to it.

Maximum string length: 128
event
string
default:conversion

What happened. Defaults to conversion.

Maximum string length: 64
conversion_id
string

Your order ID. Defaults to a generated UUID if omitted.

Maximum string length: 128
conversion_value
number

Sale amount.

Required range: x >= 0
conversion_currency
string

Three-letter currency code, e.g. USD.

Required string length: 3
conversion_product_code
string
Maximum string length: 128
conversion_product_name
string
Maximum string length: 255
conversion_customer_email
string<email>
Maximum string length: 255
conversion_customer_name
string
Maximum string length: 255
conversion_customer_phone
string
Maximum string length: 64
conversion_data
object

Any extra fields you want to keep with the sale.

is_test
boolean

Marks the row as a test so it can be excluded from reporting.

split_test_id
string

Send with split_test_variation_id or not at all. One without the other cannot identify an arm, and a half-attributed row looks valid while being wrong.

Maximum string length: 64
split_test_variation_id
string

Send with split_test_id or not at all.

Maximum string length: 64
occurred_at
string<date-time>

When the sale happened. Defaults to now.

Response

Conversion recorded.

recorded
boolean
Example:

true

conversion_id
string
Example:

"order_10482"

video_code
string
attributed_to_split_test
boolean

True when the conversion was credited to a split-test arm.