Skip to main content
POST
JavaScript
Conversions endpoints require a Business plan subscription or higher.

Authorizations

Authorization
string
header
required

Default authentication mechanism

Body

application/json
customerExternalId
string
required

The unique ID of the customer in your system. Will be used to identify and attribute all future events to this customer.

Required string length: 1 - 100
amount
integer
required

The amount of the sale in the smallest unit of currency — cents for two-decimal currencies, the full integer for zero-decimal ones (e.g. 1437 JPY), thousandths for three-decimal ones (e.g. 1437 KWD fils).

Required range: x >= 0
currency
string
default:usd

The currency of the sale, as an ISO 4217 code. Reporting is always in USD: non-USD sales are converted at the exchange rate of the day the sale is recorded, and the original amount and currency are kept on the event. The rate is not re-applied later, so reported totals do not move with the exchange rate.

eventName
string
default:Purchase

The name of the sale event. Recommended format: Invoice paid or Subscription created.

Maximum string length: 255
Example:

"Invoice paid"

paymentProcessor
enum<string>
default:custom

The payment processor via which the sale was made.

Available options:
stripe,
shopify,
polar,
paddle,
revenuecat,
custom,
manual
invoiceId
string | null

The invoice ID of the sale. Can be used as a idempotency key – only one sale event can be recorded for a given invoice ID.

metadata
object | null

Additional metadata to be stored with the sale event. Max 10,000 characters when stringified.

leadEventName
string | null

The name of the lead event that occurred before the sale (case-sensitive). This is used to associate the sale event with a particular lead event (instead of the latest lead event for a link-customer combination, which is the default behavior). For direct sale tracking, this field can also be used to specify the lead event name.

Example:

"Cloned template 1481267"

clickId
string | null

[For direct sale tracking]: The unique ID of the click that the sale conversion event is attributed to. You can read this value from cq_id cookie.

customerName
string | null

[For direct sale tracking]: The name of the customer. If not passed, a random name will be generated (e.g. “Big Red Caribou”).

Maximum string length: 100
customerEmail
string<email> | null

[For direct sale tracking]: The email address of the customer.

Maximum string length: 100
customerAvatar
string | null

[For direct sale tracking]: The avatar URL of the customer.

Response

A sale was tracked.

eventName
string
required
customerId
string
required
amount
number
required
paymentProcessor
string
required
invoiceId
string | null
required
currency
string
required
metadata
object | null
required