Stablecoin Wallets, Swaps and Payouts
Use Klasha's stablecoin APIs to provision business wallet addresses, price and initiate stablecoin payouts, and quote and confirm stablecoin swaps.
Integration steps
provision a business stablecoin wallet and fetch its deposit addresses
validate a destination wallet address and fetch fees before you send
initiate a business stablecoin payout and track it to completion
generate a swap quote and confirm it to move between fiat and stablecoins, or between
USDTandUSDC
Coverage
Supported stablecoins
USDTUSDC
Supported networks
ERC20TRC20BEP20
Before you begin
Create and verify your Klasha account.
Generate your merchant public key from the dashboard.
Generate a bearer token from the authentication API.
Retrieve your merchant encryption key. Some endpoints below require an encrypted
messagepayload; others accept plain JSON — check each endpoint's Request body section before integrating.
Encryption requirements vary per endpoint in this flow. Wallet creation/lookup and v2/create-payout accept plain JSON; create-payout (v1), create-swap, and confirm-swap require an encrypted message body using your merchant encryption key. The encryption algorithm can be gotten here.
Generate a bearer token
Use the authentication API here to generate a bearer token and set your Authorization header to the token obtained. Most requests below also require the headers listed here.
Authorization
Bearer {{token}}
x-auth-token
Your merchant public key — required on business (B2B) endpoints
Content-Type
application/json
Create a stablecoin wallet
Create a stablecoin wallet for a business and provision network-specific deposit addresses.
POST
{{env_url}}/wallet/stable-coin/create-wallet
Request body
businessId*
Number
Klasha business ID.
currencyCode*
String
USDT or USDC. If omitted, Klasha provisions both stablecoins.
Example request
Example response
Notes
If the wallet already exists, the API returns the existing addresses and only creates missing networks.
Get a business stablecoin wallet
Fetch previously provisioned addresses for a business wallet.
GET
{{env_url}}/wallet/stable-coin/get-wallet?currency={{currency}}
Query params
currency*
String
USDT or USDC
Example response
Validate a destination wallet address
Validate a destination address before you initiate a payout. This endpoint is shared across B2B and B2C integrations.
POST
{{env_url}}/wallet/stable-coin/validate-address
Request body
currency*
String
USDT or USDC
network*
String
ERC20, TRC20, or BEP20
address*
String
Wallet address to validate
Example request
Get stablecoin fees
Retrieve the pricing Klasha will apply to stablecoin receive, payout, and swap flows. This endpoint is also shared across B2B and B2C integrations.
GET
{{env_url}}/wallet/stable-coin/fees?currency={{currency}}&amount={{amount}}&flow={{flow}}&network={{network}}
Query params
currency*
String
USDT or USDC
amount*
String
Amount to price
flow
String
Defaults to payout. Supported values: receive (aliases: topup, deposit), send (aliases: payout, transfer), fiat-to-stablecoin, stablecoin-to-fiat
network
String
Recommended for payout pricing — fees can be network-specific
Example response
Notes
totalDebitis the full amount debited from the wallet for a payout.fiat-to-stablecoinandstablecoin-to-fiatare priced with the same swap fee — only the label differs by direction.
B2B stablecoin payout
Use this flow to send USDT or USDC from a business wallet to an external wallet address.
Integration steps
Validate the destination address.
Fetch the expected fee.
Initiate the payout.
Track status via your webhook, or query by
requestId.
Initiate a payout
Encrypted request version:
POST
{{env_url}}/wallet/stable-coin/create-payout
Plain JSON version:
POST
{{env_url}}/wallet/stable-coin/v2/create-payout
Request body (plain payload shown; the encrypted variant sends this same payload as an encrypted message string)
currency*
String
USDT or USDC
amount*
String
Amount to send
narration*
String
Payout description
requestId*
String
Unique payout reference. Re-sending the same requestId returns the existing payout instead of creating a new one.
walletDestinationAddress*
String
Recipient stablecoin address
network
String
ERC20, TRC20, or BEP20. Strongly recommended for routing and fee calculation.
Example request (v2, plain JSON)
Example response
Notes
Klasha validates wallet balance before debit and returns an error if
amount + feeexceeds the available balance.The initial response is an accepted payout request, not a final result — provider completion happens asynchronously and is delivered to your configured webhook URL.
payoutStatusmoves throughPENDING→IN_PROGRESS→ a terminal state (SUCCESSFUL,FAILED,CANCELLED, orREVERSED). Your webhook fires on the terminal states.
Polling payout status by requestId is not fully reliable in the current environment. We recommend relying on the create-payout response plus your webhook events for payout status, rather than the query-by-reference endpoint below, until this is confirmed stable.
Query a payout
Fetch the current state of a previously created stablecoin payout.
POST
{{env_url}}/wallet/stable-coin/get-payout?requestId={{requestId}}
Query params
requestId*
String
The same requestId used when the payout was created
B2B stablecoin swap
Use this flow to:
swap fiat to stablecoin
swap stablecoin to fiat
swap
USDTtoUSDCswap
USDCtoUSDT
Generate a quote
POST
{{env_url}}/wallet/stable-coin/create-swap
This endpoint expects an encrypted message body. The plain payload before encryption looks like this:
sourceCurrency*
String
Wallet currency to debit
destinationCurrency*
String
Wallet currency to credit
sourceAmount
String
Amount to debit when mode is SOURCE
destinationAmount
String
Amount to receive when mode is DESTINATION
mode*
String
SOURCE or DESTINATION
Example plain quote payload
Example quote response
Confirm a swap
POST
{{env_url}}/wallet/stable-coin/confirm-swap
This endpoint also expects an encrypted message body.
Request body
quoteToken*
String
Quote token returned by the quote API
Example plain request
Notes
Transaction status values:
PENDING,PROCESSING,SUCCESSFUL,FAILED,CANCELLED,REVERSED,PENDING_REVERSAL.A quote becomes unusable once it has been consumed by a successful confirm, or if the market rate has moved since the quote was generated — confirm will return a rate-changed error in that case. Quotes do not expire on a fixed timer.
Generate a fresh quote via Generate a quote if a confirm attempt fails due to a rate change.
Query a swap
Fetch a swap by reference.
POST
{{env_url}}/wallet/stable-coin/get-swap
Request body
requestId*
String
Use the transactionReference returned from the quote API
Example request
Last updated
