import Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
const companyTokenTransaction = await client.companyTokenTransactions.retrieve('id');
console.log(companyTokenTransaction.id);{
"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>"
}
}Retrieves the details of an existing company token transaction.
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
});
const companyTokenTransaction = await client.companyTokenTransactions.retrieve('id');
console.log(companyTokenTransaction.id);{
"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>"
}
}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 token transaction to retrieve.
A successful response
A token transaction records a credit or debit to a member's token balance within a company, including transfers between members.
The unique identifier for the company token transaction.
The direction of this token transaction (add, subtract, or transfer).
add, subtract, transfer The token amount for this transaction. Always a positive value regardless of transaction type.
6.9
Free-text description explaining the reason for this token transaction. Null if no description was provided.
"Reward for completing onboarding"
The datetime the company token transaction was created.
"2023-12-01T05:00:00.401Z"
The ID of the corresponding transaction on the other side of a transfer. Null if this is not a transfer transaction.
A unique key used to prevent duplicate transactions when retrying API requests. Null if no idempotency key was provided.
"txn_reward_usr_123_2024"
The user whose token balance was affected by this transaction.
Show child attributes
The member whose token balance was affected by this transaction.
Show child attributes
The company whose token balance this transaction affects.
Show child attributes
Was this page helpful?