Skip to main content
POST
/
conversions
Create conversion
curl --request POST \
  --url https://api.whop.com/api/v1/conversions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "company_id": "biz_xxxxxxxxxxxxxx",
  "event_name": "lead",
  "action_source": "email",
  "context": {
    "fbclid": "<string>",
    "fbp": "<string>",
    "ga": "<string>",
    "gclid": "<string>",
    "ig_sid": "<string>",
    "ttclid": "<string>",
    "ttp": "<string>",
    "ip_address": "<string>",
    "user_agent": "<string>",
    "ad_campaign_id": "<string>",
    "ad_id": "<string>",
    "ad_set_id": "<string>",
    "utm_campaign": "<string>",
    "utm_content": "<string>",
    "utm_id": "<string>",
    "utm_medium": "<string>",
    "utm_source": "<string>",
    "utm_term": "<string>"
  },
  "currency": "usd",
  "custom_name": "<string>",
  "event_id": "evnt_xxxxxxxxxxxxx",
  "event_time": "2023-12-01T05:00:00.401Z",
  "plan_id": "plan_xxxxxxxxxxxxx",
  "product_id": "prod_xxxxxxxxxxxxx",
  "referrer_url": "<string>",
  "url": "<string>",
  "user": {
    "anonymous_id": "<string>",
    "external_id": "<string>",
    "member_id": "mber_xxxxxxxxxxxxx",
    "membership_id": "mem_xxxxxxxxxxxxxx",
    "user_id": "user_xxxxxxxxxxxxx",
    "birthdate": "1990-01-15",
    "city": "<string>",
    "country": "<string>",
    "email": "<string>",
    "first_name": "<string>",
    "gender": "male",
    "last_name": "<string>",
    "name": "<string>",
    "phone": "<string>",
    "postal_code": "<string>",
    "state": "<string>",
    "username": "<string>"
  },
  "value": 6.9
}
'
{
  "id": "<string>"
}

Authorizations

Authorization
string
header
required

A company API key, company scoped JWT, app API key, or user OAuth token. You must prepend your key/token with the word 'Bearer', which will look like Bearer ***************************

Body

application/json

Parameters for CreateConversion

company_id
string
required

The company to associate with this event.

Example:

"biz_xxxxxxxxxxxxxx"

event_name
enum<string>
required

The type of event.

Available options:
lead,
submit_application,
contact,
complete_registration,
schedule,
custom
action_source
enum<string> | null

Where the event originated.

Available options:
email,
website,
app,
phone_call,
chat,
physical_store,
system_generated,
business_messaging,
other
context
object

Tracking and attribution context.

currency
enum<string> | null

ISO 4217 currency code.

Available options:
usd,
sgd,
inr,
aud,
brl,
cad,
dkk,
eur,
nok,
gbp,
sek,
chf,
hkd,
huf,
jpy,
mxn,
myr,
pln,
czk,
nzd,
aed,
eth,
ape,
cop,
ron,
thb,
bgn,
idr,
dop,
php,
try,
krw,
twd,
vnd,
pkr,
clp,
uyu,
ars,
zar,
dzd,
tnd,
mad,
kes,
kwd,
jod,
all,
xcd,
amd,
bsd,
bhd,
bob,
bam,
khr,
crc,
xof,
egp,
etb,
gmd,
ghs,
gtq,
gyd,
ils,
jmd,
mop,
mga,
mur,
mdl,
mnt,
nad,
ngn,
mkd,
omr,
pyg,
pen,
qar,
rwf,
sar,
rsd,
lkr,
tzs,
ttd,
uzs,
rub,
btc,
cny,
usdt
custom_name
string | null

Custom event name when event_name is 'custom'.

event_id
string | null

Client-provided identifier for deduplication. Generated if omitted.

Example:

"evnt_xxxxxxxxxxxxx"

event_time
string<date-time> | null

When the event occurred. Defaults to now.

Example:

"2023-12-01T05:00:00.401Z"

plan_id
string | null

The plan associated with the event.

Example:

"plan_xxxxxxxxxxxxx"

product_id
string | null

The product associated with the event.

Example:

"prod_xxxxxxxxxxxxx"

referrer_url
string | null

The referring URL.

url
string | null

The URL where the event occurred.

user
object

User identity and profile data.

value
number | null

Monetary value associated with the event.

Example:

6.9

Response

A successful response

A tracked conversion event

id
string
required

The unique identifier for the conversion