> ## Documentation Index
> Fetch the complete documentation index at: https://docs.whop.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create setup intent

> Save a buyer's payment method for later without charging it. Provide a confirmation token for a method the buyer just supplied, or an existing payment method to re-verify. The buyer may still have a step to complete — 3D Secure, a hosted enrollment, linking a bank account — so poll the setup intent's status endpoint for what to do next.

Required permissions:
 - `payment:charge`
 - `member:basic:read`
 - `member:email:read`



## OpenAPI

````yaml /openapi/api-v1-stable.json post /setup_intents
openapi: 3.1.0
info:
  description: >-
    The Whop REST API. Please see
    https://docs.whop.com/developer/api/getting-started for more details.
  termsOfService: https://whop.com/tos-developer-api/
  title: Whop API
  version: 1.0.0
  x-api-version-date: '2026-08-10'
servers:
  - description: Production Whop API
    url: https://api.whop.com/api/v1
  - description: Sandbox Whop API
    url: https://sandbox-api.whop.com/api/v1
security: []
tags:
  - description: Products
    name: Products
  - description: Payments
    name: Payments
  - description: Refunds
    name: Refunds
  - description: Disputes
    name: Disputes
  - description: Dispute alerts
    name: Dispute alerts
  - description: Resolution center cases
    name: Resolution center cases
  - description: Checkout configurations
    name: Checkout configurations
  - description: Setup intents
    name: Setup intents
  - description: Payment methods
    name: Payment methods
  - description: Invoices
    name: Invoices
  - description: Promo codes
    name: Promo codes
  - description: Card transactions
    name: Card transactions
  - description: Ledger accounts
    name: Ledger accounts
  - description: Withdrawals
    name: Withdrawals
  - description: Payout methods
    name: Payout methods
  - description: Verifications
    name: Verifications
  - description: Identity profiles
    name: Identity profiles
  - description: Payout accounts
    name: Payout accounts
  - description: Topups
    name: Topups
  - description: Companies
    name: Companies
  - description: Authorized users
    name: Authorized users
  - description: Fee markups
    name: Fee markups
  - description: Members
    name: Members
  - description: Memberships
    name: Memberships
  - description: Leads
    name: Leads
  - description: Entries
    name: Entries
  - description: Shipments
    name: Shipments
  - description: Reviews
    name: Reviews
  - description: Company token transactions
    name: Company token transactions
  - description: Affiliates
    name: Affiliates
  - description: Experiences
    name: Experiences
  - description: Forums
    name: Forums
  - description: Forum posts
    name: Forum posts
  - description: Chat channels
    name: Chat channels
  - description: Support channels
    name: Support channels
  - description: Messages
    name: Messages
  - description: Reactions
    name: Reactions
  - description: Dm members
    name: Dm members
  - description: Dm channels
    name: Dm channels
  - description: Notifications
    name: Notifications
  - description: Courses
    name: Courses
  - description: Course chapters
    name: Course chapters
  - description: Course lessons
    name: Course lessons
  - description: Course students
    name: Course students
  - description: Course lesson interactions
    name: Course lesson interactions
  - description: Apps
    name: Apps
  - description: Webhooks
    name: Webhooks
  - description: App builds
    name: App builds
  - description: Access tokens
    name: Access tokens
  - description: Account links
    name: Account links
  - description: Files
    name: Files
  - description: Ai chats
    name: Ai chats
  - description: Bounties
    name: Bounties
  - description: Stats
    name: Stats
  - description: Conversions
    name: Conversions
  - description: Ad reports
    name: Ad reports
paths:
  /setup_intents:
    post:
      tags:
        - Setup intents
      summary: Create setup intent
      description: >-
        Save a buyer's payment method for later without charging it. Provide a
        confirmation token for a method the buyer just supplied, or an existing
        payment method to re-verify. The buyer may still have a step to complete
        — 3D Secure, a hosted enrollment, linking a bank account — so poll the
        setup intent's status endpoint for what to do next.


        Required permissions:
         - `payment:charge`
         - `member:basic:read`
         - `member:email:read`
      operationId: createSetupIntent
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              description: Parameters for CreateSetupIntent
              oneOf:
                - description: Autogenerated input type of CreateSetupIntent
                  properties:
                    company_id:
                      description: The ID of the company to save the payment method for.
                      example: biz_xxxxxxxxxxxxxx
                      type: string
                    confirmation_token:
                      description: >-
                        A confirmation token ID (ctok_) describing a payment
                        method the buyer just supplied. Provide this or
                        payment_method_id, not both.
                      example: ctok_xxxxxxxxxxxxxx
                      type: string
                    currency:
                      description: >-
                        The currency the saved payment method will be used with.
                        Controls which currency-specific payment methods are
                        available. Defaults to usd.
                      oneOf:
                        - $ref: '#/components/schemas/Currencies'
                        - type: 'null'
                    email:
                      description: >-
                        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.
                      example: buyer@example.com
                      type:
                        - string
                        - 'null'
                    metadata:
                      additionalProperties: true
                      description: Custom metadata to attach to the setup intent.
                      type:
                        - object
                        - 'null'
                    return_url:
                      description: >-
                        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
                      type:
                        - string
                        - 'null'
                  required:
                    - company_id
                    - confirmation_token
                  title: CreateSetupIntentInputWithConfirmationToken
                  type: object
                - description: Autogenerated input type of CreateSetupIntent
                  properties:
                    company_id:
                      description: The ID of the company to save the payment method for.
                      example: biz_xxxxxxxxxxxxxx
                      type: string
                    currency:
                      description: >-
                        The currency the saved payment method will be used with.
                        Controls which currency-specific payment methods are
                        available. Defaults to usd.
                      oneOf:
                        - $ref: '#/components/schemas/Currencies'
                        - type: 'null'
                    email:
                      description: >-
                        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.
                      example: buyer@example.com
                      type:
                        - string
                        - 'null'
                    metadata:
                      additionalProperties: true
                      description: Custom metadata to attach to the setup intent.
                      type:
                        - object
                        - 'null'
                    payment_method_id:
                      description: >-
                        An existing payment method (payt_) to re-verify and
                        save. Provide this or confirmation_token, not both.
                      example: pmt_xxxxxxxxxxxxxx
                      type: string
                    return_url:
                      description: >-
                        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
                      type:
                        - string
                        - 'null'
                  required:
                    - company_id
                    - payment_method_id
                  title: CreateSetupIntentInputWithPaymentMethodId
                  type: object
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                description: >-
                  A setup intent allows a user to save a payment method for
                  future use without making an immediate purchase.
                properties:
                  checkout_configuration:
                    description: >-
                      The checkout session configuration associated with this
                      setup intent. Null if no checkout session was used.
                    properties:
                      id:
                        description: The unique identifier for the checkout session.
                        example: ch_xxxxxxxxxxxxxxx
                        type: string
                    required:
                      - id
                    type:
                      - object
                      - 'null'
                  client_secret:
                    description: >-
                      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.
                    example: sint_xxxxxxxxxxxxxx_secret_v1_xxxx
                    type:
                      - string
                      - 'null'
                  company:
                    description: >-
                      The company that initiated this setup intent. Null if the
                      company has been deleted.
                    properties:
                      id:
                        description: The unique identifier for the company.
                        example: biz_xxxxxxxxxxxxxx
                        type: string
                    required:
                      - id
                    type:
                      - object
                      - 'null'
                  created_at:
                    description: The datetime the setup intent was created.
                    example: '2023-12-01T05:00:00.401Z'
                    format: date-time
                    type: string
                  error_message:
                    description: >-
                      A human-readable error message explaining why the setup
                      intent failed. Null if no error occurred.
                    example: Your card was declined.
                    type:
                      - string
                      - 'null'
                  id:
                    description: The unique identifier for the setup intent.
                    example: sint_xxxxxxxxxxxxx
                    type: string
                  member:
                    description: >-
                      The company member associated with this setup intent. Null
                      if the user is not a member.
                    properties:
                      id:
                        description: The unique identifier for the company member.
                        type: string
                      user:
                        description: The user for this member, if any.
                        properties:
                          email:
                            description: The digital mailing address of the user.
                            type:
                              - string
                              - 'null'
                          id:
                            description: The unique identifier for the company member user.
                            type: string
                          name:
                            description: The user's full name.
                            type:
                              - string
                              - 'null'
                          username:
                            description: The whop username.
                            type: string
                        required:
                          - id
                          - email
                          - name
                          - username
                        type:
                          - object
                          - 'null'
                    required:
                      - id
                      - user
                    type:
                      - object
                      - 'null'
                  metadata:
                    additionalProperties: true
                    description: >-
                      Custom key-value pairs attached to this setup intent. Null
                      if no metadata was provided.
                    type:
                      - object
                      - 'null'
                  payment_method:
                    description: >-
                      The saved payment method created by this setup intent.
                      Null if the setup has not completed successfully.
                    properties:
                      card:
                        description: >-
                          The card data associated with the payment method, if
                          its a debit or credit card.
                        properties:
                          brand:
                            description: >-
                              The card network (e.g., visa, mastercard, amex).
                              Null if the brand could not be determined.
                            oneOf:
                              - $ref: '#/components/schemas/CardBrands'
                              - type: 'null'
                          exp_month:
                            description: >-
                              The two-digit expiration month of the card (1-12).
                              Null if not available.
                            example: 42
                            type:
                              - integer
                              - 'null'
                          exp_year:
                            description: >-
                              The two-digit expiration year of the card (e.g.,
                              27 for 2027). Null if not available.
                            example: 42
                            type:
                              - integer
                              - 'null'
                          last4:
                            description: >-
                              The last four digits of the card number. Null if
                              not available.
                            example: '4242'
                            type:
                              - string
                              - 'null'
                        required:
                          - brand
                          - last4
                          - exp_month
                          - exp_year
                        type:
                          - object
                          - 'null'
                      created_at:
                        description: The datetime the payment token was created.
                        example: '2023-12-01T05:00:00.401Z'
                        format: date-time
                        type: string
                      id:
                        description: The unique identifier for the payment token.
                        example: payt_xxxxxxxxxxxxx
                        type: string
                      mailing_address:
                        description: >-
                          The mailing address associated with the payment
                          method's user
                        properties:
                          city:
                            description: The city of the address.
                            type:
                              - string
                              - 'null'
                          country:
                            description: The country of the address.
                            type:
                              - string
                              - 'null'
                          line1:
                            description: The line 1 of the address.
                            type:
                              - string
                              - 'null'
                          line2:
                            description: The line 2 of the address.
                            type:
                              - string
                              - 'null'
                          name:
                            description: The name of the customer.
                            type:
                              - string
                              - 'null'
                          postal_code:
                            description: The postal code of the address.
                            type:
                              - string
                              - 'null'
                          state:
                            description: The state of the address.
                            type:
                              - string
                              - 'null'
                        required:
                          - name
                          - line1
                          - line2
                          - city
                          - state
                          - postal_code
                          - country
                        type:
                          - object
                          - 'null'
                      payment_method_type:
                        $ref: '#/components/schemas/PaymentMethodTypes'
                        description: The payment method type of the payment method
                    required:
                      - id
                      - created_at
                      - payment_method_type
                      - card
                      - mailing_address
                    type:
                      - object
                      - 'null'
                  status:
                    $ref: '#/components/schemas/SetupIntentStatuses'
                    description: The current status of the setup intent.
                  three_ds_verified:
                    description: >-
                      Whether 3D Secure authentication was completed when this
                      payment method was set up.
                    type: boolean
                required:
                  - id
                  - status
                  - created_at
                  - error_message
                  - company
                  - checkout_configuration
                  - member
                  - payment_method
                  - metadata
                  - three_ds_verified
                  - client_secret
                type: object
          description: A successful response
        '400':
          content:
            application/json:
              example:
                error:
                  code: parameter_missing
                  message: 'Missing required parameter: amount.'
                  param: amount
                  type: invalid_request_error
              schema:
                properties:
                  error:
                    properties:
                      code:
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                        type:
                          - string
                          - 'null'
                      message:
                        type: string
                      param:
                        description: The parameter that caused the error, if applicable
                        type:
                          - string
                          - 'null'
                      type:
                        type: string
                    required:
                      - type
                      - message
                    type: object
                required:
                  - error
                type: object
          description: Bad request
        '401':
          content:
            application/json:
              example:
                error:
                  message: Invalid or missing API key
                  type: unauthorized
              schema:
                properties:
                  error:
                    properties:
                      code:
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                        type:
                          - string
                          - 'null'
                      message:
                        type: string
                      param:
                        description: The parameter that caused the error, if applicable
                        type:
                          - string
                          - 'null'
                      type:
                        type: string
                    required:
                      - type
                      - message
                    type: object
                required:
                  - error
                type: object
          description: Unauthorized
        '403':
          content:
            application/json:
              example:
                error:
                  message: You do not have permission to access this resource
                  type: forbidden
              schema:
                properties:
                  error:
                    properties:
                      code:
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                        type:
                          - string
                          - 'null'
                      message:
                        type: string
                      param:
                        description: The parameter that caused the error, if applicable
                        type:
                          - string
                          - 'null'
                      type:
                        type: string
                    required:
                      - type
                      - message
                    type: object
                required:
                  - error
                type: object
          description: Forbidden
        '404':
          content:
            application/json:
              example:
                error:
                  message: Resource not found
                  type: not_found
              schema:
                properties:
                  error:
                    properties:
                      code:
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                        type:
                          - string
                          - 'null'
                      message:
                        type: string
                      param:
                        description: The parameter that caused the error, if applicable
                        type:
                          - string
                          - 'null'
                      type:
                        type: string
                    required:
                      - type
                      - message
                    type: object
                required:
                  - error
                type: object
          description: Not found
        '422':
          content:
            application/json:
              example:
                error: null
              schema:
                properties:
                  error:
                    properties:
                      code:
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                        type:
                          - string
                          - 'null'
                      message:
                        type: string
                      param:
                        description: The parameter that caused the error, if applicable
                        type:
                          - string
                          - 'null'
                      type:
                        type: string
                    required:
                      - type
                      - message
                    type: object
                required:
                  - error
                type: object
          description: Verification required
        '429':
          content:
            application/json:
              example:
                error: null
              schema:
                properties:
                  error:
                    properties:
                      code:
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                        type:
                          - string
                          - 'null'
                      message:
                        type: string
                      param:
                        description: The parameter that caused the error, if applicable
                        type:
                          - string
                          - 'null'
                      type:
                        type: string
                    required:
                      - type
                      - message
                    type: object
                required:
                  - error
                type: object
          description: Too many requests
        '500':
          content:
            application/json:
              example:
                error:
                  message: An unexpected error occurred
                  type: internal_server_error
              schema:
                properties:
                  error:
                    properties:
                      code:
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                        type:
                          - string
                          - 'null'
                      message:
                        type: string
                      param:
                        description: The parameter that caused the error, if applicable
                        type:
                          - string
                          - 'null'
                      type:
                        type: string
                    required:
                      - type
                      - message
                    type: object
                required:
                  - error
                type: object
          description: Internal server error
      security:
        - bearerAuth:
            - payment:charge
            - member:basic:read
            - member:email:read
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Whop from '@whop/sdk';

            const client = new Whop({
              apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
            });

            const setupIntent = await client.setupIntents.create({
              company_id: 'biz_xxxxxxxxxxxxxx',
              confirmation_token: 'ctok_xxxxxxxxxxxxxx',
            });

            console.log(setupIntent.id);
components:
  schemas:
    Currencies:
      description: The available currencies on the platform
      enum:
        - 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
      type: string
    CardBrands:
      description: Possible card brands that a payment token can have
      enum:
        - mastercard
        - visa
        - amex
        - discover
        - unionpay
        - jcb
        - diners
        - link
        - troy
        - visadankort
        - visabancontact
        - china_union_pay
        - rupay
        - jcbrupay
        - elo
        - maestro
        - tarjeta_naranja
        - cirrus
        - nspk_mir
        - verve
        - ebt
        - private_label
        - local_brand
        - uatp
        - wexcard
        - uzcard
        - meeza
        - hrg_store_card
        - girocard
        - fuel_card
        - dankort
        - carnet
        - atm_card
        - china_union_payuzcard
        - codensa
        - cabal
        - hipercard
        - jcblankapay
        - cmi
        - aura
        - unknown
      type: string
    PaymentMethodTypes:
      description: The different types of payment methods that can be used.
      enum:
        - acss_debit
        - affirm
        - afterpay_clearpay
        - alipay
        - alma
        - amazon_pay
        - apple
        - apple_pay
        - au_bank_transfer
        - au_becs_debit
        - bacs_debit
        - bancolombia
        - bancontact
        - bank_wire
        - billie
        - bizum
        - blik
        - boleto
        - bre_b
        - ca_bank_transfer
        - capchase_pay
        - card
        - card_installments_three
        - card_installments_six
        - card_installments_twelve
        - cashapp
        - claritypay
        - coinbase
        - crypto
        - custom
        - customer_balance
        - demo_pay
        - efecty
        - eps
        - eu_bank_transfer
        - fpx
        - gb_bank_transfer
        - giropay
        - google_pay
        - gopay
        - grabpay
        - id_bank_transfer
        - ideal
        - interac
        - kakao_pay
        - klarna
        - klarna_pay_now
        - konbini
        - kr_card
        - kr_market
        - kriya
        - kueski
        - link
        - mb_way
        - m_pesa
        - mercado_pago
        - mobilepay
        - mondu
        - multibanco
        - naver_pay
        - nequi
        - netbanking
        - ng_bank
        - ng_bank_transfer
        - ng_card
        - ng_market
        - ng_ussd
        - ng_wallet
        - nz_bank_account
        - oxxo
        - p24
        - pago_efectivo
        - pse
        - pay_by_bank
        - payco
        - paynow
        - paypal
        - paypay
        - payto
        - pix
        - platform_balance
        - promptpay
        - qris
        - rechnung
        - revolut_pay
        - samsung_pay
        - satispay
        - scalapay
        - sencillito
        - sepa_debit
        - sequra
        - servipag
        - sezzle
        - shop_pay
        - shopeepay
        - sofort
        - south_korea_market
        - spei
        - splitit
        - sunbit
        - swish
        - tamara
        - twint
        - upi
        - us_bank_account
        - us_bank_transfer
        - venmo
        - vipps
        - webpay
        - wechat_pay
        - yape
        - zip
        - coinflow
        - unknown
      type: string
    SetupIntentStatuses:
      description: The status of the setup intent.
      enum:
        - processing
        - succeeded
        - canceled
        - requires_action
      type: string
  securitySchemes:
    bearerAuth:
      bearerFormat: auth-scheme
      description: >-
        An Account API key, account-scoped JWT, App API key, or user OAuth
        token. Prepend the key or token with `Bearer`, for example `Bearer
        ***************************`.
      scheme: bearer
      type: http

````