import Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
const event = await client.events.create({
account_id: 'biz_xxxxxxxxxxxxxx',
event_name: 'coating_deposit_paid',
});
console.log(event.id);curl --request POST \
--url https://api.whop.com/api/v1/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account_id": "biz_xxxxxxxxxxxxxx",
"event_name": "coating_deposit_paid",
"action_source": "website",
"context": {
"ad_campaign_id": "23851234567890123",
"ad_id": "23851234567890125",
"ad_set_id": "23851234567890124",
"fbc": "fb.1.xxxxxxxxxx.IwAR0shine",
"fbclid": "IwAR0shineTimeAutoDetailing",
"fbp": "fb.1.xxxxxxxxxx.xxxxxxxxxx",
"fingerprint": "fp_4d19c7",
"fingerprint_confidence": 6.9,
"ga": "GA1.1.xxxxxxxxxx.xxxxxxxxxx",
"gbraid": "0AAAAA-shinetime",
"gclid": "Cj0KCQiAshinetime",
"ig_sid": "ig_shinetime_1",
"ip_address": "1.2.3.4",
"language": "en-US",
"li_fat_id": "lifat-shinetime",
"msclkid": "a1b2c3d4shine",
"rdt_cid": "t2_shinetime",
"sccid": "sccid-shinetime",
"screen_resolution": "390x844",
"timezone": "America/Chicago",
"ttclid": "E.C.P.ttclid.shine",
"ttp": "2ShineTimeTtp",
"twclid": "twclid-shinetime",
"user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15",
"utm_campaign": "ceramic-coating-spring",
"utm_content": "carousel-a",
"utm_id": "utm_88213",
"utm_medium": "cpc",
"utm_source": "google",
"utm_term": "ceramic coating austin",
"wbraid": "Cj0KCQjw-wbraid-shine"
},
"currency": "usd",
"custom_name": "coating_deposit_paid",
"duration": 42,
"event_id": "evnt_xxxxxxxxxxxxx",
"event_time": "2023-12-01T05:00:00.401Z",
"plan_id": "plan_xxxxxxxxxxxxx",
"product_id": "prod_xxxxxxxxxxxxx",
"referrer_url": "https://www.google.com/",
"resumed": false,
"source": "website",
"title": "Ceramic coating quote request",
"url": "https://shinetime.example/quote",
"user": {
"anonymous_id": "anon_8f2c41",
"birthdate": "1990-01-15",
"city": "Austin",
"country": "US",
"email": "marcus@shinetime.example",
"external_id": "crm_8842",
"first_name": "Dana",
"gender": "female",
"last_name": "Whitfield",
"linked_anonymous_id": "anon_1b9de0",
"linked_wuid": "user_xxxxxxxxxxxxxx",
"member_id": "mber_xxxxxxxxxxxxx",
"membership_id": "mem_xxxxxxxxxxxxxx",
"name": "Dana Whitfield",
"phone": "+xxxxxxxxxxx",
"postal_code": "78756",
"state": "TX",
"user_id": "user_xxxxxxxxxxxxx",
"username": "danawhitfield"
},
"value": 6.9
}
'import requests
url = "https://api.whop.com/api/v1/events"
payload = {
"account_id": "biz_xxxxxxxxxxxxxx",
"event_name": "coating_deposit_paid",
"action_source": "website",
"context": {
"ad_campaign_id": "23851234567890123",
"ad_id": "23851234567890125",
"ad_set_id": "23851234567890124",
"fbc": "fb.1.xxxxxxxxxx.IwAR0shine",
"fbclid": "IwAR0shineTimeAutoDetailing",
"fbp": "fb.1.xxxxxxxxxx.xxxxxxxxxx",
"fingerprint": "fp_4d19c7",
"fingerprint_confidence": 6.9,
"ga": "GA1.1.xxxxxxxxxx.xxxxxxxxxx",
"gbraid": "0AAAAA-shinetime",
"gclid": "Cj0KCQiAshinetime",
"ig_sid": "ig_shinetime_1",
"ip_address": "1.2.3.4",
"language": "en-US",
"li_fat_id": "lifat-shinetime",
"msclkid": "a1b2c3d4shine",
"rdt_cid": "t2_shinetime",
"sccid": "sccid-shinetime",
"screen_resolution": "390x844",
"timezone": "America/Chicago",
"ttclid": "E.C.P.ttclid.shine",
"ttp": "2ShineTimeTtp",
"twclid": "twclid-shinetime",
"user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15",
"utm_campaign": "ceramic-coating-spring",
"utm_content": "carousel-a",
"utm_id": "utm_88213",
"utm_medium": "cpc",
"utm_source": "google",
"utm_term": "ceramic coating austin",
"wbraid": "Cj0KCQjw-wbraid-shine"
},
"currency": "usd",
"custom_name": "coating_deposit_paid",
"duration": 42,
"event_id": "evnt_xxxxxxxxxxxxx",
"event_time": "2023-12-01T05:00:00.401Z",
"plan_id": "plan_xxxxxxxxxxxxx",
"product_id": "prod_xxxxxxxxxxxxx",
"referrer_url": "https://www.google.com/",
"resumed": False,
"source": "website",
"title": "Ceramic coating quote request",
"url": "https://shinetime.example/quote",
"user": {
"anonymous_id": "anon_8f2c41",
"birthdate": "1990-01-15",
"city": "Austin",
"country": "US",
"email": "marcus@shinetime.example",
"external_id": "crm_8842",
"first_name": "Dana",
"gender": "female",
"last_name": "Whitfield",
"linked_anonymous_id": "anon_1b9de0",
"linked_wuid": "user_xxxxxxxxxxxxxx",
"member_id": "mber_xxxxxxxxxxxxx",
"membership_id": "mem_xxxxxxxxxxxxxx",
"name": "Dana Whitfield",
"phone": "+xxxxxxxxxxx",
"postal_code": "78756",
"state": "TX",
"user_id": "user_xxxxxxxxxxxxx",
"username": "danawhitfield"
},
"value": 6.9
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.whop.com/api/v1/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'account_id' => 'biz_xxxxxxxxxxxxxx',
'event_name' => 'coating_deposit_paid',
'action_source' => 'website',
'context' => [
'ad_campaign_id' => '23851234567890123',
'ad_id' => '23851234567890125',
'ad_set_id' => '23851234567890124',
'fbc' => 'fb.1.xxxxxxxxxx.IwAR0shine',
'fbclid' => 'IwAR0shineTimeAutoDetailing',
'fbp' => 'fb.1.xxxxxxxxxx.xxxxxxxxxx',
'fingerprint' => 'fp_4d19c7',
'fingerprint_confidence' => 6.9,
'ga' => 'GA1.1.xxxxxxxxxx.xxxxxxxxxx',
'gbraid' => '0AAAAA-shinetime',
'gclid' => 'Cj0KCQiAshinetime',
'ig_sid' => 'ig_shinetime_1',
'ip_address' => '1.2.3.4',
'language' => 'en-US',
'li_fat_id' => 'lifat-shinetime',
'msclkid' => 'a1b2c3d4shine',
'rdt_cid' => 't2_shinetime',
'sccid' => 'sccid-shinetime',
'screen_resolution' => '390x844',
'timezone' => 'America/Chicago',
'ttclid' => 'E.C.P.ttclid.shine',
'ttp' => '2ShineTimeTtp',
'twclid' => 'twclid-shinetime',
'user_agent' => 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15',
'utm_campaign' => 'ceramic-coating-spring',
'utm_content' => 'carousel-a',
'utm_id' => 'utm_88213',
'utm_medium' => 'cpc',
'utm_source' => 'google',
'utm_term' => 'ceramic coating austin',
'wbraid' => 'Cj0KCQjw-wbraid-shine'
],
'currency' => 'usd',
'custom_name' => 'coating_deposit_paid',
'duration' => 42,
'event_id' => 'evnt_xxxxxxxxxxxxx',
'event_time' => '2023-12-01T05:00:00.401Z',
'plan_id' => 'plan_xxxxxxxxxxxxx',
'product_id' => 'prod_xxxxxxxxxxxxx',
'referrer_url' => 'https://www.google.com/',
'resumed' => false,
'source' => 'website',
'title' => 'Ceramic coating quote request',
'url' => 'https://shinetime.example/quote',
'user' => [
'anonymous_id' => 'anon_8f2c41',
'birthdate' => '1990-01-15',
'city' => 'Austin',
'country' => 'US',
'email' => 'marcus@shinetime.example',
'external_id' => 'crm_8842',
'first_name' => 'Dana',
'gender' => 'female',
'last_name' => 'Whitfield',
'linked_anonymous_id' => 'anon_1b9de0',
'linked_wuid' => 'user_xxxxxxxxxxxxxx',
'member_id' => 'mber_xxxxxxxxxxxxx',
'membership_id' => 'mem_xxxxxxxxxxxxxx',
'name' => 'Dana Whitfield',
'phone' => '+xxxxxxxxxxx',
'postal_code' => '78756',
'state' => 'TX',
'user_id' => 'user_xxxxxxxxxxxxx',
'username' => 'danawhitfield'
],
'value' => 6.9
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.whop.com/api/v1/events"
payload := strings.NewReader("{\n \"account_id\": \"biz_xxxxxxxxxxxxxx\",\n \"event_name\": \"coating_deposit_paid\",\n \"action_source\": \"website\",\n \"context\": {\n \"ad_campaign_id\": \"23851234567890123\",\n \"ad_id\": \"23851234567890125\",\n \"ad_set_id\": \"23851234567890124\",\n \"fbc\": \"fb.1.xxxxxxxxxx.IwAR0shine\",\n \"fbclid\": \"IwAR0shineTimeAutoDetailing\",\n \"fbp\": \"fb.1.xxxxxxxxxx.xxxxxxxxxx\",\n \"fingerprint\": \"fp_4d19c7\",\n \"fingerprint_confidence\": 6.9,\n \"ga\": \"GA1.1.xxxxxxxxxx.xxxxxxxxxx\",\n \"gbraid\": \"0AAAAA-shinetime\",\n \"gclid\": \"Cj0KCQiAshinetime\",\n \"ig_sid\": \"ig_shinetime_1\",\n \"ip_address\": \"1.2.3.4\",\n \"language\": \"en-US\",\n \"li_fat_id\": \"lifat-shinetime\",\n \"msclkid\": \"a1b2c3d4shine\",\n \"rdt_cid\": \"t2_shinetime\",\n \"sccid\": \"sccid-shinetime\",\n \"screen_resolution\": \"390x844\",\n \"timezone\": \"America/Chicago\",\n \"ttclid\": \"E.C.P.ttclid.shine\",\n \"ttp\": \"2ShineTimeTtp\",\n \"twclid\": \"twclid-shinetime\",\n \"user_agent\": \"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15\",\n \"utm_campaign\": \"ceramic-coating-spring\",\n \"utm_content\": \"carousel-a\",\n \"utm_id\": \"utm_88213\",\n \"utm_medium\": \"cpc\",\n \"utm_source\": \"google\",\n \"utm_term\": \"ceramic coating austin\",\n \"wbraid\": \"Cj0KCQjw-wbraid-shine\"\n },\n \"currency\": \"usd\",\n \"custom_name\": \"coating_deposit_paid\",\n \"duration\": 42,\n \"event_id\": \"evnt_xxxxxxxxxxxxx\",\n \"event_time\": \"2023-12-01T05:00:00.401Z\",\n \"plan_id\": \"plan_xxxxxxxxxxxxx\",\n \"product_id\": \"prod_xxxxxxxxxxxxx\",\n \"referrer_url\": \"https://www.google.com/\",\n \"resumed\": false,\n \"source\": \"website\",\n \"title\": \"Ceramic coating quote request\",\n \"url\": \"https://shinetime.example/quote\",\n \"user\": {\n \"anonymous_id\": \"anon_8f2c41\",\n \"birthdate\": \"1990-01-15\",\n \"city\": \"Austin\",\n \"country\": \"US\",\n \"email\": \"marcus@shinetime.example\",\n \"external_id\": \"crm_8842\",\n \"first_name\": \"Dana\",\n \"gender\": \"female\",\n \"last_name\": \"Whitfield\",\n \"linked_anonymous_id\": \"anon_1b9de0\",\n \"linked_wuid\": \"user_xxxxxxxxxxxxxx\",\n \"member_id\": \"mber_xxxxxxxxxxxxx\",\n \"membership_id\": \"mem_xxxxxxxxxxxxxx\",\n \"name\": \"Dana Whitfield\",\n \"phone\": \"+xxxxxxxxxxx\",\n \"postal_code\": \"78756\",\n \"state\": \"TX\",\n \"user_id\": \"user_xxxxxxxxxxxxx\",\n \"username\": \"danawhitfield\"\n },\n \"value\": 6.9\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.whop.com/api/v1/events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": \"biz_xxxxxxxxxxxxxx\",\n \"event_name\": \"coating_deposit_paid\",\n \"action_source\": \"website\",\n \"context\": {\n \"ad_campaign_id\": \"23851234567890123\",\n \"ad_id\": \"23851234567890125\",\n \"ad_set_id\": \"23851234567890124\",\n \"fbc\": \"fb.1.xxxxxxxxxx.IwAR0shine\",\n \"fbclid\": \"IwAR0shineTimeAutoDetailing\",\n \"fbp\": \"fb.1.xxxxxxxxxx.xxxxxxxxxx\",\n \"fingerprint\": \"fp_4d19c7\",\n \"fingerprint_confidence\": 6.9,\n \"ga\": \"GA1.1.xxxxxxxxxx.xxxxxxxxxx\",\n \"gbraid\": \"0AAAAA-shinetime\",\n \"gclid\": \"Cj0KCQiAshinetime\",\n \"ig_sid\": \"ig_shinetime_1\",\n \"ip_address\": \"1.2.3.4\",\n \"language\": \"en-US\",\n \"li_fat_id\": \"lifat-shinetime\",\n \"msclkid\": \"a1b2c3d4shine\",\n \"rdt_cid\": \"t2_shinetime\",\n \"sccid\": \"sccid-shinetime\",\n \"screen_resolution\": \"390x844\",\n \"timezone\": \"America/Chicago\",\n \"ttclid\": \"E.C.P.ttclid.shine\",\n \"ttp\": \"2ShineTimeTtp\",\n \"twclid\": \"twclid-shinetime\",\n \"user_agent\": \"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15\",\n \"utm_campaign\": \"ceramic-coating-spring\",\n \"utm_content\": \"carousel-a\",\n \"utm_id\": \"utm_88213\",\n \"utm_medium\": \"cpc\",\n \"utm_source\": \"google\",\n \"utm_term\": \"ceramic coating austin\",\n \"wbraid\": \"Cj0KCQjw-wbraid-shine\"\n },\n \"currency\": \"usd\",\n \"custom_name\": \"coating_deposit_paid\",\n \"duration\": 42,\n \"event_id\": \"evnt_xxxxxxxxxxxxx\",\n \"event_time\": \"2023-12-01T05:00:00.401Z\",\n \"plan_id\": \"plan_xxxxxxxxxxxxx\",\n \"product_id\": \"prod_xxxxxxxxxxxxx\",\n \"referrer_url\": \"https://www.google.com/\",\n \"resumed\": false,\n \"source\": \"website\",\n \"title\": \"Ceramic coating quote request\",\n \"url\": \"https://shinetime.example/quote\",\n \"user\": {\n \"anonymous_id\": \"anon_8f2c41\",\n \"birthdate\": \"1990-01-15\",\n \"city\": \"Austin\",\n \"country\": \"US\",\n \"email\": \"marcus@shinetime.example\",\n \"external_id\": \"crm_8842\",\n \"first_name\": \"Dana\",\n \"gender\": \"female\",\n \"last_name\": \"Whitfield\",\n \"linked_anonymous_id\": \"anon_1b9de0\",\n \"linked_wuid\": \"user_xxxxxxxxxxxxxx\",\n \"member_id\": \"mber_xxxxxxxxxxxxx\",\n \"membership_id\": \"mem_xxxxxxxxxxxxxx\",\n \"name\": \"Dana Whitfield\",\n \"phone\": \"+xxxxxxxxxxx\",\n \"postal_code\": \"78756\",\n \"state\": \"TX\",\n \"user_id\": \"user_xxxxxxxxxxxxx\",\n \"username\": \"danawhitfield\"\n },\n \"value\": 6.9\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.whop.com/api/v1/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_id\": \"biz_xxxxxxxxxxxxxx\",\n \"event_name\": \"coating_deposit_paid\",\n \"action_source\": \"website\",\n \"context\": {\n \"ad_campaign_id\": \"23851234567890123\",\n \"ad_id\": \"23851234567890125\",\n \"ad_set_id\": \"23851234567890124\",\n \"fbc\": \"fb.1.xxxxxxxxxx.IwAR0shine\",\n \"fbclid\": \"IwAR0shineTimeAutoDetailing\",\n \"fbp\": \"fb.1.xxxxxxxxxx.xxxxxxxxxx\",\n \"fingerprint\": \"fp_4d19c7\",\n \"fingerprint_confidence\": 6.9,\n \"ga\": \"GA1.1.xxxxxxxxxx.xxxxxxxxxx\",\n \"gbraid\": \"0AAAAA-shinetime\",\n \"gclid\": \"Cj0KCQiAshinetime\",\n \"ig_sid\": \"ig_shinetime_1\",\n \"ip_address\": \"1.2.3.4\",\n \"language\": \"en-US\",\n \"li_fat_id\": \"lifat-shinetime\",\n \"msclkid\": \"a1b2c3d4shine\",\n \"rdt_cid\": \"t2_shinetime\",\n \"sccid\": \"sccid-shinetime\",\n \"screen_resolution\": \"390x844\",\n \"timezone\": \"America/Chicago\",\n \"ttclid\": \"E.C.P.ttclid.shine\",\n \"ttp\": \"2ShineTimeTtp\",\n \"twclid\": \"twclid-shinetime\",\n \"user_agent\": \"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15\",\n \"utm_campaign\": \"ceramic-coating-spring\",\n \"utm_content\": \"carousel-a\",\n \"utm_id\": \"utm_88213\",\n \"utm_medium\": \"cpc\",\n \"utm_source\": \"google\",\n \"utm_term\": \"ceramic coating austin\",\n \"wbraid\": \"Cj0KCQjw-wbraid-shine\"\n },\n \"currency\": \"usd\",\n \"custom_name\": \"coating_deposit_paid\",\n \"duration\": 42,\n \"event_id\": \"evnt_xxxxxxxxxxxxx\",\n \"event_time\": \"2023-12-01T05:00:00.401Z\",\n \"plan_id\": \"plan_xxxxxxxxxxxxx\",\n \"product_id\": \"prod_xxxxxxxxxxxxx\",\n \"referrer_url\": \"https://www.google.com/\",\n \"resumed\": false,\n \"source\": \"website\",\n \"title\": \"Ceramic coating quote request\",\n \"url\": \"https://shinetime.example/quote\",\n \"user\": {\n \"anonymous_id\": \"anon_8f2c41\",\n \"birthdate\": \"1990-01-15\",\n \"city\": \"Austin\",\n \"country\": \"US\",\n \"email\": \"marcus@shinetime.example\",\n \"external_id\": \"crm_8842\",\n \"first_name\": \"Dana\",\n \"gender\": \"female\",\n \"last_name\": \"Whitfield\",\n \"linked_anonymous_id\": \"anon_1b9de0\",\n \"linked_wuid\": \"user_xxxxxxxxxxxxxx\",\n \"member_id\": \"mber_xxxxxxxxxxxxx\",\n \"membership_id\": \"mem_xxxxxxxxxxxxxx\",\n \"name\": \"Dana Whitfield\",\n \"phone\": \"+xxxxxxxxxxx\",\n \"postal_code\": \"78756\",\n \"state\": \"TX\",\n \"user_id\": \"user_xxxxxxxxxxxxx\",\n \"username\": \"danawhitfield\"\n },\n \"value\": 6.9\n}"
response = http.request(request)
puts response.read_body{
"id": "evnt_xxxxxxxxxxxxxx"
}{
"error": {
"message": "account_id is required",
"type": "bad_request",
"code": "<string>"
}
}Create Event
Tracks a conversion or engagement event for an account.
import Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
const event = await client.events.create({
account_id: 'biz_xxxxxxxxxxxxxx',
event_name: 'coating_deposit_paid',
});
console.log(event.id);curl --request POST \
--url https://api.whop.com/api/v1/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account_id": "biz_xxxxxxxxxxxxxx",
"event_name": "coating_deposit_paid",
"action_source": "website",
"context": {
"ad_campaign_id": "23851234567890123",
"ad_id": "23851234567890125",
"ad_set_id": "23851234567890124",
"fbc": "fb.1.xxxxxxxxxx.IwAR0shine",
"fbclid": "IwAR0shineTimeAutoDetailing",
"fbp": "fb.1.xxxxxxxxxx.xxxxxxxxxx",
"fingerprint": "fp_4d19c7",
"fingerprint_confidence": 6.9,
"ga": "GA1.1.xxxxxxxxxx.xxxxxxxxxx",
"gbraid": "0AAAAA-shinetime",
"gclid": "Cj0KCQiAshinetime",
"ig_sid": "ig_shinetime_1",
"ip_address": "1.2.3.4",
"language": "en-US",
"li_fat_id": "lifat-shinetime",
"msclkid": "a1b2c3d4shine",
"rdt_cid": "t2_shinetime",
"sccid": "sccid-shinetime",
"screen_resolution": "390x844",
"timezone": "America/Chicago",
"ttclid": "E.C.P.ttclid.shine",
"ttp": "2ShineTimeTtp",
"twclid": "twclid-shinetime",
"user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15",
"utm_campaign": "ceramic-coating-spring",
"utm_content": "carousel-a",
"utm_id": "utm_88213",
"utm_medium": "cpc",
"utm_source": "google",
"utm_term": "ceramic coating austin",
"wbraid": "Cj0KCQjw-wbraid-shine"
},
"currency": "usd",
"custom_name": "coating_deposit_paid",
"duration": 42,
"event_id": "evnt_xxxxxxxxxxxxx",
"event_time": "2023-12-01T05:00:00.401Z",
"plan_id": "plan_xxxxxxxxxxxxx",
"product_id": "prod_xxxxxxxxxxxxx",
"referrer_url": "https://www.google.com/",
"resumed": false,
"source": "website",
"title": "Ceramic coating quote request",
"url": "https://shinetime.example/quote",
"user": {
"anonymous_id": "anon_8f2c41",
"birthdate": "1990-01-15",
"city": "Austin",
"country": "US",
"email": "marcus@shinetime.example",
"external_id": "crm_8842",
"first_name": "Dana",
"gender": "female",
"last_name": "Whitfield",
"linked_anonymous_id": "anon_1b9de0",
"linked_wuid": "user_xxxxxxxxxxxxxx",
"member_id": "mber_xxxxxxxxxxxxx",
"membership_id": "mem_xxxxxxxxxxxxxx",
"name": "Dana Whitfield",
"phone": "+xxxxxxxxxxx",
"postal_code": "78756",
"state": "TX",
"user_id": "user_xxxxxxxxxxxxx",
"username": "danawhitfield"
},
"value": 6.9
}
'import requests
url = "https://api.whop.com/api/v1/events"
payload = {
"account_id": "biz_xxxxxxxxxxxxxx",
"event_name": "coating_deposit_paid",
"action_source": "website",
"context": {
"ad_campaign_id": "23851234567890123",
"ad_id": "23851234567890125",
"ad_set_id": "23851234567890124",
"fbc": "fb.1.xxxxxxxxxx.IwAR0shine",
"fbclid": "IwAR0shineTimeAutoDetailing",
"fbp": "fb.1.xxxxxxxxxx.xxxxxxxxxx",
"fingerprint": "fp_4d19c7",
"fingerprint_confidence": 6.9,
"ga": "GA1.1.xxxxxxxxxx.xxxxxxxxxx",
"gbraid": "0AAAAA-shinetime",
"gclid": "Cj0KCQiAshinetime",
"ig_sid": "ig_shinetime_1",
"ip_address": "1.2.3.4",
"language": "en-US",
"li_fat_id": "lifat-shinetime",
"msclkid": "a1b2c3d4shine",
"rdt_cid": "t2_shinetime",
"sccid": "sccid-shinetime",
"screen_resolution": "390x844",
"timezone": "America/Chicago",
"ttclid": "E.C.P.ttclid.shine",
"ttp": "2ShineTimeTtp",
"twclid": "twclid-shinetime",
"user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15",
"utm_campaign": "ceramic-coating-spring",
"utm_content": "carousel-a",
"utm_id": "utm_88213",
"utm_medium": "cpc",
"utm_source": "google",
"utm_term": "ceramic coating austin",
"wbraid": "Cj0KCQjw-wbraid-shine"
},
"currency": "usd",
"custom_name": "coating_deposit_paid",
"duration": 42,
"event_id": "evnt_xxxxxxxxxxxxx",
"event_time": "2023-12-01T05:00:00.401Z",
"plan_id": "plan_xxxxxxxxxxxxx",
"product_id": "prod_xxxxxxxxxxxxx",
"referrer_url": "https://www.google.com/",
"resumed": False,
"source": "website",
"title": "Ceramic coating quote request",
"url": "https://shinetime.example/quote",
"user": {
"anonymous_id": "anon_8f2c41",
"birthdate": "1990-01-15",
"city": "Austin",
"country": "US",
"email": "marcus@shinetime.example",
"external_id": "crm_8842",
"first_name": "Dana",
"gender": "female",
"last_name": "Whitfield",
"linked_anonymous_id": "anon_1b9de0",
"linked_wuid": "user_xxxxxxxxxxxxxx",
"member_id": "mber_xxxxxxxxxxxxx",
"membership_id": "mem_xxxxxxxxxxxxxx",
"name": "Dana Whitfield",
"phone": "+xxxxxxxxxxx",
"postal_code": "78756",
"state": "TX",
"user_id": "user_xxxxxxxxxxxxx",
"username": "danawhitfield"
},
"value": 6.9
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.whop.com/api/v1/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'account_id' => 'biz_xxxxxxxxxxxxxx',
'event_name' => 'coating_deposit_paid',
'action_source' => 'website',
'context' => [
'ad_campaign_id' => '23851234567890123',
'ad_id' => '23851234567890125',
'ad_set_id' => '23851234567890124',
'fbc' => 'fb.1.xxxxxxxxxx.IwAR0shine',
'fbclid' => 'IwAR0shineTimeAutoDetailing',
'fbp' => 'fb.1.xxxxxxxxxx.xxxxxxxxxx',
'fingerprint' => 'fp_4d19c7',
'fingerprint_confidence' => 6.9,
'ga' => 'GA1.1.xxxxxxxxxx.xxxxxxxxxx',
'gbraid' => '0AAAAA-shinetime',
'gclid' => 'Cj0KCQiAshinetime',
'ig_sid' => 'ig_shinetime_1',
'ip_address' => '1.2.3.4',
'language' => 'en-US',
'li_fat_id' => 'lifat-shinetime',
'msclkid' => 'a1b2c3d4shine',
'rdt_cid' => 't2_shinetime',
'sccid' => 'sccid-shinetime',
'screen_resolution' => '390x844',
'timezone' => 'America/Chicago',
'ttclid' => 'E.C.P.ttclid.shine',
'ttp' => '2ShineTimeTtp',
'twclid' => 'twclid-shinetime',
'user_agent' => 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15',
'utm_campaign' => 'ceramic-coating-spring',
'utm_content' => 'carousel-a',
'utm_id' => 'utm_88213',
'utm_medium' => 'cpc',
'utm_source' => 'google',
'utm_term' => 'ceramic coating austin',
'wbraid' => 'Cj0KCQjw-wbraid-shine'
],
'currency' => 'usd',
'custom_name' => 'coating_deposit_paid',
'duration' => 42,
'event_id' => 'evnt_xxxxxxxxxxxxx',
'event_time' => '2023-12-01T05:00:00.401Z',
'plan_id' => 'plan_xxxxxxxxxxxxx',
'product_id' => 'prod_xxxxxxxxxxxxx',
'referrer_url' => 'https://www.google.com/',
'resumed' => false,
'source' => 'website',
'title' => 'Ceramic coating quote request',
'url' => 'https://shinetime.example/quote',
'user' => [
'anonymous_id' => 'anon_8f2c41',
'birthdate' => '1990-01-15',
'city' => 'Austin',
'country' => 'US',
'email' => 'marcus@shinetime.example',
'external_id' => 'crm_8842',
'first_name' => 'Dana',
'gender' => 'female',
'last_name' => 'Whitfield',
'linked_anonymous_id' => 'anon_1b9de0',
'linked_wuid' => 'user_xxxxxxxxxxxxxx',
'member_id' => 'mber_xxxxxxxxxxxxx',
'membership_id' => 'mem_xxxxxxxxxxxxxx',
'name' => 'Dana Whitfield',
'phone' => '+xxxxxxxxxxx',
'postal_code' => '78756',
'state' => 'TX',
'user_id' => 'user_xxxxxxxxxxxxx',
'username' => 'danawhitfield'
],
'value' => 6.9
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.whop.com/api/v1/events"
payload := strings.NewReader("{\n \"account_id\": \"biz_xxxxxxxxxxxxxx\",\n \"event_name\": \"coating_deposit_paid\",\n \"action_source\": \"website\",\n \"context\": {\n \"ad_campaign_id\": \"23851234567890123\",\n \"ad_id\": \"23851234567890125\",\n \"ad_set_id\": \"23851234567890124\",\n \"fbc\": \"fb.1.xxxxxxxxxx.IwAR0shine\",\n \"fbclid\": \"IwAR0shineTimeAutoDetailing\",\n \"fbp\": \"fb.1.xxxxxxxxxx.xxxxxxxxxx\",\n \"fingerprint\": \"fp_4d19c7\",\n \"fingerprint_confidence\": 6.9,\n \"ga\": \"GA1.1.xxxxxxxxxx.xxxxxxxxxx\",\n \"gbraid\": \"0AAAAA-shinetime\",\n \"gclid\": \"Cj0KCQiAshinetime\",\n \"ig_sid\": \"ig_shinetime_1\",\n \"ip_address\": \"1.2.3.4\",\n \"language\": \"en-US\",\n \"li_fat_id\": \"lifat-shinetime\",\n \"msclkid\": \"a1b2c3d4shine\",\n \"rdt_cid\": \"t2_shinetime\",\n \"sccid\": \"sccid-shinetime\",\n \"screen_resolution\": \"390x844\",\n \"timezone\": \"America/Chicago\",\n \"ttclid\": \"E.C.P.ttclid.shine\",\n \"ttp\": \"2ShineTimeTtp\",\n \"twclid\": \"twclid-shinetime\",\n \"user_agent\": \"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15\",\n \"utm_campaign\": \"ceramic-coating-spring\",\n \"utm_content\": \"carousel-a\",\n \"utm_id\": \"utm_88213\",\n \"utm_medium\": \"cpc\",\n \"utm_source\": \"google\",\n \"utm_term\": \"ceramic coating austin\",\n \"wbraid\": \"Cj0KCQjw-wbraid-shine\"\n },\n \"currency\": \"usd\",\n \"custom_name\": \"coating_deposit_paid\",\n \"duration\": 42,\n \"event_id\": \"evnt_xxxxxxxxxxxxx\",\n \"event_time\": \"2023-12-01T05:00:00.401Z\",\n \"plan_id\": \"plan_xxxxxxxxxxxxx\",\n \"product_id\": \"prod_xxxxxxxxxxxxx\",\n \"referrer_url\": \"https://www.google.com/\",\n \"resumed\": false,\n \"source\": \"website\",\n \"title\": \"Ceramic coating quote request\",\n \"url\": \"https://shinetime.example/quote\",\n \"user\": {\n \"anonymous_id\": \"anon_8f2c41\",\n \"birthdate\": \"1990-01-15\",\n \"city\": \"Austin\",\n \"country\": \"US\",\n \"email\": \"marcus@shinetime.example\",\n \"external_id\": \"crm_8842\",\n \"first_name\": \"Dana\",\n \"gender\": \"female\",\n \"last_name\": \"Whitfield\",\n \"linked_anonymous_id\": \"anon_1b9de0\",\n \"linked_wuid\": \"user_xxxxxxxxxxxxxx\",\n \"member_id\": \"mber_xxxxxxxxxxxxx\",\n \"membership_id\": \"mem_xxxxxxxxxxxxxx\",\n \"name\": \"Dana Whitfield\",\n \"phone\": \"+xxxxxxxxxxx\",\n \"postal_code\": \"78756\",\n \"state\": \"TX\",\n \"user_id\": \"user_xxxxxxxxxxxxx\",\n \"username\": \"danawhitfield\"\n },\n \"value\": 6.9\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.whop.com/api/v1/events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": \"biz_xxxxxxxxxxxxxx\",\n \"event_name\": \"coating_deposit_paid\",\n \"action_source\": \"website\",\n \"context\": {\n \"ad_campaign_id\": \"23851234567890123\",\n \"ad_id\": \"23851234567890125\",\n \"ad_set_id\": \"23851234567890124\",\n \"fbc\": \"fb.1.xxxxxxxxxx.IwAR0shine\",\n \"fbclid\": \"IwAR0shineTimeAutoDetailing\",\n \"fbp\": \"fb.1.xxxxxxxxxx.xxxxxxxxxx\",\n \"fingerprint\": \"fp_4d19c7\",\n \"fingerprint_confidence\": 6.9,\n \"ga\": \"GA1.1.xxxxxxxxxx.xxxxxxxxxx\",\n \"gbraid\": \"0AAAAA-shinetime\",\n \"gclid\": \"Cj0KCQiAshinetime\",\n \"ig_sid\": \"ig_shinetime_1\",\n \"ip_address\": \"1.2.3.4\",\n \"language\": \"en-US\",\n \"li_fat_id\": \"lifat-shinetime\",\n \"msclkid\": \"a1b2c3d4shine\",\n \"rdt_cid\": \"t2_shinetime\",\n \"sccid\": \"sccid-shinetime\",\n \"screen_resolution\": \"390x844\",\n \"timezone\": \"America/Chicago\",\n \"ttclid\": \"E.C.P.ttclid.shine\",\n \"ttp\": \"2ShineTimeTtp\",\n \"twclid\": \"twclid-shinetime\",\n \"user_agent\": \"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15\",\n \"utm_campaign\": \"ceramic-coating-spring\",\n \"utm_content\": \"carousel-a\",\n \"utm_id\": \"utm_88213\",\n \"utm_medium\": \"cpc\",\n \"utm_source\": \"google\",\n \"utm_term\": \"ceramic coating austin\",\n \"wbraid\": \"Cj0KCQjw-wbraid-shine\"\n },\n \"currency\": \"usd\",\n \"custom_name\": \"coating_deposit_paid\",\n \"duration\": 42,\n \"event_id\": \"evnt_xxxxxxxxxxxxx\",\n \"event_time\": \"2023-12-01T05:00:00.401Z\",\n \"plan_id\": \"plan_xxxxxxxxxxxxx\",\n \"product_id\": \"prod_xxxxxxxxxxxxx\",\n \"referrer_url\": \"https://www.google.com/\",\n \"resumed\": false,\n \"source\": \"website\",\n \"title\": \"Ceramic coating quote request\",\n \"url\": \"https://shinetime.example/quote\",\n \"user\": {\n \"anonymous_id\": \"anon_8f2c41\",\n \"birthdate\": \"1990-01-15\",\n \"city\": \"Austin\",\n \"country\": \"US\",\n \"email\": \"marcus@shinetime.example\",\n \"external_id\": \"crm_8842\",\n \"first_name\": \"Dana\",\n \"gender\": \"female\",\n \"last_name\": \"Whitfield\",\n \"linked_anonymous_id\": \"anon_1b9de0\",\n \"linked_wuid\": \"user_xxxxxxxxxxxxxx\",\n \"member_id\": \"mber_xxxxxxxxxxxxx\",\n \"membership_id\": \"mem_xxxxxxxxxxxxxx\",\n \"name\": \"Dana Whitfield\",\n \"phone\": \"+xxxxxxxxxxx\",\n \"postal_code\": \"78756\",\n \"state\": \"TX\",\n \"user_id\": \"user_xxxxxxxxxxxxx\",\n \"username\": \"danawhitfield\"\n },\n \"value\": 6.9\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.whop.com/api/v1/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_id\": \"biz_xxxxxxxxxxxxxx\",\n \"event_name\": \"coating_deposit_paid\",\n \"action_source\": \"website\",\n \"context\": {\n \"ad_campaign_id\": \"23851234567890123\",\n \"ad_id\": \"23851234567890125\",\n \"ad_set_id\": \"23851234567890124\",\n \"fbc\": \"fb.1.xxxxxxxxxx.IwAR0shine\",\n \"fbclid\": \"IwAR0shineTimeAutoDetailing\",\n \"fbp\": \"fb.1.xxxxxxxxxx.xxxxxxxxxx\",\n \"fingerprint\": \"fp_4d19c7\",\n \"fingerprint_confidence\": 6.9,\n \"ga\": \"GA1.1.xxxxxxxxxx.xxxxxxxxxx\",\n \"gbraid\": \"0AAAAA-shinetime\",\n \"gclid\": \"Cj0KCQiAshinetime\",\n \"ig_sid\": \"ig_shinetime_1\",\n \"ip_address\": \"1.2.3.4\",\n \"language\": \"en-US\",\n \"li_fat_id\": \"lifat-shinetime\",\n \"msclkid\": \"a1b2c3d4shine\",\n \"rdt_cid\": \"t2_shinetime\",\n \"sccid\": \"sccid-shinetime\",\n \"screen_resolution\": \"390x844\",\n \"timezone\": \"America/Chicago\",\n \"ttclid\": \"E.C.P.ttclid.shine\",\n \"ttp\": \"2ShineTimeTtp\",\n \"twclid\": \"twclid-shinetime\",\n \"user_agent\": \"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15\",\n \"utm_campaign\": \"ceramic-coating-spring\",\n \"utm_content\": \"carousel-a\",\n \"utm_id\": \"utm_88213\",\n \"utm_medium\": \"cpc\",\n \"utm_source\": \"google\",\n \"utm_term\": \"ceramic coating austin\",\n \"wbraid\": \"Cj0KCQjw-wbraid-shine\"\n },\n \"currency\": \"usd\",\n \"custom_name\": \"coating_deposit_paid\",\n \"duration\": 42,\n \"event_id\": \"evnt_xxxxxxxxxxxxx\",\n \"event_time\": \"2023-12-01T05:00:00.401Z\",\n \"plan_id\": \"plan_xxxxxxxxxxxxx\",\n \"product_id\": \"prod_xxxxxxxxxxxxx\",\n \"referrer_url\": \"https://www.google.com/\",\n \"resumed\": false,\n \"source\": \"website\",\n \"title\": \"Ceramic coating quote request\",\n \"url\": \"https://shinetime.example/quote\",\n \"user\": {\n \"anonymous_id\": \"anon_8f2c41\",\n \"birthdate\": \"1990-01-15\",\n \"city\": \"Austin\",\n \"country\": \"US\",\n \"email\": \"marcus@shinetime.example\",\n \"external_id\": \"crm_8842\",\n \"first_name\": \"Dana\",\n \"gender\": \"female\",\n \"last_name\": \"Whitfield\",\n \"linked_anonymous_id\": \"anon_1b9de0\",\n \"linked_wuid\": \"user_xxxxxxxxxxxxxx\",\n \"member_id\": \"mber_xxxxxxxxxxxxx\",\n \"membership_id\": \"mem_xxxxxxxxxxxxxx\",\n \"name\": \"Dana Whitfield\",\n \"phone\": \"+xxxxxxxxxxx\",\n \"postal_code\": \"78756\",\n \"state\": \"TX\",\n \"user_id\": \"user_xxxxxxxxxxxxx\",\n \"username\": \"danawhitfield\"\n },\n \"value\": 6.9\n}"
response = http.request(request)
puts response.read_body{
"id": "evnt_xxxxxxxxxxxxxx"
}{
"error": {
"message": "account_id is required",
"type": "bad_request",
"code": "<string>"
}
}Authorizations
An Account API key, account-scoped JWT, App API key, or user OAuth token. Prepend the key or token with Bearer, for example Bearer ***************************.
Headers
A unique key that makes this request safe to retry. See Idempotent requests.
255"d9105228-4a08-46b1-8b91-42fed586d383"
Body
Parameters for CreateConversion
The account to associate with this event.
"biz_xxxxxxxxxxxxxx"
The type of event.
Use a standard event (lead, submit_application, contact, complete_registration, schedule, view_content, add_to_cart) or pass your own name directly for a custom event.
"coating_deposit_paid"
Where the event originated.
email, website, app, phone_call, chat, physical_store, system_generated, business_messaging, other "website"
Tracking and attribution context.
Show child attributes
Show child attributes
ISO 4217 currency code.
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, awg, whop_usd, xau "usd"
Custom event name when event_name is 'custom'. Maximum 35 chars for this value.
"coating_deposit_paid"
For 'leave' events: milliseconds the visitor spent on the page.
42
Client-provided identifier for deduplication. Generated if omitted.
"evnt_xxxxxxxxxxxxx"
When the event occurred. Defaults to now.
"2023-12-01T05:00:00.401Z"
The plan associated with the event.
"plan_xxxxxxxxxxxxx"
The product associated with the event.
"prod_xxxxxxxxxxxxx"
The referring URL.
"https://www.google.com/"
For 'page' events: true when the page was restored from the back/forward cache.
false
For 'identify' events: where the identity was captured (url, form, manual, iframe).
"website"
For 'page' events: the document title.
"Ceramic coating quote request"
The URL where the event occurred.
"https://shinetime.example/quote"
User identity and profile data.
Show child attributes
Show child attributes
Monetary value associated with the event.
6.9
Response
event created
"evnt_xxxxxxxxxxxxxx"

