T

BuyTron

Swap USDT → TRX

Operationallast check 15s ago
Developer API

Integrate USDT to TRX exchange into your app

Use the BuyTron API to create exchange quotes, submit signed USDT transactions, track exchange status, and resolve referral codes.

Base URL

https://api.buytron.org/api

Auth

No API key required

Format

JSON requests and responses

Recommended flow

  1. 1. Create an exchange. Send the user TRON address and USDT amount to receive quote, service address, fee, and expiry.
  2. 2. Sign USDT transfer client-side. Keep private keys in the user wallet. Your app submits only the signed transaction object.
  3. 3. Submit the signed transaction. BuyTron broadcasts the transaction, handles energy, and sends TRX to the user.
  4. 4. Poll status. Read the exchange until it reaches completed, failed, or expired.

Create quote

curl -X POST https://api.buytron.org/api/exchange/create \
  -H "Content-Type: application/json" \
  -d '{
    "userAddress": "TXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "usdtAmount": 25
  }'

Submit signed transaction

curl -X POST https://api.buytron.org/api/exchange/submit-signed-transaction \
  -H "Content-Type: application/json" \
  -d '{
    "exchange_id": "exchange_123",
    "user_address": "TXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "signedTransaction": { "...": "TronWeb signed transaction object" },
    "expected_amount": 25
  }'

Check status

curl "https://api.buytron.org/api/exchange/exchange_123?userAddress=TXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

Core Exchange API

POST/exchange/create

Create wallet exchange

Creates an exchange quote for a connected wallet flow.

  • usdtAmount must be between 5 and 10000.
  • referrerAddress is optional.

Request

{
  "userAddress": "TXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "usdtAmount": 25,
  "referrerAddress": "TYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY"
}

Response

{
  "success": true,
  "exchange_id": "exchange_...",
  "user_address": "TXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "usdt_amount": 25,
  "trx_amount": 67.2,
  "exchange_rate": 0.372,
  "service_address": "T...",
  "service_fee": 3.5,
  "status": "created",
  "expires_at": "2026-05-28T12:00:00.000Z"
}
POST/exchange/submit-signed-transaction

Submit signed USDT transaction

Submits a user-signed USDT transaction, delegates energy if needed, broadcasts it, and sends TRX to the user.

Request

{
  "exchange_id": "exchange_...",
  "user_address": "TXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "signedTransaction": { "...": "TronWeb signed transaction object" },
  "expected_amount": 25
}

Response

{
  "success": true,
  "transaction_id": "usdt_tx_hash",
  "trx_txid": "trx_tx_hash",
  "trx_amount": 67.2,
  "energy_delegated": true,
  "activation_sent": false,
  "bandwidth_sent": false
}
GET/exchange/{id}?userAddress={address}

Get exchange status

Returns the current status and public details for an exchange.

Response

{
  "success": true,
  "exchange": {
    "id": "exchange_...",
    "user_address": "TXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "usdt_amount": 25,
    "trx_amount": 67.2,
    "status": "completed",
    "mode": "automatic",
    "trx_tx_hash": "trx_tx_hash"
  }
}

Referral API

POST/referral/code?walletAddress={address}

Create or get referral code

Creates a code for a wallet or returns the existing one.

Response

{
  "success": true,
  "code": "mycode123",
  "wallet_address": "TXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "created_at": "2026-05-28T12:00:00.000Z"
}
GET/referral/resolve?referrer={codeOrAddress}

Resolve referrer

Resolves a referral code or address into a wallet address.

Response

{
  "success": true,
  "wallet_address": "TXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "input": "mycode123"
}
GET/referral/stats?referrerAddress={address}

Get referral stats

Returns referral profit and user counts for a referrer.

Response

{
  "success": true,
  "total_profit": 12.6,
  "withdrawn_profit": 4,
  "available_profit": 8.6,
  "total_referrals": 10,
  "level1_referrals": 8,
  "level2_referrals": 2
}
PUT/referral/code

Update referral code

Updates a wallet referral code. Codes must be 8-16 lowercase alphanumeric chars.

Request

{
  "walletAddress": "TXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "newCode": "partner123"
}

Response

{
  "success": true,
  "code": "partner123",
  "wallet_address": "TXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}

Integration notes

All TRON addresses must use the base58 format and start with T. Exchange amounts are in USDT, and timestamps are Unix milliseconds unless an ISO string is returned.

User private keys must never be sent to BuyTron. Build wallet integrations so users sign transactions locally with TronLink, WalletConnect, Trust Wallet, OKX, or another supported wallet.

© 2025 BuyTron. Powered by TRON blockchain.

SecureFastDecentralizedAPI DocsTelegram