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 companyTokenTransactionListResponse of client.companyTokenTransactions.list({
company_id: 'biz_xxxxxxxxxxxxxx',
})) {
console.log(companyTokenTransactionListResponse.id);
}{
"data": [
{
"id": "<string>",
"transaction_type": "add",
"amount": 6.9,
"description": "Reward for completing onboarding",
"created_at": "2023-12-01T05:00:00.401Z",
"linked_transaction_id": "<string>",
"idempotency_key": "txn_reward_usr_123_2024",
"user": {
"id": "user_xxxxxxxxxxxxx",
"name": "John Doe",
"username": "johndoe42"
},
"member": {
"id": "<string>"
},
"company": {
"id": "biz_xxxxxxxxxxxxxx",
"title": "<string>",
"route": "<string>"
}
}
],
"page_info": {
"end_cursor": "<string>",
"start_cursor": "<string>",
"has_next_page": true,
"has_previous_page": true
}
}Returns a paginated list of token transactions for a user or company, depending on the authenticated actor, with optional filtering by user and transaction type.
Required permissions:
company_token_transaction:readmember:basic:readcompany:basic: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 companyTokenTransactionListResponse of client.companyTokenTransactions.list({
company_id: 'biz_xxxxxxxxxxxxxx',
})) {
console.log(companyTokenTransactionListResponse.id);
}{
"data": [
{
"id": "<string>",
"transaction_type": "add",
"amount": 6.9,
"description": "Reward for completing onboarding",
"created_at": "2023-12-01T05:00:00.401Z",
"linked_transaction_id": "<string>",
"idempotency_key": "txn_reward_usr_123_2024",
"user": {
"id": "user_xxxxxxxxxxxxx",
"name": "John Doe",
"username": "johndoe42"
},
"member": {
"id": "<string>"
},
"company": {
"id": "biz_xxxxxxxxxxxxxx",
"title": "<string>",
"route": "<string>"
}
}
],
"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 token transactions for.
"biz_xxxxxxxxxxxxxx"
Filter transactions to only those involving this specific user.
"user_xxxxxxxxxxxxx"
Filter transactions by type.
add, subtract, transfer Was this page helpful?