Orders & Payments
API reference for Onramp (fiat-to-crypto) and Offramp (crypto-to-fiat) order flows. These endpoints enable your users to buy stablecoins with fiat or sell stablecoins for fiat.
1. Onramp — Fiat to Stablecoin
Users deposit fiat currency which is converted and settled to a crypto wallet address. This flow enables end users to buy stablecoins (USDC, USDT) using local payment methods.
Workflow Steps
- Create user — Register the end user via user management endpoints
- Complete KYC — User must pass identity verification
- Fetch configuration — Get supported currencies, payment methods, and crypto tokens
- Get fiat-to-crypto rate — Use the exchange rates endpoint for conversion quotes
- Create order — Use
POST /v2/orders/depositwithwithdrawDetailscontainingcryptoTickerandwalletAddress
Create Onramp Order
Uses the standard payin endpoint with withdrawDetails specifying the crypto destination:
{
"paymentType": "bank_transfer",
"purposeCode": "expense_or_medical_reimbursement",
"amount": 100,
"currency": "EUR",
"email": "john@example.com",
"redirectUrl": "https://www.example.com",
"sourceUrl": "https://example.com",
"withdrawDetails": {
"cryptoTicker": "USDC",
"walletAddress": "0xcf2888157e35d8595cba5abd7970f94a43f0d2d2"
}
}
Onramp does NOT support quote caching. Do not pass a quoteId parameter when creating onramp orders — it will be ignored or cause an error.
Order Status Flow (Onramp)
| Status | Phase | Description |
|---|---|---|
initiated |
Funding | Order created, awaiting user payment |
fund_processing |
Funding | Payment details submitted, awaiting confirmation |
fund_settled |
Funding | Fiat payment received |
fund_failed |
Funding | Payment not received or reversed |
asset_processing |
Transfer | Stablecoin transfer to wallet initiated |
asset_settled |
Transfer | Stablecoins delivered to wallet |
asset_deposit_failed |
Transfer | Stablecoin transfer failed |
expired |
— | Order expired due to inactivity |
2. Offramp — Stablecoin to Fiat
Users send stablecoins (USDC, USDT) to a PayItFast wallet address, which are converted to fiat and distributed to their bank account or local wallet.
Workflow Steps
- Create user — Register the end user via user management endpoints
- Complete KYC — User must pass identity verification
- Fetch configuration — Get supported currencies, payment methods, and crypto tokens
- Get crypto-to-fiat rate — Use the exchange rates endpoint for conversion quotes
- Create order — Use
POST /v2/payout/orderswithdepositDetailscontainingcryptoTickerandsendersWalletAddress
Create Offramp Order
Uses the payout endpoint with depositDetails specifying the crypto source:
{
"purposeCode": "fee_payments",
"amount": 10,
"email": "john@example.com",
"currency": "PHP",
"paymentCode": "gcash",
"depositDetails": {
"cryptoTicker": "USDC",
"sendersWalletAddress": "0xcf2888157e35d8595cba5abd7970f94a43f0d2d2"
},
"additionalDetails": {
"firstName": "John",
"phone": "1234567890"
},
"deviceDetails": {
"ipInfo": { "ip": "186.228.23.255" },
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
}
}
{
"orderId": "OR-250428110808237",
"cryptoAmount": 0.179142,
"walletAddress": "0xbd09d65597b27626b23cd2e2d7664943df007293"
}
The response includes the PayItFast wallet address where the user must send stablecoins. The cryptoAmount field indicates the exact amount of crypto expected.
Order Status Flow (Offramp)
| Status | Description |
|---|---|
initiated |
Order created, waiting for stablecoin transfer from user |
asset_deposited |
Crypto received from user's wallet |
asset_deposit_failed |
Crypto not received |
fund_processing |
Awaiting bank confirmation of fiat transfer |
fund_settled |
Fiat successfully transferred to recipient |
fund_failed |
Fiat payout failed |
expired |
Order expired due to inactivity |