import Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const setupIntentListResponse of client.setupIntents.list({
company_id: 'biz_xxxxxxxxxxxxxx',
})) {
console.log(setupIntentListResponse.id);
}{
"data": [
{
"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": {}
}
],
"page_info": {
"end_cursor": "<string>",
"start_cursor": "<string>",
"has_next_page": true,
"has_previous_page": true
}
}Returns a paginated list of setup intents for a company, with optional filtering by creation date. A setup intent securely collects and stores a member’s payment method for future use without charging them immediately.
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
});
// Automatically fetches more pages as needed.
for await (const setupIntentListResponse of client.setupIntents.list({
company_id: 'biz_xxxxxxxxxxxxxx',
})) {
console.log(setupIntentListResponse.id);
}{
"data": [
{
"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": {}
}
],
"page_info": {
"end_cursor": "<string>",
"start_cursor": "<string>",
"has_next_page": true,
"has_previous_page": true
}
}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 ***************************
Returns the elements in the list that come after the specified cursor.
Returns the elements in the list that come before the specified cursor.
Returns the first n elements from the list.
42
Returns the last n elements from the list.
42
The unique identifier of the company to list setup intents for.
"biz_xxxxxxxxxxxxxx"
The sort direction for ordering results, either ascending or descending.
asc, desc Only return setup intents created before this timestamp.
"2023-12-01T05:00:00.401Z"
Only return setup intents created after this timestamp.
"2023-12-01T05:00:00.401Z"
Was this page helpful?