import Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
const checkoutConfiguration = await client.checkoutConfigurations.create({
plan: { company_id: 'biz_xxxxxxxxxxxxxx', currency: 'usd' },
});
console.log(checkoutConfiguration.id);{
"id": "ch_xxxxxxxxxxxxxxx",
"company_id": "<string>",
"mode": "payment",
"plan": {
"id": "plan_xxxxxxxxxxxxx",
"visibility": "visible",
"plan_type": "renewal",
"release_method": "buy_now",
"currency": "usd",
"billing_period": 42,
"expiration_days": 42,
"initial_price": 6.9,
"renewal_price": 6.9,
"trial_period_days": 42
},
"affiliate_code": "<string>",
"metadata": {},
"redirect_url": "<string>",
"purchase_url": "<string>",
"payment_method_configuration": {
"enabled": [
"acss_debit"
],
"disabled": [
"acss_debit"
],
"include_platform_defaults": true
}
}Creates a new checkout configuration
Required permissions:
checkout_configuration:createplan:createaccess_pass:createaccess_pass:updatecheckout_configuration:basic:readimport Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
const checkoutConfiguration = await client.checkoutConfigurations.create({
plan: { company_id: 'biz_xxxxxxxxxxxxxx', currency: 'usd' },
});
console.log(checkoutConfiguration.id);{
"id": "ch_xxxxxxxxxxxxxxx",
"company_id": "<string>",
"mode": "payment",
"plan": {
"id": "plan_xxxxxxxxxxxxx",
"visibility": "visible",
"plan_type": "renewal",
"release_method": "buy_now",
"currency": "usd",
"billing_period": 42,
"expiration_days": 42,
"initial_price": 6.9,
"renewal_price": 6.9,
"trial_period_days": 42
},
"affiliate_code": "<string>",
"metadata": {},
"redirect_url": "<string>",
"purchase_url": "<string>",
"payment_method_configuration": {
"enabled": [
"acss_debit"
],
"disabled": [
"acss_debit"
],
"include_platform_defaults": true
}
}The app API key from an app from the /dashboard/developer page
Parameters for CreateCheckoutSession Autogenerated input type of CreateCheckoutSession
Pass this object to create a new plan for this checkout configuration
Show child attributes
The company the plan should be created for.
"biz_xxxxxxxxxxxxxx"
The respective currency identifier for the plan.
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 The interval at which the plan charges (renewal plans).
42
An array of custom field objects.
Show child attributes
The type of the custom field.
"text"The name of the custom field.
The ID of the custom field (if being updated)
The order of the field.
42
The placeholder value of the field.
Whether or not the field is required.
The description of the plan.
The interval at which the plan charges (expiration plans).
42
Whether to force the creation of a new plan even if one with the same attributes already exists.
An image for the plan. This will be visible on the product page to customers. Input for an attachment
Show child attributes
This ID should be used the first time you upload an attachment. It is the ID of the direct upload that was created when uploading the file to S3 via the mediaDirectUpload mutation.
An additional amount charged upon first purchase.
6.9
A personal description or notes section for the business.
An override for tax to specify for this specific plan.
inclusive, exclusive, unspecified The explicit payment method configuration for the plan. If not provided, the platform or company's defaults will apply.
Show child attributes
An array of payment method identifiers that are explicitly disabled. Only applies if the include_platform_defaults is true.
The different types of payment methods that can be used.
acss_debit, affirm, afterpay_clearpay, alipay, alma, amazon_pay, apple_pay, au_becs_debit, bacs_debit, bancontact, billie, blik, boleto, card, cashapp, crypto, eps, fpx, giropay, google_pay, grabpay, ideal, kakao_pay, klarna, konbini, kr_card, link, mobilepay, multibanco, naver_pay, nz_bank_account, oxxo, p24, pay_by_bank, payco, paynow, pix, promptpay, revolut_pay, samsung_pay, satispay, sepa_debit, sofort, swish, twint, us_bank_account, wechat_pay, zip, bizum, capchase_pay, kriya, mondu, ng_wallet, paypay, sequra, scalapay, vipps, custom, customer_balance, gopay, mb_way, ng_bank, ng_bank_transfer, ng_card, ng_market, ng_ussd, paypal, payto, qris, rechnung, south_korea_market, kr_market, shopeepay, upi, sunbit, netbanking, id_bank_transfer, demo_pay, shop_pay, sezzle, coinbase, splitit, platform_balance, apple, venmo, unknown An array of payment method identifiers that are explicitly enabled. This means these payment methods will be shown on checkout. Example use case is to only enable a specific payment method like cashapp, or extending the platform defaults with additional methods.
The different types of payment methods that can be used.
acss_debit, affirm, afterpay_clearpay, alipay, alma, amazon_pay, apple_pay, au_becs_debit, bacs_debit, bancontact, billie, blik, boleto, card, cashapp, crypto, eps, fpx, giropay, google_pay, grabpay, ideal, kakao_pay, klarna, konbini, kr_card, link, mobilepay, multibanco, naver_pay, nz_bank_account, oxxo, p24, pay_by_bank, payco, paynow, pix, promptpay, revolut_pay, samsung_pay, satispay, sepa_debit, sofort, swish, twint, us_bank_account, wechat_pay, zip, bizum, capchase_pay, kriya, mondu, ng_wallet, paypay, sequra, scalapay, vipps, custom, customer_balance, gopay, mb_way, ng_bank, ng_bank_transfer, ng_card, ng_market, ng_ussd, paypal, payto, qris, rechnung, south_korea_market, kr_market, shopeepay, upi, sunbit, netbanking, id_bank_transfer, demo_pay, shop_pay, sezzle, coinbase, splitit, platform_balance, apple, venmo, unknown Whether Whop's platform default payment method enablement settings are included in this configuration. The full list of default payment methods can be found in the documentation at docs.whop.com/payments.
Indicates if the plan is a one time payment or recurring.
renewal, one_time Pass this object to create a new product for this plan. We will use the product external identifier to find or create an existing product.
Show child attributes
A unique ID used to find or create a product. When provided during creation, we will look for an existing product with this external identifier — if found, it will be updated; otherwise, a new product will be created.
The title of the product.
The business type of the product.
education_program, coaching, software, paid_group, newsletter, agency, physical_products, brick_and_mortar, events, coaching_and_courses, other, saas, course, community Whether or not to collect shipping information at checkout from the customer.
The custom statement descriptor for the product i.e. WHOP*SPORTS, must be between 5 and 22 characters, contain at least one letter, and not contain any of the following characters: <, >, , ', "
A written description of the product.
The percentage of the revenue that goes to the global affiliate program.
6.9
The status of the global affiliate program for this product.
enabled, disabled The headline of the product.
The industry type of the product.
trading, sports_betting, reselling, fitness, amazon_fba, real_estate, kindle_book_publishing, dating, agencies, health_and_wellness, social_media, sales, business, ecommerce, video_games, home_services, ai, public_speaking, personal_finance, careers, travel, clipping, spirituality, vas, personal_development, software, other, marketing_agency, sales_agency, ai_agency, design_agency, coaching_agency, development_agency, recruiting_agency, customer_support_agency, clipping_agency, clothing, supplements, beauty_and_personal_care, fitness_gear, accessories, home_goods, electronics_and_gadgets, food_and_beverages, gym, restaurant, retail_store, coffee_shop, salon_spa, medical_dentist_office, hotel_lodging, auto_repair_shop, masterminds, webinars, bootcamps, convention, concerts, meetups, parties The ID of the product tax code to apply to this product.
"ptc_xxxxxxxxxxxxxx"
The URL to redirect the customer to after a purchase.
The route of the product.
This product will/will not be displayed publicly - default hidden.
visible, hidden, archived, quick_link The product the plan is related to. Either this or product is required.
"prod_xxxxxxxxxxxxx"
This is the release method the business uses to sell this plan.
buy_now, waitlist The amount the customer is charged every billing period.
6.9
The number of payments required before pausing the subscription.
42
The title of the plan. This will be visible on the product page to customers.
The number of free trial days added before a renewal plan.
42
Shows or hides the plan from public/business view.
visible, hidden, archived, quick_link The affiliate code to use for the checkout configuration
The metadata to use for the checkout configuration
"payment"This currently only works for configurations made in 'setup' mode. The explicit payment method configuration for the checkout session. If not provided, the platform or company's defaults will apply.
Show child attributes
An array of payment method identifiers that are explicitly disabled. Only applies if the include_platform_defaults is true.
The different types of payment methods that can be used.
acss_debit, affirm, afterpay_clearpay, alipay, alma, amazon_pay, apple_pay, au_becs_debit, bacs_debit, bancontact, billie, blik, boleto, card, cashapp, crypto, eps, fpx, giropay, google_pay, grabpay, ideal, kakao_pay, klarna, konbini, kr_card, link, mobilepay, multibanco, naver_pay, nz_bank_account, oxxo, p24, pay_by_bank, payco, paynow, pix, promptpay, revolut_pay, samsung_pay, satispay, sepa_debit, sofort, swish, twint, us_bank_account, wechat_pay, zip, bizum, capchase_pay, kriya, mondu, ng_wallet, paypay, sequra, scalapay, vipps, custom, customer_balance, gopay, mb_way, ng_bank, ng_bank_transfer, ng_card, ng_market, ng_ussd, paypal, payto, qris, rechnung, south_korea_market, kr_market, shopeepay, upi, sunbit, netbanking, id_bank_transfer, demo_pay, shop_pay, sezzle, coinbase, splitit, platform_balance, apple, venmo, unknown An array of payment method identifiers that are explicitly enabled. This means these payment methods will be shown on checkout. Example use case is to only enable a specific payment method like cashapp, or extending the platform defaults with additional methods.
The different types of payment methods that can be used.
acss_debit, affirm, afterpay_clearpay, alipay, alma, amazon_pay, apple_pay, au_becs_debit, bacs_debit, bancontact, billie, blik, boleto, card, cashapp, crypto, eps, fpx, giropay, google_pay, grabpay, ideal, kakao_pay, klarna, konbini, kr_card, link, mobilepay, multibanco, naver_pay, nz_bank_account, oxxo, p24, pay_by_bank, payco, paynow, pix, promptpay, revolut_pay, samsung_pay, satispay, sepa_debit, sofort, swish, twint, us_bank_account, wechat_pay, zip, bizum, capchase_pay, kriya, mondu, ng_wallet, paypay, sequra, scalapay, vipps, custom, customer_balance, gopay, mb_way, ng_bank, ng_bank_transfer, ng_card, ng_market, ng_ussd, paypal, payto, qris, rechnung, south_korea_market, kr_market, shopeepay, upi, sunbit, netbanking, id_bank_transfer, demo_pay, shop_pay, sezzle, coinbase, splitit, platform_balance, apple, venmo, unknown Whether Whop's platform default payment method enablement settings are included in this configuration. The full list of default payment methods can be found in the documentation at docs.whop.com/payments.
The URL to redirect the user to after the checkout configuration is created
A successful response
A checkout configuration object.
Can be used to create a reusable custom configuration for a checkout, including attaching plans, affiliates and custom metadata to the checkout.
This configuration can be re-used by multiple users.
All successful payments and memberships resulting from a checkout will contain the passed metadata.The ID of the checkout configuration
"ch_xxxxxxxxxxxxxxx"
The ID of the company to use for the checkout configuration
The mode of the checkout session.
payment, setup The plan to use for the checkout configuration
Show child attributes
The internal ID of the plan.
"plan_xxxxxxxxxxxxx"
Shows or hides the plan from public/business view.
visible, hidden, archived, quick_link Indicates if the plan is a one time payment or recurring.
renewal, one_time This is the release method the business uses to sell this plan.
buy_now, waitlist The respective currency identifier for the plan.
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 The interval at which the plan charges (renewal plans).
42
The interval at which the plan charges (expiration plans).
42
The price a person has to pay for a plan on the initial purchase.
6.9
The price a person has to pay for a plan on the renewal purchase.
6.9
The number of free trial days added before a renewal plan.
42
The affiliate code to use for the checkout configuration
The metadata to use for the checkout configuration
The URL to redirect the user to after the checkout configuration is created
A URL you can send to customers to complete a checkout. It looks like /checkout/plan_xxxx?session={id}
The explicit payment method configuration for the session, if any. This currently only works in 'setup' mode. Use the plan's payment_method_configuration for payment method.
Show child attributes
An array of payment method identifiers that are explicitly enabled. This means these payment methods will be shown on checkout. Example use case is to only enable a specific payment method like cashapp, or extending the platform defaults with additional methods.
The different types of payment methods that can be used.
acss_debit, affirm, afterpay_clearpay, alipay, alma, amazon_pay, apple_pay, au_becs_debit, bacs_debit, bancontact, billie, blik, boleto, card, cashapp, crypto, eps, fpx, giropay, google_pay, grabpay, ideal, kakao_pay, klarna, konbini, kr_card, link, mobilepay, multibanco, naver_pay, nz_bank_account, oxxo, p24, pay_by_bank, payco, paynow, pix, promptpay, revolut_pay, samsung_pay, satispay, sepa_debit, sofort, swish, twint, us_bank_account, wechat_pay, zip, bizum, capchase_pay, kriya, mondu, ng_wallet, paypay, sequra, scalapay, vipps, custom, customer_balance, gopay, mb_way, ng_bank, ng_bank_transfer, ng_card, ng_market, ng_ussd, paypal, payto, qris, rechnung, south_korea_market, kr_market, shopeepay, upi, sunbit, netbanking, id_bank_transfer, demo_pay, shop_pay, sezzle, coinbase, splitit, platform_balance, apple, venmo, unknown An array of payment method identifiers that are explicitly disabled. Only applies if the include_platform_defaults is true.
The different types of payment methods that can be used.
acss_debit, affirm, afterpay_clearpay, alipay, alma, amazon_pay, apple_pay, au_becs_debit, bacs_debit, bancontact, billie, blik, boleto, card, cashapp, crypto, eps, fpx, giropay, google_pay, grabpay, ideal, kakao_pay, klarna, konbini, kr_card, link, mobilepay, multibanco, naver_pay, nz_bank_account, oxxo, p24, pay_by_bank, payco, paynow, pix, promptpay, revolut_pay, samsung_pay, satispay, sepa_debit, sofort, swish, twint, us_bank_account, wechat_pay, zip, bizum, capchase_pay, kriya, mondu, ng_wallet, paypay, sequra, scalapay, vipps, custom, customer_balance, gopay, mb_way, ng_bank, ng_bank_transfer, ng_card, ng_market, ng_ussd, paypal, payto, qris, rechnung, south_korea_market, kr_market, shopeepay, upi, sunbit, netbanking, id_bank_transfer, demo_pay, shop_pay, sezzle, coinbase, splitit, platform_balance, apple, venmo, unknown Whether Whop's platform default payment method enablement settings are included in this configuration. The full list of default payment methods can be found in the documentation at docs.whop.com/payments.
Was this page helpful?