Skip to main content

How to create a payment via ONRAMP

Overview​

Use Fiat Deposit API to create an onramp order, redirect the customer to the payment page, and receive cryptocurrency after the fiat payment is completed.

Integration flow​

  1. Get the list of fiat currencies available for deposit by using [POST] fiat/deposit/fiatCurrencies.
  2. Get available payment methods by using [POST] fiat/deposit/method.
  3. Create an onramp order by using [POST] fiat/deposit/create/order.
  4. Confirm the order by using [POST] fiat/deposit/confirm/order and redirect the customer to the returned redirectUrl.
  5. Track order status through ONRAMP webhooks and, if needed, verify the order by using [POST] fiat/deposit/order.

Sequence​

Names of requests on the scheme indicate Fiat Deposit API methods and ONRAMP webhook events.

ONRAMP payment sequence

Standard and external address flow​

FlowHow to configure
Standard onrampSet external to false when requesting payment methods. Do not pass externalAddress when creating the order.
External address onrampSet external to true when requesting payment methods. Pass externalAddress when creating the order.

Common request fields​

Fiat Deposit API methods use the standard request wrapper.

FieldTypeRequiredDescription
accountstringYesMerchant account ID. The request will be sent for this account.
timestampnumberYesCurrent Unix UTC timestamp in milliseconds. The value must not be less than 3 minutes in the past or greater than 3 minutes in the future.
payloadobjectYes, except fiat/deposit/fiatCurrenciesObject with method-specific request data.

Get available fiat currencies​

Use [POST] fiat/deposit/fiatCurrencies.

Request example​

{
"account": "0x0000000000000000000000000000000000000000",
"timestamp": 1761650432438
}

Response fields​

FieldTypeDescription
fiatCurrenciesarrayFiat currencies available for onramp deposits.

Get payment methods​

Use [POST] fiat/deposit/method.

Payload fieldTypeRequiredDescription
itemIdstringNoFiat currency item ID, if required by the selected currency metadata.
fiatCurrencystringYesFiat currency of the onramp order.
cryptoAmountnumberNoCryptocurrency amount for advance calculation. Pass either cryptoAmount or fiatAmount when calculating by amount.
fiatAmountnumberNoFiat amount for advance calculation. Pass either fiatAmount or cryptoAmount when calculating by amount.
currencystringYesCryptocurrency that the merchant wants to receive.
externalbooleanYesSet true for external address flow and false for standard onramp flow.

Request example​

{
"account": "0x0000000000000000000000000000000000000000",
"timestamp": 1761650432438,
"payload": {
"fiatCurrency": "USD",
"fiatAmount": 100,
"currency": "USDT_TRX",
"external": false
}
}

Response fields​

FieldTypeDescription
fixedRateIdstringFixed exchange rate ID. Use it as rateId when creating the order.
rateExpiredDatestringDate and time when the fixed rate expires.
methodsarrayAvailable payment methods for the selected fiat currency, amount, cryptocurrency, and flow type.

Payment method fields​

FieldTypeDescription
itemIdstringPayment method item ID. Use it when creating the order.
paymentMethodCodestringPayment method code.
paymentMethodNamestringPayment method name shown to the customer.
fiatAmountnumberFiat amount for the method.
cryptoAmountnumberCryptocurrency amount for the method.
currencystringCryptocurrency that the merchant receives.
fiatCurrencystringFiat currency paid by the customer.
minLimitnumberMinimum fiat amount for the method.
maxLimitnumberMaximum fiat amount for the method.

Create onramp order​

Use [POST] fiat/deposit/create/order.

Payload fieldTypeRequiredDescription
rateIdstringYesFixed rate ID from fixedRateId.
itemIdstringYesPayment method item ID.
cryptoAmountnumberNoCryptocurrency amount.
fiatAmountnumberNoFiat amount.
descriptionstringYesOrder description.
merchantExternalIdstringNoMerchant-side order ID.
returnUrlstringYesURL where the customer returns after completing payment.
idempotencyKeystringYesExternal ID in UUID format.
externalAddressstringNoExternal cryptocurrency address for external address flow.

Request example​

{
"account": "0x0000000000000000000000000000000000000000",
"timestamp": 1761650432438,
"payload": {
"rateId": "123e4567-e89b-12d3-a456-426614174000",
"itemId": "123e4567-e89b-12d3-a456-426614174001",
"fiatAmount": 100,
"description": "Order #1001",
"merchantExternalId": "order-1001",
"returnUrl": "https://merchant.com/checkout",
"idempotencyKey": "123e4567-e89b-12d3-a456-426614174002"
}
}

Confirm onramp order​

Use [POST] fiat/deposit/confirm/order.

Payload fieldTypeRequiredDescription
idstringYesOrder ID returned after order creation.
requestParamsobjectYesAdditional confirmation parameters required by the selected payment method.

Request example​

{
"account": "0x0000000000000000000000000000000000000000",
"timestamp": 1761650432438,
"payload": {
"id": "123e4567-e89b-12d3-a456-426614174003",
"requestParams": {
"ANY_ADDITIONAL_PROPERTY": {}
}
}
}

Response fields​

FieldTypeDescription
redirectUrlstringPayment page URL. Redirect the customer to this URL to complete fiat payment.

Get onramp order info​

Use [POST] fiat/deposit/order.

Payload fieldTypeRequiredDescription
idstringYesOrder ID returned after order creation.

Response fields​

FieldTypeDescription
externalAddressstringExternal cryptocurrency address, if used.
idstringCalypso onramp order ID.
cryptoAmountnumberCryptocurrency amount.
fiatAmountnumberFiat amount.
fiatCurrencystringFiat currency paid by the customer.
currencystringCryptocurrency received by the merchant.
statestringCurrent onramp order status.
hashstringBlockchain transaction hash, if available.

Onramp order statuses​

StatusDescription
CREATEDOnramp order was created.
IN_PROGRESSOnramp order is being processed.
PAIDCustomer fiat payment was received.
DEPOSIT_COMPLETEDCryptocurrency deposit was credited to the merchant Calypso account.
EXTERNAL_WITHDRAWAL_IN_PROGRESSWithdrawal to externalAddress is in progress.
PAUSEDWithdrawal to externalAddress requires attention or cannot be completed automatically.
COMPLETEDOnramp order processing was completed.
FAILEDOnramp order payment or processing failed.
EXPIREDCustomer did not complete payment before the order expired.
CaseRecommendation
Order is createdSave id, idempotencyKey, merchantExternalId, selected method, and amount.
Order is confirmedRedirect the customer to redirectUrl.
Webhook is receivedUpdate order status and verify the current state with [POST] fiat/deposit/order if needed.
Order is paidShow payment success to the customer, but keep backend processing tied to webhooks and order state.
Order failed or expiredShow failed or expired state and create a new order if payment is still required.
DocumentLink
ONRAMP webhooksONRAMP webhooks