Skip to main content
Prerequisite: You need a KYC-approved wallet and an active bank account on your organization. See Onboarding Customers for the full onboarding flow.

Onramp Flow

1

Discover Assets

2

Create a Quote — POST /ramp/quote

3

Create an Order — POST /ramp/order

4

Simulate the Fiat Deposit — POST /ramp/order/fiat_received

5

Verify Completion — GET /ramp/order/{order_uuid}


Stellar: First-Time Wallet Onramp

When onramping to a Stellar wallet for the first time, the wallet may not have an on-chain account or the required trustline for the target token. Etherfuse handles this automatically using claimable balances — no pre-setup required from the user.

How It Works

  1. Pass walletAddress in the quote request. The system checks whether the wallet exists on-chain and has a trustline. If setup is needed, the quote fee (feeBps / feeAmount) will include a one-time onboarding cost to cover the XLM needed for account creation and/or trustline reserve.
  2. Create the order as usual. The wallet used for the order must match the walletAddress from the quote.
  3. After the order completes, the order response will include two new fields:
    • stellarClaimableBalanceId — The Stellar claimable balance ID (hex)
    • stellarClaimTransaction — An unsigned Stellar transaction XDR (base64) containing ChangeTrust and ClaimClaimableBalance operations
  4. The user signs and submits the claim transaction. This single transaction adds the trustline and claims the tokens in one step. The user signs stellarClaimTransaction with their Stellar wallet and submits it to Horizon.
If the wallet already has an account and trustline, the flow is identical to a normal onramp — no claimable balance is used, and stellarClaimableBalanceId / stellarClaimTransaction will not be present on the order.

Example: Quote with Wallet Address

curl -X POST https://api.sand.etherfuse.com/ramp/quote \
  -H "Authorization: <api_key>" \
  -H "Content-Type: application/json" \
  -d '{
    "quoteId": "<uuid>",
    "customerId": "<org_uuid>",
    "blockchain": "stellar",
    "quoteAssets": {
      "type": "onramp",
      "sourceAsset": "MXN",
      "targetAsset": "USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5"
    },
    "sourceAmount": "1000",
    "walletAddress": "GDUKMGUGD3V6VXTU2RLAUM7A2FABLMHCPWTMDHKP7HHJ6FCZKEY4PVWL"
  }'
If the wallet needs setup, the response feeBps will be higher than the standard trading fee (e.g., 70 bps instead of 20 bps). The additional cost covers XLM account funding.

Example: Claiming Tokens

After the order reaches completed status, the order response includes the claim transaction:
{
  "orderId": "123e4567-e89b-12d3-a456-426614174000",
  "status": "completed",
  "stellarClaimableBalanceId": "00000000abc123...",
  "stellarClaimTransaction": "AAAAAgAAAABk...base64_xdr..."
}
The user (or your application) signs stellarClaimTransaction and submits it to Stellar Horizon:
// Using Stellar SDK
const tx = TransactionBuilder.fromXDR(
  order.stellarClaimTransaction,
  networkPassphrase
);
tx.sign(userKeypair);
await server.submitTransaction(tx);
After submission, the user’s wallet will have the trustline and the tokens.
The claim transaction uses the wallet’s current sequence number. If the user submits other transactions before claiming, the sequence number may become stale and the claim transaction will fail. In that case, your application can rebuild the claim transaction from the stellarClaimableBalanceId and asset info in the order response.