Skip to main content
Swaps convert one Solana SPL token into another (e.g. USDC → EURC). You receive a deposit address; once funded, RemitFlex executes the conversion and pays out to your destination wallet. Every swap is tied to a customer under your organisation. Omit customerId to use your org’s primary customer (created at signup). Required scopes: fx:read, transfers:read, transfers:write

When to use swaps

  • Same-chain stablecoin conversion on Solana
  • Treasury FX (USDC → EURC)
  • Payout preparation before a local off-ramp partner (manual today)
For cross-chain collection, use Payment routes instead.

Lifecycle

StatusMeaning
awaiting_depositWaiting for deposit to depositAddress
deposit_receivedDeposit detected on-chain
swappingConversion executing
completedOutput sent to destinationAddress
failed / expired / cancelledTerminal states

Create a swap

curl -X POST https://api.remitflex.io/v1/swaps \
  -H "Authorization: Bearer $REMITFLEX_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "USDC",
    "to": "EURC",
    "amount": 100,
    "destinationAddress": "YOUR_SOLANA_WALLET",
    "customerId": "optional-customer-uuid"
  }'
FieldDescription
from / toCurrency codes (see GET /v1/rates/currencies)
amountHuman-readable input amount
destinationAddressSolana address receiving output tokens
customerIdOptional. Defaults to your org’s primary customer
Send the from token to depositAddress before expiresAt.

List swaps by customer

curl "https://api.remitflex.io/v1/swaps?customerId=CUSTOMER_UUID" \
  -H "Authorization: Bearer $REMITFLEX_API_KEY"

Track and cancel

# Status
curl https://api.remitflex.io/v1/swaps/{id} \
  -H "Authorization: Bearer $REMITFLEX_API_KEY"

# Cancel (only while awaiting_deposit)
curl -X POST https://api.remitflex.io/v1/swaps/{id}/cancel \
  -H "Authorization: Bearer $REMITFLEX_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Failed swaps

When a swap reaches failed, the errorMessage field contains a human-readable reason — never raw Solana simulation logs or program errors.
{
  "status": "failed",
  "errorMessage": "This conversion could not be completed because there was not enough SOL to pay network fees. Please contact support with your swap ID — your deposit will be reviewed."
}
Common causes include insufficient fee-payer balance, slippage beyond tolerance, or on-chain simulation failure. Surface errorMessage to your user and include the swap id when contacting RemitFlex support. The same sanitized message appears on swap rows in GET /transactions under receipt.errorMessage.

API reference

Create swap

POST /swaps

List swaps

GET /swaps

Get swap

GET /swaps/{id}

Rates

Check FX before creating