Skip to main content
POST
Create setup intent
This page documents the Legacy API. For new integrations, use Create Setup Intent in the Current API.
Required permissions:
  • payment:charge
  • member:basic:read
  • member:email:read

인증

Authorization
string
header
필수

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

Scopes

payment:charge
member:basic:read
member:email:read

본문

application/json

Autogenerated input type of CreateSetupIntent

account_id
string
필수

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

예시:

"biz_xxxxxxxxxxxxxx"

confirmation_token
string
필수

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

예시:

"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.

사용 가능한 옵션:
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,
hnl
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 caller IS the buyer or the confirmation token was created by a signed-in buyer, and unless confirmation_token is provided.

예시:

"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 (http is allowed for localhost), at most 2,048 characters.

예시:

"https://example.com/path"

응답

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
필수

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

client_secret
string | null
필수

The credential the buyer's surface presents to poll this setup intent and set its return URL. Returned when the setup is created and still has something to finish — hold on to it, because a later read will not repeat it. Null when the setup settled on the spot and there is nothing left to authorize. It unlocks this setup intent and nothing else; treat it like a password for that one attempt.

예시:

"sint_xxxxxxxxxxxxxx_secret_v1_xxxx"

company
object | null
필수

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

created_at
string<date-time>
필수

The datetime the setup intent was created.

예시:

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

error_message
string | null
필수

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

예시:

"Your card was declined."

id
string
필수

The unique identifier for the setup intent.

예시:

"sint_xxxxxxxxxxxxx"

member
object | null
필수

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

metadata
object | null
필수

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

payment_method
object | null
필수

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

status
enum<string>
필수

The current status of the setup intent.

사용 가능한 옵션:
processing,
succeeded,
canceled,
requires_action
three_ds_verified
boolean
필수

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