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",
"status": "processing",
"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",
"payment_method_type": "acss_debit",
"card": {
"brand": "mastercard",
"last4": "4242",
"exp_month": 42,
"exp_year": 42
}
},
"metadata": {}
}Retrieves the details of an existing setup intent.
Required permissions:
payment:setup_intent:readmember:basic:readmember:email:readimport 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",
"status": "processing",
"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",
"payment_method_type": "acss_debit",
"card": {
"brand": "mastercard",
"last4": "4242",
"exp_month": 42,
"exp_year": 42
}
},
"metadata": {}
}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 ***************************
The unique identifier of the setup intent.
"sint_xxxxxxxxxxxxx"
A successful response
A setup intent allows a user to save a payment method for future use without making an immediate purchase.
The unique identifier for the setup intent.
"sint_xxxxxxxxxxxxx"
The current status of the setup intent.
processing, succeeded, canceled, requires_action The datetime the setup intent was created.
"2023-12-01T05:00:00.401Z"
A human-readable error message explaining why the setup intent failed. Null if no error occurred.
"Your card was declined."
The company that initiated this setup intent. Null if the company has been deleted.
Show child attributes
The checkout session configuration associated with this setup intent. Null if no checkout session was used.
Show child attributes
The company member associated with this setup intent. Null if the user is not a member.
Show child attributes
The saved payment method created by this setup intent. Null if the setup has not completed successfully.
Show child attributes
Custom key-value pairs attached to this setup intent. Null if no metadata was provided.
Was this page helpful?