Partner API

Overview

Integre swaps de DePiX/USDT Liquid para 20+ tokens em 8+ 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.

Base URL

https://brswap.me/api/v1/

Highlights

  • Simple REST API with JSON responses
  • 20+ destination tokens across 8+ chains
  • API key authentication with IP whitelist
  • Orders processed in ~15 minutes average

Supported Pairs

BrSwap accepts DePiX or USDT Liquid as input and converts to tokens on the following chains:

Source Assets (Input)

AssetNetworkFee
depixLiquid Network2%
usdt_liquidLiquid Network1%

Destination Chains & Tokens

ChainCodeTokens
PolygonpolUSDT (direct), USDC
EthereumethETH, USDT, USDC, WBTC
BasebaseETH, USDC
ArbitrumarbETH, USDT, USDC
BSCbscBNB, USDT, USDC
SolanasolSOL, USDT, USDC
TrontronTRX, USDT
BitcoinbtcBTC

Note

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.

Authentication

All requests require an API key sent via the X-API-Key header.

curl -H "X-API-Key: your_api_key_here" \ https://brswap.me/api/v1/tokens.php

To get your API key, contact us at admin@brswap.me

Each API key includes:

  • Configurable rate limit per minute
  • Max order value in USD
  • Optional IP whitelist for extra security
  • Optional custom fee rate

Integration Flow

The typical integration follows 4 steps:

Step 1 List Tokens
Step 2 Get Quote
Step 3 Create Order
Step 4 Poll Status

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.

GET /api/v1/tokens.php

Returns all available destination tokens and supported source assets.

Response

{ "success": true, "tokens": [ { "asset_id": "direct:pol:usdt", "symbol": "USDT", "chain": "pol", "chain_name": "Polygon", "decimals": 6 } ], "total": 20, "source_assets": [ { "id": "depix", "name": "DePiX" }, { "id": "usdt_liquid", "name": "USDT Liquid" } ] }

GET /api/v1/quote.php

Get a real-time quote for a swap. Quotes are valid for ~30 seconds.

Parameters

ParamTypeDescription
amount requiredfloatAmount in source asset (e.g. 100 DePiX)
source_assetstringdepix or usdt_liquid. Default: depix
destination_asset requiredstringToken asset_id from /tokens
destination_chain requiredstringChain code (e.g. pol, eth, sol)

Example

curl -H "X-API-Key: YOUR_KEY" \ "https://brswap.me/api/v1/quote.php?amount=100&source_asset=depix&destination_asset=direct:pol:usdt&destination_chain=pol"

Response

{ "success": true, "quote": { "input_amount": 100, "output_amount": 18.52, "exchange_rate_brl_usd": 5.2935, "fee_percent": 2, "fee_amount": 1.96, "estimated_time_seconds": 15 } }

POST /api/v1/order.php

Create a new swap order. Returns a Liquid deposit address. The order expires in 30 minutes.

Body (JSON)

FieldTypeDescription
amount requiredfloatAmount in source asset
source_assetstringdepix or usdt_liquid. Default: depix
recipient_address requiredstringDestination wallet address
destination_chain requiredstringChain code
destination_asset requiredstringToken asset_id from /tokens
destination_symbol optionalstringToken symbol (auto-resolved)
refund_address optionalstringLiquid address for refund if the swap fails. Formats: lq1..., VJL..., Q...
ref_id optionalstringYour internal reference ID

Example

curl -X POST \ -H "X-API-Key: YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": 100, "source_asset": "depix", "recipient_address": "0xYourWallet...", "destination_chain": "pol", "destination_asset": "direct:pol:usdt", "refund_address": "lq1qq..." }' \ https://brswap.me/api/v1/order.php

Response 201 Created

{ "success": true, "order": { "id": "B5B455D99F0E", "status": "waiting_deposit", "deposit_address": "lq1qq...", // Send DePiX/USDT here "deposit_amount": 100, "output_amount": 18.52, "destination_chain": "pol", "destination_symbol": "USDT", "expires_in_seconds": 1800 } }

GET /api/v1/order.php?id={order_id}

Check the status of an existing order. Poll this endpoint to track progress.

Order Status Values

StatusDescription
waiting_depositWaiting for deposit on the Liquid address
partial_depositPartial deposit received, waiting for the rest
processingDeposit confirmed, swap in progress
completedSwap completed, output sent to recipient
expiredOrder expired (no deposit within 30 min)
cancelledOrder was cancelled
failedSwap failed (contact support)
refundRefund in progress — will be sent to refund_address on Liquid. Check refund_txid field for the TX once sent.

Response

{ "success": true, "order": { "id": "B5B455D99F0E", "status": "completed", "liquid_txid": "abc123...", // Deposit TX "output_txid": "def456...", // Output TX "refund_address": "lq1qq...", // Liquid refund address (if provided) "refund_txid": null, // Liquid TX of the refund (when status=refund) "created_at": "2026-03-08 20:40:08", "updated_at": "2026-03-08 20:45:12" } }

Error Codes

CodeMeaning
400Invalid request (missing or invalid parameters)
401Invalid or missing API key
403API key disabled, IP not whitelisted, or limit exceeded
404Order not found
429Rate limit exceeded
500Internal error (retry)
503Service unavailable (maintenance or insufficient liquidity)

Error Response Format

{ "success": false, "error": "Description of the error", "code": 400 }

Rate Limits

Rate limits are per API key. Current limits are returned in response headers:

X-RateLimit-Limit: 60 X-RateLimit-Remaining: 58

When rate limited, the API returns 429 with a Retry-After: 60 header.

Need higher limits?

Contact us at admin@brswap.me to request a custom plan.

Embeddable Widget

Add the BrSwap swap widget to your website with a single line of code. No API key needed. Your users can swap directly from your site.

Basic Embed

<iframe src="https://brswap.me/widget" width="420" height="700" frameborder="0" style="border-radius: 12px; border: 1px solid rgba(255,255,255,0.1);" ></iframe>

With Partner Tracking

<iframe src="https://brswap.me/widget?ref=your_partner_id" width="420" height="700" frameborder="0" style="border-radius: 12px; border: 1px solid rgba(255,255,255,0.1);" ></iframe>

How it works

  • No API key required - public widget
  • Full swap functionality inside the iframe
  • Order details open in a new tab on brswap.me
  • Dark theme, responsive, mobile-friendly
  • Optional ref param for partner tracking