POST
/
v2
/
checkout_sessions
curl --request POST \
  --url https://api.whop.com/api/v2/checkout_sessions \
  --header 'Content-Type: application/json' \
  --data '{
  "plan_id": "<string>",
  "affiliate_code": "<string>",
  "redirect_url": "<string>",
  "metadata": {}
}'
{
  "id": "<string>",
  "redirect_url": "<string>",
  "affiliate_code": "<string>",
  "metadata": {},
  "plan_id": "<string>",
  "purchase_url": "<string>"
}

Headers

Authorization
string

Your API key, which can be found on the Whop Business Dashboard. You must prepend your key with the word 'Bearer', which will look like Bearer ***************************

Body

application/json
plan_id
string
required

The ID of the plan that the checkout session is associated with, which will look like plan_*************

affiliate_code
string

The code to apply as the affiliate for the transaction. Codes are a User object's username field.

redirect_url
string

The URL the user will be navigated to after successfully completing a checkout with this session

metadata
object

The metadata that will be attached to the Membership upon successful purchase.

Response

201 - application/json
id
string

The ID of the session, which will look like ch_*************

redirect_url
string

The URL the user will be navigated to after successfully completing a checkout with this session

affiliate_code
string

The code to apply as the affiliate for the transaction. Codes are a User object's username field.

metadata
object

The metadata that will be attached to the Membership upon successful purchase.

plan_id
string

The ID of the plan that the checkout session is associated with, which will look like plan_*************

purchase_url
string

The URL that the customer can use to purchase with this checkout session.