AutoSwap

Autoswap lets your end users deposit crypto and automatically receive the equivalent in fiat. No manual intervention required on your end. Once enabled, the full conversion lifecycle is handled by Waltrex and settled to your whitelisted bank account.

Prerequisites

Before you can start using Autoswap, reach out to your Waltrex account manager with the following:

  1. Markets: which currency corridors you need (e.g. USDT TRC-20 → MXN)
  2. Whitelisted bank accounts: the account(s) where converted funds will be settled. These must be verified by Waltrex before going live.

Once confirmed, Waltrex will enable Autoswap on your account.


How it works

Each conversion follows a four-step lifecycle:

Create quote → Create order → End user deposits → Funds settled

You interact with steps 1 and 2. Steps 3 and 4 are automatic. Your system receives a webhook at each status change.


Step 1: Create a quote

Request a quote for the conversion you want to offer your end user. The quote locks in an exchange rate for a limited time.

POST /waltrex-conversions/private/v1/quotes
authorization: Bearer YOUR_TOKEN
x-irs-csrf-token: YOUR_CSRFTOKEN
Content-Type: application/json
{
  "coinFrom": "USDT",
  "chainFrom": "TRX",
  "coinTo": "MXN",
  "amountFrom": "1000"
 }

Response fields you need:

FieldDescription
quote_idPass this to the next step
target_amountThe fiat currency the beneficiary will receive
expires_atTimestamp after which this quote is no longer valid. Request a new quote to continue


Step 2: Create an order

Create the order using the accepted quote. Waltrex returns a unique deposit address for your end user.

POST /orders/new
authorization: Bearer YOUR_TOKEN
x-irs-csrf-token: YOUR_CSRFTOKEN
Content-Type: application/json

{
  "acceptedQuoteId": "8f3c1b9f-723f-45b4-9405-f851a45c9ecd",
  "paymentMethodId": "string",
  "fundingWalletId": "string"
}

Response fields you need:

FieldDescription
order_idStore this to track the order
deposit_infoThe deposit address for the wallet linked to this order.
originalQuote.source_currencyCurrency and chain the address belongs to (e.g. USDT_TRX)
originalQuote.expires_atDeadline for the end user to deposit

paymentMethodId is the ID of your whitelisted bank account registered with Waltrex. Your account manager will provide this once your account is set up.

Show deposit_info and expires_at to your end user. They must send the exact amount to that address before the deadline.



Error handling

ScenarioHow to handle
Quote expired before creating orderCreate a new quote and retry
awaiting_funds_timeoutCreate a new quote and order, show fresh address
failed statusContact Waltrex support with the order_id
Webhook not receivedUse ListOrders to poll order status as fallback

Going live checklist

  • Markets confirmed with your Waltrex account manager
  • Bank account(s) whitelisted and verified
  • beneficiaryId received and stored in your system
  • Webhook endpoint registered and returning 200 OK
  • Tested the full flow with testnet
  • Handling awaiting_funds_timeout and failed statuses