Skip to main content
GET
/
setup_intents
/
{id}
JavaScript
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.retrieve('sint_xxxxxxxxxxxxx');

console.log(setupIntent.id);
{
  "id": "sint_xxxxxxxxxxxxx",
  "created_at": "2023-12-01T05:00:00.401Z",
  "error_message": "Your card was declined.",
  "company": {
    "id": "biz_xxxxxxxxxxxxxx"
  },
  "checkout_configuration": {
    "id": "ch_xxxxxxxxxxxxxxx"
  },
  "member": {
    "id": "<string>",
    "user": {
      "id": "<string>",
      "email": "<string>",
      "name": "<string>",
      "username": "<string>"
    }
  },
  "payment_method": {
    "id": "payt_xxxxxxxxxxxxx",
    "created_at": "2023-12-01T05:00:00.401Z",
    "card": {
      "last4": "4242",
      "exp_month": 42,
      "exp_year": 42
    },
    "mailing_address": {
      "name": "<string>",
      "line1": "<string>",
      "line2": "<string>",
      "city": "<string>",
      "state": "<string>",
      "postal_code": "<string>",
      "country": "<string>"
    }
  },
  "metadata": {},
  "three_ds_verified": true
}

Authorizations

Authorization
string
header
required

A company API key, company scoped JWT, app API key, or user OAuth token. You must prepend your key/token with the word 'Bearer', which will look like Bearer ***************************

Path Parameters

id
string
required

The unique identifier of the setup intent.

Example:

"sint_xxxxxxxxxxxxx"

Response

A successful response

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

id
string
required

The unique identifier for the setup intent.

Example:

"sint_xxxxxxxxxxxxx"

status
enum<string>
required

The current status of the setup intent.

Available options:
processing,
succeeded,
canceled,
requires_action
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."

company
object | null
required

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

checkout_configuration
object | null
required

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

member
object | null
required

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

payment_method
object | null
required

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

metadata
object | null
required

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

three_ds_verified
boolean
required

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