Skip to main content
There is no createSetupIntent endpoint. Setup intents are created indirectly by creating a Checkout Configuration with mode: "setup". The buyer completes that checkout, and Whop creates the setup intent behind the scenes. Listen for the setup_intent.succeeded webhook to receive the payment method ID once it’s saved.See Save payment methods for the full flow.
// Create a setup intent by opening a checkout in setup mode
const checkoutConfiguration = await client.checkoutConfigurations.create({
	company_id: "biz_xxxxxxxxxxxxx",
	mode: "setup",
	redirect_url: "https://yoursite.com/return",
	metadata: { customer_id: "your_internal_id" },
});

// Redirect the buyer to checkoutConfiguration.purchase_url
// or use <WhopCheckoutEmbed sessionId={checkoutConfiguration.id} />.
// Then listen for setup_intent.succeeded on your webhook handler.
{
	"checkout_configuration": {
		"id": "ch_xxxxxxxxxxxxxxx"
	},
	"company": {
		"id": "biz_xxxxxxxxxxxxxx"
	},
	"created_at": "2023-12-01T05:00:00.401Z",
	"error_message": "Your card was declined.",
	"id": "sint_xxxxxxxxxxxxx",
	"member": {
		"id": "<string>",
		"user": {
			"email": "<string>",
			"id": "<string>",
			"name": "<string>",
			"username": "<string>"
		}
	},
	"metadata": {},
	"payment_method": {
		"card": {
			"brand": "mastercard",
			"exp_month": 42,
			"exp_year": 42,
			"last4": "4242"
		},
		"created_at": "2023-12-01T05:00:00.401Z",
		"id": "payt_xxxxxxxxxxxxx",
		"mailing_address": {
			"city": "<string>",
			"country": "<string>",
			"line1": "<string>",
			"line2": "<string>",
			"name": "<string>",
			"postal_code": "<string>",
			"state": "<string>"
		},
		"payment_method_type": "acss_debit"
	},
	"status": "processing"
}
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
SetupIntentStatuses
required
The current status of the setup intent.Available options: processing, succeeded, canceled, requires_action