Integration Guides

Guide: Off-Ramp (Crypto to Fiat)

This guide walks you through a complete off-ramp flow — converting USDT to EUR via the Stablegate API. By the end, your customer will have EUR delivered to their bank account.

Scenario: Your customer wants to sell 500 USDT, receiving EUR at their SEPA bank account.

Prerequisites

Before you begin, make sure you have:

  • API key configured
  • Customer UUID (created via the Customers API)

Flow Overview

  1. Register bank account — register the customer's IBAN.
  2. Check route — verify Ethereum/USDT → SEPA/EUR is available.
  3. Check fees — calculate the fee for 500 USDT.
  4. Check limits — confirm the amount is within limits.
  5. Create order — submit the off-ramp order; attach the invoice if the order needs one.
  6. Customer deposit — the customer sends USDT to the deposit address.
  7. Monitor status — poll until the order reaches a terminal state.
  8. Complete — EUR is delivered to the customer's bank account.

Step 1: Register the Customer's Bank Account

Register the IBAN where the customer will receive EUR.

Request:

curl https://api.stablegate.com/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/bank-accounts/ \
  --request POST \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "iban": "DE89370400440532013000",
  "holder_name": "Max Mustermann",
  "name": "Main EUR Account",
  "bank_name": "Commerzbank",
  "bank_code": "COBADEFFXXX"
}'

Response:

{
  "uuid": "ba1c2d3e-4f5a-6b7c-8d9e-0f1a2b3c4d5e",
  "name": "Main EUR Account",
  "iban": "DE89370400440532013000",
  "bank_name": "Commerzbank",
  "bank_code": "COBADEFFXXX",
  "bank_country": "DEU",
  "bank_address": null,
  "holder_name": "Max Mustermann",
  "created_at": "2025-01-15T10:30:00.000Z",
  "updated_at": "2025-01-15T10:30:00.000Z"
}

Save the uuid — you will use it when creating the order.

If the bank account is already registered, skip this step and use the existing bank account UUID.

Step 2: Check Exchange Route Availability

Verify that the Ethereum USDT → SEPA EUR route is currently available.

Request:

curl https://api.stablegate.com/v1/exchange-routes/check/ \
  --request POST \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "source": {
    "rail": "ethereum",
    "asset_code": "USDT"
  },
  "destination": {
    "rail": "sepa",
    "asset_code": "EUR"
  }
}'

Response:

{
  "available": true,
  "route": {
    "source": {
      "rail": "ethereum",
      "asset": {
        "code": "USDT",
        "fraction_digits": 6
      }
    },
    "destination": {
      "rail": "sepa",
      "asset": {
        "code": "EUR",
        "fraction_digits": 2
      }
    }
  }
}

The route is available.


Step 3: Calculate Fees

Check how much EUR the customer will receive for 500 USDT after fees.

Request:

curl https://api.stablegate.com/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/check-fees/ \
  --request POST \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "source": {
    "rail": "ethereum",
    "asset": "USDT",
    "amount": 500
  },
  "destination": {
    "rail": "sepa",
    "asset": "EUR"
  }
}'

Response:

{
  "source": {
    "rail": "ethereum",
    "asset": "USDT",
    "amount": "500.000000"
  },
  "destination": {
    "rail": "sepa",
    "asset": "EUR",
    "amount": "473.25"
  },
  "commission": {
    "asset": "USDT",
    "amount": "10.00"
  },
  "exchange_rate": "0.966500"
}

Display to the customer:

  • Sends: 500.00 USDT
  • Fee: 10.00 EUR
  • Exchange rate: 0.9665 (USDT/EUR)
  • Receives: ~473.25 EUR to their bank account

Step 4: Verify Limits

Confirm the customer has sufficient limit capacity.

Request:

curl https://api.stablegate.com/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/check-limits/ \
  --request POST \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "source": {
    "rail": "ethereum",
    "asset": "USDT",
    "amount": 500
  },
  "destination": {
    "rail": "sepa",
    "asset": "EUR"
  }
}'

Response — the operation passes:

[]

The endpoint returns only the rules the operation breaks, so an empty array is the success case.

Response — a limit is exceeded:

[
  {
    "limit_rule": {
      "uuid": "lr1a2b3c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
      "name": "Lifetime turnover",
      "scope": "period",
      "period": "lifetime",
      "rail_types": ["bank"],
      "rail_codes": null,
      "operation_types": ["funding", "payout"],
      "asset_codes": null
    },
    "limit_amount": "15000.00",
    "used_amount": "14500.00",
    "available_amount": "500.00",
    "excess_amount": "500.00",
    "error_msg": "Lifetime turnover is exceeded by 500 EUR (the current limit is 15000 EUR)"
  }
]
Any element in the array is a refusal, even when excess_amount is "0.00": the minimum-amount rule reports itself that way, and the reason sits in error_msg. Show the customer available_amount and suggest a smaller transaction.

Step 5: Create the Off-Ramp Order

Submit the order using the bank account UUID from Step 1.

Request:

curl https://api.stablegate.com/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/orders/ \
  --request POST \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: order_c1d2e3f4_offramp_001' \
  --data '{
  "source": {
    "rail": "ethereum",
    "asset": "USDT",
    "amount": 500
  },
  "destination": {
    "rail": "sepa",
    "asset": "EUR",
    "client_account_uuid": "ba1c2d3e-4f5a-6b7c-8d9e-0f1a2b3c4d5e"
  }
}'

Response:

{
  "uuid": "od2f3a4b-5c6d-7e8f-9a0b-1c2d3e4f5a6b",
  "reference": "SG-20250115-GHIJKL",
  "state": "new",
  "deposit_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18",
  "source": {
    "rail": "ethereum",
    "asset": "USDT",
    "amount": "500.000000",
    "deposit_bank_info": null,
    "transaction_hash": null,
    "deposit_status": null
  },
  "destination": {
    "rail": "sepa",
    "asset": "EUR",
    "amount": "473.25",
    "client_account": "DE89370400440532013000"
  },
  "commission": {
    "asset": "USDT",
    "amount": "10.00"
  },
  "account": {
    "uuid": "ac1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
    "code": "TRD-001",
    "name": "Trading Account",
    "type": "trading"
  },
  "error_message": null,
  "third_party_document_required": false,
  "third_party_document_uuid": null,
  "created_at": "2025-01-15T10:50:00.000Z",
  "valid_until": "2025-01-15T11:50:00.000Z"
}

The critical fields for off-ramp are:

FieldValuePurpose
deposit_address0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18Stablegate's Ethereum address where the customer sends USDT
referenceSG-20250115-GHIJKLOrder reference (not needed for crypto deposits, but useful for your records)
valid_until2025-01-15T11:50:00.000ZDeadline for the deposit
third_party_document_requiredfalseWhether the order waits for an invoice (see below)

Payout to a Third-Party Account: Attach the Invoice

In this scenario the EUR goes to the customer's own IBAN registered in Step 1, so no invoice is needed. When Stablegate treats the payout account as a third party's and the order is above 15 000 EUR (the source amount converted to EUR; the threshold may differ in your account configuration), the response has third_party_document_required: true. Such an order is created as usual, but it is not executed automatically until its invoice or contract is attached: after the deposit is confirmed it stays new and waits for Stablegate operations.

Upload the file while the order is still new, for example before the customer sends the USDT:

curl 'https://api.stablegate.com/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/orders/od2f3a4b-5c6d-7e8f-9a0b-1c2d3e4f5a6b/third-party-document/' \
  --request POST \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --form '[email protected]'

The response is the order with third_party_document_uuid set. Once the invoice is attached, the order is processed as usual; if the deposit has already arrived, processing resumes. The rules and errors are in Third-Party Payouts and the Invoice.


Step 6: Customer Sends USDT

Instruct your customer to send the USDT to the deposit address:

DetailValue
TokenUSDT (ERC-20)
NetworkEthereum mainnet
Recipient Address0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18
Amount500.000000 USDT
  • The customer must send USDT on the Ethereum network — not on other networks such as Tron or BSC.
  • The amount does not have to match to the cent: an under- or overpayment changes the payout, which is recalculated from what actually arrived, and does not fail the order.
  • The deposit must be completed before valid_until.

Step 7: Monitor Order Status

After the customer sends USDT, poll the order status. Ethereum transactions typically confirm within a few minutes.

Request:

curl https://api.stablegate.com/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/orders/od2f3a4b-5c6d-7e8f-9a0b-1c2d3e4f5a6b/ \
  --header 'X-Api-Key: YOUR_API_KEY'

Status transitions you will observe:

  1. new — Order created, waiting for USDT deposit. source.deposit_status stays null until the transaction is seen
  2. new with source.deposit_status: "received" or "confirmed" — the transaction is on-chain and is being matched; source.transaction_hash carries the deposit hash the customer can check
  3. processing — deposit credited, exchange in progress
  4. done — EUR has been sent to the customer's bank account via SEPA

Response (completed):

{
  "uuid": "od2f3a4b-5c6d-7e8f-9a0b-1c2d3e4f5a6b",
  "reference": "SG-20250115-GHIJKL",
  "state": "done",
  "deposit_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18",
  "source": {
    "rail": "ethereum",
    "asset": "USDT",
    "amount": "500.000000",
    "deposit_bank_info": null,
    "transaction_hash": "0x9f8e7d6c5b4a39281706f5e4d3c2b1a09f8e7d6c5b4a39281706f5e4d3c2b1a0",
    "deposit_status": "credited"
  },
  "destination": {
    "rail": "sepa",
    "asset": "EUR",
    "amount": "473.25",
    "client_account": "DE89370400440532013000"
  },
  "commission": {
    "asset": "USDT",
    "amount": "10.00"
  },
  "account": {
    "uuid": "ac1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
    "code": "TRD-001",
    "name": "Trading Account",
    "type": "trading"
  },
  "error_message": null,
  "created_at": "2025-01-15T10:50:00.000Z",
  "valid_until": null
}
Once the status reaches done, the SEPA transfer has been initiated. The customer's bank may take an additional 1 business day to credit the funds.

Step 8: Order Complete

The order is in the done state. 473.25 EUR has been sent to the customer's IBAN (DE89370400440532013000) via SEPA.

Summary:

ItemValue
Customer sent500.00 USDT to 0x742d...bD18
Fee10.00 EUR
Customer received473.25 EUR at DE89...3000
Statusdone

Cancelling an Order

If the customer decides not to proceed before sending the USDT deposit, you can cancel the order:

Request:

curl https://api.stablegate.com/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/orders/od2f3a4b-5c6d-7e8f-9a0b-1c2d3e4f5a6b/cancel/ \
  --request POST \
  --header 'X-Api-Key: YOUR_API_KEY'

Response: 204 No Content

After cancellation, verify the order status:

curl https://api.stablegate.com/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/orders/od2f3a4b-5c6d-7e8f-9a0b-1c2d3e4f5a6b/ \
  --header 'X-Api-Key: YOUR_API_KEY'
{
  "uuid": "od2f3a4b-5c6d-7e8f-9a0b-1c2d3e4f5a6b",
  "reference": "SG-20250115-GHIJKL",
  "state": "cancelled",
  "error_message": null,
  "created_at": "2025-01-15T10:50:00.000Z",
  "valid_until": null
}
Orders can only be cancelled before the deposit is processed. Once the order reaches processing status, cancellation is no longer possible.

Error Handling

Route unavailable

If the route check in Step 2 returns available: false, inform the customer that this conversion is temporarily unavailable.

Limits exceeded

If the check in Step 4 returns a non-empty array, the transaction breaks a limit. Do not look at excess_amount alone: the minimum-amount rule reports itself with excess_amount: "0.00" and the reason in error_msg. Display available_amount and suggest a smaller transaction.

Wrong network or token

If the customer sends tokens on the wrong network (e.g., USDT on Tron instead of Ethereum) or sends a different token, the deposit will not be detected. In this case, contact the Stablegate support team for assistance.

Order failed

If the order reaches a failed or rejected state, check error_message. A deposit that differs in amount does not fail the order by itself: the payout is recalculated from the amount actually received.

Order expired

If the customer does not send USDT before valid_until, the order may expire. Create a new order if needed.

Ready to integrate?

Tell us about your use case and we will enable Partner API access for your account.
Copyright © 2026