Skip to main content
POST
/
checkout_configurations
JavaScript
import Whopsdk from 'whopsdk';

const client = new Whopsdk({
  apiKey: 'My API Key',
});

const checkoutConfiguration = await client.checkoutConfigurations.create();

console.log(checkoutConfiguration.id);
{
  "id": "ch_xxxxxxxxxxxxxxx",
  "company_id": "<string>",
  "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>"
}

Authorizations

Authorization
string
header
required

The app API key from an app from the /dashboard/developer page

Body

application/json

Parameters for CreateCheckoutSession

plan
object | null

Pass this object to create a new plan for this checkout session

plan_id
string | null

The ID of the plan to use for the checkout session

Example:

"plan_xxxxxxxxxxxxx"

affiliate_code
string | null

The affiliate code to use for the checkout session

metadata
object | null

The metadata to use for the checkout session

redirect_url
string | null

The URL to redirect the user to after the checkout session is created

Response

A successful response

A checkout session

id
string
required

The ID of the checkout session

Example:

"ch_xxxxxxxxxxxxxxx"

company_id
string
required

The ID of the company to use for the checkout session

plan
object
required

The plan to use for the checkout session

affiliate_code
string
required

The affiliate code to use for the checkout session

metadata
object
required

The metadata to use for the checkout session

redirect_url
string
required

The URL to redirect the user to after the checkout session is created

purchase_url
string
required

The URL to redirect the user to after the checkout session is created

I