Limited Release
Billing credits management helps you control customer credit balances and wallet operations. Managing billing credits means you handle wallet transactions and wallet settings. This makes sure customers have enough credits to pay for their usage charges. It also helps you keep good financial records.
Manage credit transactions
You can perform the following credit transaction operations:Add credits to wallet
You can add credits when a customer buys more credits or gets free promotional credits. Use a valid access token and make a POST call to the/v1/commerce/billing/wallets/{wallet_id}/wallet-transactions endpoint. Include the following parameters:
Path parameter: wallet_id is the id returned when you created a wallet.
| Parameter | Action |
|---|---|
typeRequired, string | Set to TOPUP to add credits. |
paid_creditsstring | Set the number of paid credits to add. Must be a positive value. |
granted_creditsstring | Set the number of granted (promotional) credits to add. Must be a positive value. |
metadataarray | Provide optional metadata for tracking purposes. Each object contains key and value pairs. |
200 OK response with an array of wallet transactions.
Remove credits from wallet
You do this to give refunds, fix billing mistakes, or remove expired promotional credits. Use a valid access token and make a POST call to the/v1/commerce/billing/wallets/{wallet_id}/wallet-transactions endpoint. Include the following parameters:
Path parameter: wallet_id is the id returned when you created a wallet.
| Parameter | Action |
|---|---|
typeRequired, string | Set to VOID to remove credits. |
credits_to_voidRequired, string | Set the number of credits to remove. Must be a positive value. |
metadataarray | Provide optional metadata for tracking purposes. Each object contains key and value pairs. |
200 OK response with an array of wallet transactions.
Get transaction history
You can get a wallet’s transaction history to audit credit movements and reconcile balances. Use a valid access token and make a GET call to the/v1/commerce/billing/wallets/{wallet_id}/wallet-transactions endpoint.
Path parameter: wallet_id is the id returned when you created a wallet.
For information on all parameters, see API reference.
200 OK response with an array of wallet transactions.
Manage wallets
You can perform the following wallet management operations:List wallets
You can view customer wallet collections, find wallets by specific criteria, or create reports across multiple wallets. Use a valid access token and make a GET call to the/v1/commerce/billing/wallets endpoint.
For information on all parameters, see API reference.
200 OK response with an array of wallets.
Get wallet details
You can check current balances, track how customers use credits, or verify wallet status and perform further wallet actions. Use a valid access token and make a GET call to the/v1/commerce/billing/wallets/{wallet_id} endpoint.
Path parameter: wallet_id is the id returned when you created a wallet.
200 OK response with the wallet details.
Update wallet
You can change wallet expiration dates, modify which charges can use credits, or update automatic top-up rules. Use a valid access token and make a PUT call to the/v1/commerce/billing/wallets/{wallet_id} endpoint with the modified parameters.
Path parameter: wallet_id is the id returned when you created a wallet.
For information on all parameters, see API reference.
200 OK response with the updated wallet information.
Terminate wallet
You can close a wallet to stop unauthorized credit use. You can also turn off wallets that still have credits. You cannot reactivate a terminated wallet. Use a valid access token and make a DELETE call to the/v1/commerce/billing/wallets/{wallet_id} endpoint.
Path parameter: wallet_id is the id returned when you created a wallet.
200 OK response with the terminated wallet details.