Create company token transaction
Changed onCreates a token transaction that adds, subtracts, or transfers tokens for a member of an account.
Required permissions:
- company_token_transaction:create
- member:basic:read
- company:basic:read
Request
- Base URLhttps://api.whop.com/api/v1
- AuthHTTP bearer
Request body
Parameters for CreateCompanyTokenTransaction
Autogenerated input type of CreateCompanyTokenTransaction
Autogenerated input type of CreateCompanyTokenTransaction
Autogenerated input type of CreateCompanyTokenTransaction
Example request
{
"account_id": "biz_xxxxxxxxxxxxxx",
"amount": 6.9,
"user_id": "user_xxxxxxxxxxxxx"
}Response
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 token amount for this transaction. Always a positive value regardless of transaction type.
The company whose token balance this transaction affects.
The datetime the company token transaction was created.
Free-text description explaining the reason for this token transaction. Null if no description was provided.
The unique identifier for the company token transaction.
A unique key used to prevent duplicate transactions when retrying API requests. Null if no idempotency key was provided.
The ID of the corresponding transaction on the other side of a transfer. Null if this is not a transfer transaction.
The member whose token balance was affected by this transaction.
The direction of this token transaction (add, subtract, or transfer).
The user whose token balance was affected by this transaction.
Example response
{
"amount": 6.9,
"company": {
"id": "biz_xxxxxxxxxxxxxx"
},
"created_at": "2023-12-01T05:00:00.401Z",
"description": "Reward for completing onboarding",
"idempotency_key": "txn_reward_usr_123_2024",
"user": {
"id": "user_xxxxxxxxxxxxx",
"name": "Marcus Webb",
"username": "marcuswebb"
}
}Changes
- breaking
added the new required request property
oneOf[subschema #1: CreateCompanyTokenTransactionInputTransactionTypeTransfer]/account_id - breaking
added the new required request property
oneOf[subschema #2: CreateCompanyTokenTransactionInputTransactionTypeAdd]/account_id - breaking
added the new required request property
oneOf[subschema #3: CreateCompanyTokenTransactionInputTransactionTypeSubtract]/account_id
3 more changes in this revision
- breaking