Skip to main content
POST
Create setup intent

Authorizations

Authorization
string
header
required

An Account API key, account-scoped JWT, App API key, or user OAuth token. Prepend the key or token with Bearer, for example Bearer ***************************.

Body

application/json

Autogenerated input type of CreateSetupIntent

company_id
string
required

The ID of the company to save the payment method for.

Example:

"biz_xxxxxxxxxxxxxx"

confirmation_token
string
required

A confirmation token ID (ctok_) describing a payment method the buyer just supplied. Provide this or payment_method_id, not both.

Example:

"ctok_xxxxxxxxxxxxxx"

currency
enum<string> | null

The currency the saved payment method will be used with. Controls which currency-specific payment methods are available. Defaults to usd.

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,
awg,
whop_usd,
xau
email
string | null

Overrides the buyer email carried on the confirmation token, resolving or creating the Whop user the method belongs to. Ignored when the confirmation token was created by a signed-in buyer, and unless confirmation_token is provided.

Example:

"buyer@example.com"

metadata
object | null

Custom metadata to attach to the setup intent.

return_url
string | null

Where the buyer continues after completing an off-site step. Must be an absolute https URL without credentials, at most 2,048 characters.

Example:

"https://example.com/path"

Response

A successful response

A setup intent allows a user to save a payment method for future use without making an immediate purchase.

checkout_configuration
object | null
required

The checkout session configuration associated with this setup intent. Null if no checkout session was used.

company
object | null
required

The company that initiated this setup intent. Null if the company has been deleted.

created_at
string<date-time>
required

The datetime the setup intent was created.

Example:

"2023-12-01T05:00:00.401Z"

error_message
string | null
required

A human-readable error message explaining why the setup intent failed. Null if no error occurred.

Example:

"Your card was declined."

id
string
required

The unique identifier for the setup intent.

Example:

"sint_xxxxxxxxxxxxx"

member
object | null
required

The company member associated with this setup intent. Null if the user is not a member.

metadata
object | null
required

Custom key-value pairs attached to this setup intent. Null if no metadata was provided.

payment_method
object | null
required

The saved payment method created by this setup intent. Null if the setup has not completed successfully.

status
enum<string>
required

The current status of the setup intent.

Available options:
processing,
succeeded,
canceled,
requires_action
three_ds_verified
boolean
required

Whether 3D Secure authentication was completed when this payment method was set up.