On-Ramp & Off-Ramp
Let your users buy crypto with local money, or sell crypto for local money.
What this doesYour user buys crypto with their local currency (on-ramp), or sells crypto and gets local currency in their bank account (off-ramp). The money is theirs on both sides — it never touches your balance.
Ways to offer it
| You build | TransFi does | |
|---|---|---|
| Widget | Embed a ready-made screen | Everything |
| API | Your own screens on the calls below | Payment, conversion, delivery |
| Fiat only | The crypto side yourself | The local-currency side only |
The steps below are the API route.
Before you start
- The user must be verified (KYC) before their first order. See Identity Verification.
- Get a rate first with
orderType=onramporofframp. → Get Exchange Rates
On-ramp — user buys crypto
curl -X POST 'https://sandbox-api.transfi.com/v3/orders' \
-H 'Authorization: Basic YOUR_BASE64_CREDENTIALS' \
-H 'mid: YOUR_MID' \
-H 'Content-Type: application/json' \
-d '{
"userId": "UX-250930062608488",
"orderType": "onramp",
"purposeCode": "personal",
"partnerId": "onramp-3001",
"source": {
"currency": "BRL",
"amount": "500",
"paymentType": "bank_transfer",
"paymentCode": "PIX"
},
"destination": {
"currency": "USDT",
"network": "polygon",
"walletAddress": "0xUSER_WALLET"
}
}'You get a payUrl. The user pays there. The crypto is sent to their wallet.
| Status | Meaning | What to do |
|---|---|---|
initiated | Waiting for the user to pay | Show payUrl |
fund_processing | Payment made, being confirmed | Show "processing" |
fund_deposited | Local money received | Show "sending crypto" |
asset_processing | Crypto being sent | Show "sending crypto" |
asset_settled | Done. Crypto is in the user's wallet | Show complete |
fund_deposit_failed | Payment didn't arrive | New order, new partnerId |
asset_settle_failed | Crypto couldn't be sent | Contact support with the orderId |
Off-ramp — user sells crypto
curl -X POST 'https://sandbox-api.transfi.com/v3/orders' \
-H 'Authorization: Basic YOUR_BASE64_CREDENTIALS' \
-H 'mid: YOUR_MID' \
-H 'Content-Type: application/json' \
-d '{
"userId": "UX-250930062608488",
"orderType": "offramp",
"purposeCode": "personal",
"partnerId": "offramp-3002",
"source": {
"currency": "USDT",
"amount": "200",
"network": "polygon"
},
"destination": {
"currency": "BRL",
"paymentType": "bank_transfer",
"paymentCode": "PIX"
}
}'You get a deposit walletAddress and network. The user sends crypto there. Local currency is paid to their account.
| Status | Meaning | What to do |
|---|---|---|
initiated | Waiting for the crypto | Show the address and network |
asset_processing | Crypto received, converting | Show "processing" |
fund_settled | Done. Local money paid to the user | Show complete |
asset_settle_failed | Crypto not received in time, or couldn't be converted | New order |
Network and expiry. The user must send on the network shown. If the address expires before they send, create a new order — never reuse an address.
An off-ramp order can be cancelled while it is still waiting for the crypto. → Cancel Order
APIs used
Create Individual User · Standard KYC · Get Exchange Rates · Create Order · Get Order · Simulate Order Status
Related
Collections · Swaps — convert money you hold
Updated about 7 hours ago