Skip to main content
POST
/
conversions
JavaScript
import Whop from '@whop/sdk';

const client = new Whop({
  apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});

const conversion = await client.conversions.create({
  company_id: 'biz_xxxxxxxxxxxxxx',
  event_name: 'lead',
});

console.log(conversion.id);
{
  "id": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.whop.com/llms.txt

Use this file to discover all available pages before exploring further.

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,
kzt
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