Before you start
Blaaiz must enable Crypto API access for your business. Your business must have an approved KYB status before it creates a crypto wallet, swap, or payout. Your business must also be eligible for crypto swaps and payouts. Create OAuth credentials with the Crypto scopes. Request the same individual scopes when you get an access token.
The
crypto credential bundle includes these six scopes.
Use a crypto amount
Send each cryptoamount as a JSON string. Do not send a JSON number.
The amount can have up to 18 decimal places. The smallest accepted amount is 0.00000001.
Create a crypto wallet
Create one crypto wallet for each asset that your business needs.- Call List crypto assets.
- Choose an active asset and network.
- Call Create a crypto wallet.
- Save the returned wallet ID.
crypto_currency_id or crypto_currency_symbol. Do not send both values.
Use List crypto wallets to get all crypto wallets for your business.
Use Get a crypto wallet to get one wallet.
Get a deposit address
Use a deposit address only with the network shown in the response.- Call List crypto wallet addresses.
- Choose the address that matches the asset and network.
- Give the address and network to the sender.
Swap wallet balances
A crypto swap moves value between two wallets that belong to your business. The source wallet and destination wallet can be crypto wallets, fiat wallets, or one of each. Supported swaps are:- Crypto to crypto.
- Crypto to fiat.
- Fiat to crypto.
- Get the source wallet ID.
- Get the destination wallet ID.
- Send Create a crypto swap.
- Get the returned transaction IDs to get transaction details.
Send an on-chain crypto payout
A crypto payout sends crypto from a business crypto wallet to an external blockchain address. The source wallet must be a crypto wallet that belongs to your business. The destination address must not belong to a Blaaiz user or business wallet.- Call List crypto assets.
- Choose an active token and network.
- Check the destination address and network.
- Send Create a crypto payout.
- Get the payout status from Get a crypto transaction.
processing while Blaaiz processes an accepted payout. The final status is successful or failed.
The response gives the applied rate and the destination currency. These values describe the payout request. They do not reserve a rate.
Use an idempotency key
The crypto payout and crypto swap endpoints need anIdempotency-Key request header.
Use a new unique key for each new payout or swap. Use the same key only when you retry the same request.
If Blaaiz completed the first request, it returns the original result for the repeated request.
If you reuse a key with different request data, the API returns 422.
If the first request is still active, the API returns 409.
Check a crypto transaction
Use List crypto transactions to get all crypto transactions that your API integration created. Use List crypto wallet transactions to limit the list to one wallet. Use Get a crypto transaction to get one transaction by ID. The list endpoint accepts these optional filters:
The
type value describes the business operation. For a swap, direction shows the source leg or the destination leg.
For an on-chain payout, processing means the payout is active. failed means that the payout ended unsuccessfully.
Each transaction includes the amount, fee, net amount, balance change, target currency, target amount, rate, network, and transaction hash when they apply.
A crypto-to-fiat or fiat-to-crypto swap includes fiat_transaction_id and a compact fiat_transaction object. The object contains its ID, wallet ID, reference, status, currency, amount, fee, net amount, and creation time.
For a fiat-linked swap, use GET /api/external/transaction/{fiat_transaction_id} to get the full fiat transaction. The request needs transaction:read.
A crypto-to-crypto swap includes counterparty_transaction_id and a compact counterparty_transaction object. The object contains its ID, wallet ID, type, direction, status, currency, and amount.
Receive payout webhooks
Blaaiz sends crypto payout webhooks to your configuredpayout_url.
The event values are crypto.payout.processing, crypto.payout.successful, and crypto.payout.failed.
Blaaiz sends crypto.payout.failed only when the payout reaches a final failed state.
Use Webhook events for the payload details.
Use List webhook logs to inspect a delivery. Use Replay a webhook to resend an eligible failed delivery.
