Skip to main content

Onramping API

This document covers the Onramping endpoint used to create pay-links that redirect your customers to our on-ramp checkout where they can purchase crypto with fiat and have it sent directly to a deposit address. It includes:
  • Create a pay-link (POST /api/ramping/links)
This endpoint is protected, you must be authenticated.

Base URL

All examples use:
  • https://www.niftipay.com
If you’re running locally, replace with your own base URL.

Authentication

This endpoint supports two authentication methods (depending on your integration setup): Send your API key in the x-api-key header.
curl -X POST "https://www.niftipay.com/api/ramping/links" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{ ... }'
If you are authenticated via the dashboard.
For browser calls, you usually don’t need to add headers manually — the cookie is sent automatically.

How it works

  1. You call POST /api/ramping/links with your customer’s details and the fiat amount.
  2. The API creates an underlying crypto invoice order and generates a signed pay-link token.
  3. You redirect your customer to the returned url.
  4. The customer lands on the Niftipay on-ramp page, selects a payment method (card or bank transfer), completes KYC if needed, and pays.
  5. The purchased crypto is sent directly to the invoice deposit address.
  6. Once the on-chain deposit is detected, the invoice is marked as paid and your webhook fires.

POST /api/ramping/links

Request body

FieldTypeRequiredNotes
firstNamestringYesCustomer’s first name.
lastNamestringYesCustomer’s last name.
emailstringYesCustomer’s email. Used for verification and KYC.
fiatAmountstring or numberYesThe fiat amount the merchant wants to receive (net). Must be a valid decimal.
networkstringNoBlockchain network: BTC, LTC, ETH, SOL, or XRP. Falls back to your saved defaults if omitted.
assetstringNoCrypto asset: BTC, LTC, ETH, SOL, XRP, USDT, or USDC. USDT/USDC require network to be ETH. Falls back to your saved defaults if omitted.
fiatCurrencystringNoFiat currency code. Defaults to EUR if not provided and no saved default. See supported currencies below.
referencestringNoYour own unique reference for this order. If provided, must be unique across your orders.
merchantIdstringNoOptional merchant identifier for multi-merchant setups.
providerstringNoOptional provider preference. If omitted, the provider is chosen automatically based on customer geolocation.
If network and asset are not provided, the API will use your saved defaults from /api/ramping/settings-token. If no defaults are saved either, the request will fail with a 400 error.

Query parameters

ParamTypeNotes
replaceCancelled"1"If set, allows re-creating a link for a previously cancelled order with the same reference.

Success response (200)

{
  "url": "https://www.niftipay.com/ramping/pay/eyJhbG...",
  "token": "eyJhbG...",
  "order": {
    "id": "clxyz123...",
    "reference": "INV-001",
    "network": "ETH",
    "asset": "USDT",
    "amountCrypto": "105.26",
    "fiatCurrency": "EUR",
    "fiatAmount": "100.00",
    "depositAddress": "0xabc123...",
    "destinationTag": null,
    "paymentUri": "ethereum:0xabc123...?value=105260000",
    "qrUrl": "https://...",
    "status": "pending",
    "createdAt": "2026-03-26T10:00:00.000Z",
    "expiresAt": "2026-03-27T10:00:00.000Z",
    "merchantId": null
  },
  "link": {
    "orderId": "clxyz123...",
    "reference": "INV-001",
    "fiat": "EUR",
    "fiatAmount": "100.00",
    "crypto": "USDT",
    "blockchain": "ETH",
    "expiresAt": "2026-03-27T10:00:00.000Z",
    "invoiceExpiresAt": "2026-03-27T10:00:00.000Z",
    "invoiceStatus": "pending",
    "providerHint": null,
    "fiatAmountNet": null,
    "fiatAmountGross": null,
    "feePercent": null
  }
}

Response fields

url

The full public URL to redirect your customer to. This is the on-ramp checkout page.

order

FieldTypeNotes
idstringInternal order ID.
referencestringYour reference (or auto-generated).
networkstringBlockchain network.
assetstringCrypto asset.
amountCryptostringThe crypto amount the customer needs to send.
fiatCurrencystringFiat currency code.
fiatAmountstringNet fiat amount.
depositAddressstringThe on-chain address the customer will send to.
destinationTagstring or nullXRP destination tag (only for XRP).
paymentUristringPayment URI for wallet apps.
qrUrlstringQR code image URL.
statusstringOrder status (starts as pending).
createdAtstringISO 8601 creation timestamp.
expiresAtstringISO 8601 expiration timestamp.
merchantIdstring or nullYour merchant ID if provided.
FieldTypeNotes
orderIdstringSame as order.id.
referencestringSame as order.reference.
fiatstringFiat currency.
fiatAmountstringNet fiat amount.
cryptostringCrypto asset.
blockchainstringBlockchain network.
expiresAtstringWhen the pay-link token expires.
invoiceExpiresAtstringWhen the underlying invoice expires.
invoiceStatusstringCurrent invoice status.
providerHintstring or nullProvider hint if specified.
fiatAmountNetstring or nullNet fiat amount (provider prefill).
fiatAmountGrossstring or nullGross fiat amount including fees (provider prefill).
feePercentnumber or nullFee percentage applied (provider prefill).

Supported fiat currencies

The following fiat currencies are supported for on-ramping:
CodeCurrency
USDUS Dollar
EUREuro
GBPBritish Pound
AUDAustralian Dollar
AEDUAE Dirham
BRLBrazilian Real
CADCanadian Dollar
CHFSwiss Franc
CZKCzech Koruna
DKKDanish Krone
HKDHong Kong Dollar
IDRIndonesian Rupiah
INRIndian Rupee
JPYJapanese Yen
MXNMexican Peso
NOKNorwegian Krone
NZDNew Zealand Dollar
PHPPhilippine Peso
PLNPolish Zloty
QARQatari Riyal
RONRomanian Leu
SARSaudi Riyal
SEKSwedish Krona
SGDSingapore Dollar
THBThai Baht
TRYTurkish Lira
TWDNew Taiwan Dollar
VNDVietnamese Dong
ZARSouth African Rand
Availability of specific currencies may vary depending on the customer’s country and the on-ramp provider selected.

Bank approval rates

On-ramping is limited by the customer’s card-issuing bank. Each bank has a historic approval rate that determines how likely a card transaction is to succeed. See the full Bank Approval Rates reference for all supported banks and their approval percentages by region.

Error responses

StatusConditionExample
400Missing required fields{ "error": "firstName, lastName, email are required" }
400Invalid fiat amount{ "error": "fiatAmount is required and must be a number (string or number)" }
400Missing network/asset with no defaults{ "error": "network and asset are required. Either provide them in the request or set defaults via /api/ramping/settings-token." }
400Unsupported network{ "error": "Unsupported network: ABC" }
400Asset/network mismatch{ "error": "USDC/USDT require ETH" }
403Crypto not enabled for ramping{ "error": "Crypto not enabled for ramping" }
409Duplicate reference{ "error": "Reference already exists" }
409No available deposit addresses{ "error": "No available addresses" }

Examples

curl -X POST "https://www.niftipay.com/api/ramping/links" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "firstName": "John",
    "lastName": "Doe",
    "email": "john@example.com",
    "fiatAmount": "100",
    "network": "ETH",
    "asset": "USDT",
    "fiatCurrency": "EUR"
  }'

Example 2 — With reference and merchant ID

curl -X POST "https://www.niftipay.com/api/ramping/links" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "firstName": "Jane",
    "lastName": "Smith",
    "email": "jane@example.com",
    "fiatAmount": "250.50",
    "network": "BTC",
    "asset": "BTC",
    "fiatCurrency": "USD",
    "reference": "ORDER-2026-001",
    "merchantId": "shop-london-01"
  }'

Example 3 — Using saved defaults (no network/asset/fiat)

If you have already configured defaults via the dashboard or /api/ramping/settings-token:
curl -X POST "https://www.niftipay.com/api/ramping/links" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "firstName": "Alex",
    "lastName": "Johnson",
    "email": "alex@example.com",
    "fiatAmount": "50"
  }'

Example 4 — Replace a cancelled order

If a previous order with the same reference was cancelled and you want to create a new one:
curl -X POST "https://www.niftipay.com/api/ramping/links?replaceCancelled=1" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "firstName": "John",
    "lastName": "Doe",
    "email": "john@example.com",
    "fiatAmount": "100",
    "network": "SOL",
    "asset": "SOL",
    "reference": "ORDER-2026-001"
  }'

Customer flow after redirect

Once your customer opens the url returned by this endpoint:
  1. They see the on-ramp checkout page with the invoice details pre-filled.
  2. They enter their email (used for verification code and KYC).
  3. They select a payment method: Debit/Credit Card or Bank Transfer.
  4. They are redirected to complete KYC and payment.
  5. The crypto is purchased and sent to the invoice deposit address.
  6. Once the on-chain deposit is confirmed, the invoice status changes to paid.
The on-ramp provider is automatically selected based on the customer’s geolocation. You can override this with the provider field in the API request.

Node.js Example

A complete Node.js example showing how to create an onramping pay-link, including all optional fields and response parsing.
const result = await apiRequest("POST", "/api/ramping/links", {
  // Customer details — used for checkout flow and KYC
  firstName: "John",
  lastName: "Smith",
  email: "john.smith@example.com",

  // Net fiat amount you (the merchant) want to receive
  fiatAmount: 100,

  // Blockchain network (optional — falls back to dashboard defaults)
  network: "ETH",

  // Crypto asset (optional — falls back to dashboard defaults)
  asset: "USDT",

  // Fiat currency (defaults to "EUR")
  fiatCurrency: "EUR",

  // Your unique reference (optional)
  reference: "RAMP-ORDER-001",
});

// Key response fields:
// result.url                  — redirect customer here (checkout page)
// result.token                — signed token in the URL
// result.order.id             — underlying crypto invoice ID
// result.order.depositAddress — on-chain deposit address
// result.order.amountCrypto   — crypto amount
// result.order.status         — "pending" initially
// result.link.fiatAmountNet   — net fiat amount
// result.link.fiatAmountGross — gross fiat amount (with fees)
// result.link.feePercent      — fee percentage
See the full working script with setup and helper function: API Examples (Node.js)

Webhooks

When the underlying invoice order changes status (e.g. from pending to paid), your configured webhook will fire with the order details. See the Webhooks documentation for setup and payload details.