Wallet Management
The Buttrbase Wallet API allows you to manage user wallets, budgets, and transactions.
Get Wallet
Retrieves the wallet for the authenticated user.
* Endpoint: GET /api/wallet
* Authentication: Required
Output: ~~~json { "id": 1, "user_budget": 10000, "platform_contribution": 10000 } ~~~
Set Budget
Sets the budget for the authenticated user's wallet.
* Endpoint: POST /api/wallet/budget
* Input:
~~~json
{ "budget": 15000 }
~~~
Output: ~~~json { "user_budget": 15000 } ~~~
Deposit
Adds funds to the user's wallet.
* Endpoint: POST /api/wallet/deposit
* Input:
~~~json
{ "amount": 5000, "description": "Deposit" }
~~~
Output: ~~~json { "wallet": { "platform_contribution": 15000 }, "transaction": { "amount": 5000, "type": "deposit" } } ~~~
Withdraw
Withdraws funds.
* Endpoint: POST /api/wallet/withdraw
* Input:
~~~json
{ "amount": 2000, "description": "Expense" }
~~~
Output: ~~~json { "wallet": { "platform_contribution": 13000 }, "transaction": { "amount": 2000, "type": "withdrawal" } } ~~~