Docs / API Reference / Orders & Payments

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

  1. Create user — Register the end user via user management endpoints
  2. Complete KYC — User must pass identity verification
  3. Fetch configuration — Get supported currencies, payment methods, and crypto tokens
  4. Get fiat-to-crypto rate — Use the exchange rates endpoint for conversion quotes
  5. Create order — Use POST /v2/orders/deposit with withdrawDetails containing cryptoTicker and walletAddress

Create Onramp Order

POST /v2/orders/deposit Create an onramp (fiat-to-crypto) order

Uses the standard payin endpoint with withdrawDetails specifying the crypto destination:

JSON
{
  "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"
  }
}
Important

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)

Initiated Fund Processing Fund Settled Asset Processing Asset Settled
Initiated Fund Processing Fund Failed
Fund Settled Asset Processing Asset Deposit Failed
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

  1. Create user — Register the end user via user management endpoints
  2. Complete KYC — User must pass identity verification
  3. Fetch configuration — Get supported currencies, payment methods, and crypto tokens
  4. Get crypto-to-fiat rate — Use the exchange rates endpoint for conversion quotes
  5. Create order — Use POST /v2/payout/orders with depositDetails containing cryptoTicker and sendersWalletAddress

Create Offramp Order

POST /v2/payout/orders Create an offramp (crypto-to-fiat) order

Uses the payout endpoint with depositDetails specifying the crypto source:

JSON — Request
{
  "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)"
  }
}
Response 200 OK
JSON — Response
{
  "orderId": "OR-250428110808237",
  "cryptoAmount": 0.179142,
  "walletAddress": "0xbd09d65597b27626b23cd2e2d7664943df007293"
}
Deposit Address

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)

Initiated Asset Deposited Fund Processing Fund Settled
Initiated Asset Deposit Failed
Asset Deposited Fund Processing Fund Failed
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