Create Setup Intent
Changed onSaves a buyer's payment method for later without charging it — one the buyer just supplied through the payment elements in setup mode, or one already on file to re-verify. The setup completes in the background, so the response is the setup intent as created, not its outcome: hand client_secret to the elements' handleNextAction, or poll Retrieve setup status. A buyer's own token holding member:payment_methods:use may create a setup intent for itself from a confirmation token.
Request
- Base URLhttps://api.whop.com/api/v1
- AuthHTTP bearer
Headers
Pins the request to a dated API version.
A unique key that makes this request safe to retry. See Idempotent requests.
Request body
The account to save the payment method for, prefixed biz_.
A confirmation token describing a payment method the buyer just supplied, collected by the payment elements in setup mode. Provide this or payment_method_id, not both. The buyer is resolved from the token's billing email, or from email, and may still have a step to complete — poll Retrieve setup status for what to do next.
The currency the saved payment method will be used with, as a lowercase ISO 4217 code. Controls which currency-specific payment methods are available. Defaults to usd.
Overrides the buyer email carried on the confirmation token, resolving or creating the user the method belongs to. Ignored unless confirmation_token is provided, and when the token was created by a signed-in buyer or the caller is the buyer.
Custom metadata to attach to the setup intent. Returned on the setup intent and its webhooks.
Who the saved payment method belongs to. Pass account_id to save it on the account itself, which needs payment:charge on the account. Pass your own user ID, prefixed user_, to save it on the authenticated user. Omit it to save it on the buyer: the caller when it is the buyer, otherwise the user the confirmation token names. Not available with payment_method_id, which keeps its current owner, or with purpose.
An existing payment method to re-verify and save, prefixed payt_. Provide this or confirmation_token, not both. Not available to a buyer credential.
What the saved payment method will pay for. Set to ads_billing when saving a card to pay for Whop Ads on account_id: the card is verified by Whop Ads, the merchant that charges it, which helps minimize security declines on ad payments, and it requires ad_campaign:create on account_id. Omit it for any other payment method.
Where the buyer continues after completing an off-site step. An absolute https URL without credentials, at most 2,048 characters.
3D Secure behavior for supported on-session card payments. mandate_challenge requires a 3DS challenge before payment processing; mandate_if_required mandates a challenge only when the payment processor requires it; frictionless_if_required uses the regular frictionless 3DS flow. Payments of $1,000 or more use mandate_if_required unless mandate_challenge is selected. Risk and authentication recovery requirements can override the preference. Applies to this setup only, and only while the buyer is present: ignored with payment_method_id, which re-verifies off session. Not available with purpose: ads_billing. Defaults to frictionless_if_required.
Example request
{
"account_id": "biz_xxxxxxxxxxxxxx",
"confirmation_token": "ctok_xxxxxxxxxxxxxx",
"currency": "usd",
"email": "dana@shinetime.example",
"metadata": {
"customer_id": "cus_4417"
},
"owner_id": "biz_xxxxxxxxxxxxxx",
"payment_method_id": "payt_xxxxxxxxxxxxxx",
"purpose": "ads_billing",
"return_url": "https://shinetime.example/billing/saved",
"three_ds_level": "mandate_challenge"
}Response
setup intent created from a confirmation token
The account the payment method is saved for, prefixed biz_.
The checkout configuration this setup was created through, prefixed ch_. Null for a setup created through this API rather than a hosted checkout.
The credential a buyer's surface presents to poll this setup and set its return URL — hand it to the elements' handleNextAction. Only on setups created through this API, and always null in list responses — retrieve the setup intent for it.
When the setup intent was created, as an ISO 8601 timestamp.
Setup intent ID, prefixed sint_.
The buyer's member record on the account, prefixed mber_. Null without the member:basic:read permission, unless the caller is the buyer.
Your own key-value data attached when the setup intent was created.
The saved payment method, prefixed payt_, ready to charge with Create Payment. Null until the setup has succeeded.
The different types of payment methods that can be used.
Where the buyer lands after completing an off-site step, or null to leave them where they are.
How far the setup has got. A 201 or 200 means we answered, not that the method was saved — always branch on this. requires_action — the buyer has a step outstanding; hand client_secret to the elements or poll Retrieve setup status. processing — the processor is deciding. succeeded — the method is saved, and only this one means saved. canceled — abandoned or refused; see last_setup_error.
3D Secure behavior for supported on-session card payments. mandate_challenge requires a 3DS challenge before payment processing; mandate_if_required mandates a challenge only when the payment processor requires it; frictionless_if_required uses the regular frictionless 3DS flow. Payments of $1,000 or more use mandate_if_required unless mandate_challenge is selected. Risk and authentication recovery requirements can override the preference. The setting requested for this setup, or null when unset.
True when the buyer completed 3D Secure while saving this payment method.
When the setup intent was last updated, as an ISO 8601 timestamp.
Example response
{
"account_id": "biz_xxxxxxxxxxxxxx",
"client_secret": "sint_xxxxxxxxxxxxxx_secret_vdefault_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"created_at": "2026-01-01T12:00:00.000Z",
"id": "sint_xxxxxxxxxxxxxx",
"last_setup_error": {
"code": "enrollment_declined",
"message": "The bank declined the enrollment."
},
"member_id": "mber_xxxxxxxxxxxxxx",
"metadata": {
"customer_id": "cus_4417"
},
"payment_instrument": {
"card": {
"brand": "visa",
"exp_month": 10,
"exp_year": 2031,
"issuer_identification_number": "41111111",
"last4": "4242",
"network_transaction_id": "016153570198200"
},
"crypto": {
"token": "eyJhbGciOiJFUzI1NiJ9.xxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxx"
},
"display_name": "Visa •••• 4242",
"icons": {
"card": {
"dark": {
"png_1x": "https://content.whop.com/payment_methods/card/icons/card_dark_30.png",
"png_2x": "https://content.whop.com/payment_methods/card/icons/card_dark_60.png",
"png_4x": "https://content.whop.com/payment_methods/card/icons/card_dark_120.png",
"svg": "https://content.whop.com/payment_methods/card/icons/card_dark.svg"
},
"light": {
"png_1x": "https://content.whop.com/payment_methods/card/icons/card_dark_30.png",
"png_2x": "https://content.whop.com/payment_methods/card/icons/card_dark_60.png",
"png_4x": "https://content.whop.com/payment_methods/card/icons/card_dark_120.png",
"svg": "https://content.whop.com/payment_methods/card/icons/card_dark.svg"
}
},
"square": {
"dark": {
"png_1x": "https://content.whop.com/payment_methods/card/icons/card_dark_30.png",
"png_2x": "https://content.whop.com/payment_methods/card/icons/card_dark_60.png",
"png_4x": "https://content.whop.com/payment_methods/card/icons/card_dark_120.png",
"svg": "https://content.whop.com/payment_methods/card/icons/card_dark.svg"
},
"light": {
"png_1x": "https://content.whop.com/payment_methods/card/icons/card_dark_30.png",
"png_2x": "https://content.whop.com/payment_methods/card/icons/card_dark_60.png",
"png_4x": "https://content.whop.com/payment_methods/card/icons/card_dark_120.png",
"svg": "https://content.whop.com/payment_methods/card/icons/card_dark.svg"
}
}
},
"payment_method_type": "card"
},
"payment_method_id": "payt_xxxxxxxxxxxxxx",
"payment_method_type": "acss_debit",
"return_url": "https://shinetime.example/billing/saved",
"status": "requires_action",
"three_ds_level": "frictionless_if_required",
"updated_at": "2026-01-01T12:00:00.000Z",
"user": {
"badges": [
{
"type": "verified_partner"
}
],
"id": "user_xxxxxxxxxxxxxx",
"name": "Dana Whitfield",
"profile_picture": {
"url": "https://ui-avatars.com/api/"
},
"username": "danawhitfield"
}
}Changes
- info
added the required property
payment_instrument/oneOf[#/components/schemas/PaymentInstrument]/crypto/oneOf[#/components/schemas/PaymentInstrumentCrypto]/deposit_addressto the response with the status - info
added the required property
payment_instrument/oneOf[#/components/schemas/PaymentInstrument]/crypto/oneOf[#/components/schemas/PaymentInstrumentCrypto]/networkto the response with the status - info
added the required property
payment_instrument/oneOf[#/components/schemas/PaymentInstrument]/crypto/oneOf[#/components/schemas/PaymentInstrumentCrypto]/sender_addressto the response with the status
2 more changes in this revision
- info