Integre swaps de DePiX/USDT Liquid para dezenas de tokens em 20+ blockchains no seu app com uma API REST simples e segura.
The BrSwap Partner API allows you to create crypto swap orders programmatically. Your users deposit DePiX or USDT on the Liquid Network and receive tokens on their destination chain.
BrSwap accepts DePiX or USDT Liquid as input and converts to tokens on the following chains:
| Asset | Network | Fee |
|---|---|---|
depix | Liquid Network | 2% |
usdt_liquid | Liquid Network | 1% |
| Chain | Code | Tokens (principais) |
|---|---|---|
| Polygon | pol | USDT (direct), USDC |
| Ethereum | eth | ETH, USDT, USDC, WBTC |
| Base | base | ETH, USDC |
| Arbitrum | arb | ETH, USDT, USDC |
| Optimism | op | ETH, USDC |
| BSC | bsc | BNB, USDT, USDC |
| Avalanche | avax | AVAX, USDT, USDC |
| Solana | sol | SOL, USDT, USDC |
| Tron | tron | TRX, USDT |
| NEAR Protocol | near | NEAR, USDC |
| TON | ton | TON, USDT |
| Bitcoin | btc | BTC |
| Litecoin | ltc | LTC |
| Dogecoin | doge | DOGE |
| XRP (Ripple) | xrp | XRP |
| Stellar | stellar | XLM, USDC |
+ outras chains disponíveis — use o endpoint /tokens para a lista completa e atualizada | ||
Use the /tokens endpoint to get the full list of asset_id values needed for quotes and orders. The fastest route is direct:pol:usdt (Polygon USDT) with ~15 second delivery.
Requests are authenticated with credentials sent via headers. New partner accounts require two headers: X-API-Key and X-API-Secret.
O API Secret pode ser gerado/regerado a qualquer momento no Painel de Parceiro (ao gerar um novo, o anterior deixa de funcionar). Contas legadas (criadas antes desta mudança) seguem autenticando só com a API Key.
Para a API liberar, sua conta de parceiro precisa estar (1) vinculada à sua conta BrSwap e (2) com a wallet de recebimento (Liquid) configurada no painel. Enquanto faltar a wallet, as chamadas retornam 403. Configure tudo em segundos no Painel de Parceiro.
The typical integration follows 4 steps:
After creating an order, the user deposits to the provided Liquid address. BrSwap detects the deposit automatically and sends the output token to the recipient address.
Returns all available destination tokens and supported source assets.
Get a real-time quote for a swap. Quotes are valid for ~30 seconds.
| Param | Type | Description |
|---|---|---|
amount required | float | Amount in source asset (e.g. 100 DePiX) |
source_asset | string | depix or usdt_liquid. Default: depix |
destination_asset required | string | Token asset_id from /tokens |
destination_chain required | string | Chain code (e.g. pol, eth, sol) |
Você define sua própria taxa no Painel de Parceiro. Ela é somada em cima da taxa da BrSwap (fee_percent = brswap_fee_percent + partner_fee_percent) e o valor acumula como seu ganho, sacável em DePiX na rede Liquid.
Create a new swap order. Returns a Liquid deposit address. The order expires in 30 minutes.
| Field | Type | Description |
|---|---|---|
amount required | float | Amount in source asset |
source_asset | string | depix or usdt_liquid. Default: depix |
recipient_address required | string | Destination wallet address |
destination_chain required | string | Chain code |
destination_asset required | string | Token asset_id from /tokens |
destination_symbol optional | string | Token symbol (auto-resolved) |
refund_address optional | string | Liquid address for refund if the swap fails. Formats: lq1..., VJL..., Q... |
ref_id optional | string | Your internal reference ID |
Para evitar ordens duplicadas em caso de retry/timeout, envie o header Idempotency-Key (até 128 caracteres). Reenvios com a mesma chave retornam a mesma ordem em vez de criar outra (com idempotent_replay: true na resposta).
Check the status of an existing order. Poll this endpoint to track progress.
| Status | Description |
|---|---|
waiting_deposit | Aguardando depósito no endereço Liquid |
partial_deposit | Depósito parcial recebido, aguardando o restante |
processing | Depósito confirmado, swap em andamento |
pending_review | Ordem em revisão manual pela equipe BrSwap |
completed | Swap concluído, token enviado ao destinatário |
expired | Ordem expirada (sem depósito em 30 min) |
cancelled | Ordem cancelada |
failed | Swap falhou — contate o suporte |
refund | Reembolso em andamento — será enviado ao refund_address na rede Liquid. Acompanhe o campo refund_txid. |
refunded | Reembolso concluído — verifique o campo refund_txid para o TX. |
| Code | Meaning |
|---|---|
| 400 | Invalid request (missing or invalid parameters) |
| 401 | API Key ou API Secret inválido/ausente |
| 403 | API desativada, IP fora da whitelist, limite excedido, ou conta não habilitada (configure a wallet de recebimento no painel) |
| 404 | Order not found |
| 405 | Method not allowed (e.g. GET em endpoint que exige POST) |
| 429 | Rate limit exceeded |
| 500 | Internal error (retry) |
| 503 | Service unavailable (maintenance or insufficient liquidity) |
Rate limits are per API key. Current limits are returned in response headers:
When rate limited, the API returns 429 with a Retry-After: 60 header.
Contact us at [email protected] to request a custom plan.
Não quer programar? No seu Painel de Parceiro você baixa um arquivo brswap-widget.php com sua chave já embutida.
Requer apenas um servidor com PHP e a extensão cURL (padrão na maioria das hospedagens).