Skip to main content

Create Buy Checkout

Create a checkout intent to execute an on-ramp (fiat to crypto) transaction. Pass the onramp value from a quote response to select which quote to use.

POSThttps://api.zenpayz.com/payment/api/v1/on-ramp/checkout
Bearer · API key

Request

Headers

HeaderDescription
Content-Type
REQUIRED
application/json
x-request-id
OPTIONAL
Custom request ID for tracing
Public Endpoint

This endpoint does not require authentication headers.

Body Parameters

ParameterTypeDescription
onramp
REQUIRED
stringIdentifier from quote response (e.g. moonpay)
source
REQUIRED
stringFiat currency (e.g. usd)
destination
REQUIRED
stringCrypto ID (e.g. btc_bitcoin)
amount
REQUIRED
numberFiat amount
type
REQUIRED
stringbuy
paymentMethod
REQUIRED
stringPayment method (e.g. creditcard)
walletAddress
OPTIONAL
stringCrypto wallet address for delivery. See Wallet Addresses
walletMemo
OPTIONAL
stringMemo/tag for XRP, XLM, etc.
network
OPTIONAL
stringBlockchain network (e.g. ethereum)
country
OPTIONAL
stringISO country code
sessionId
OPTIONAL
stringCheckout session ID for tracking
walletAddresses
OPTIONAL
objectNetwork-to-address mappings (e.g. { "ethereum": "0x..." })
Wallet Resolution

If walletAddress is not provided but sessionId is, ZenPays automatically resolves the wallet from your merchant settings. See Wallet Addresses for details.

Response

Success (200 OK)

{
"success": true,
"data": {
"transactionId": "txn_abc123",
"redirectUrl": "https://checkout.example.com/...",
"status": "pending"
},
"message": "Checkout intent created"
}

Response Fields

ParameterTypeDescription
transactionId
OPTIONAL
stringUnique transaction identifier
redirectUrl
OPTIONAL
stringURL to redirect the user to complete payment
status
OPTIONAL
stringInitial status (pending)

After receiving the response, redirect the user to redirectUrl to complete payment.

Error Responses

CodeHTTPMessage
VALIDATION_ERROR400Invalid request body
RAMP_CHECKOUT_FAILED500Failed to create checkout intent

Examples

curl -X POST https://api.zenpayz.com/payment/api/v1/on-ramp/checkout \
-H "Content-Type: application/json" \
-d '{
"onramp": "moonpay",
"source": "usd",
"destination": "btc_bitcoin",
"amount": 100,
"type": "buy",
"paymentMethod": "creditcard",
"walletAddress": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh"
}'

Full Integration Flow

1. GET  /on-ramp/supported-assets   → Populate currency dropdowns
2. GET /on-ramp/payment-methods/usd → Get available payment options
3. GET /on-ramp/quotes?source=usd&destination=btc_bitcoin&amount=100
→ Show pricing options to user
4. POST /on-ramp/checkout → Create checkout with selected quote
5. Redirect to redirectUrl → User completes payment
6. GET /on-ramp/transactions/{id} → Poll until completed or failed

For merchants using ramp intents, use this endpoint to create a buy checkout tied to an existing intent.

Endpoint

POST /payment/api/v1/on-ramp/buy/checkout

Body Parameters

ParameterTypeDescription
intentId
REQUIRED
stringRamp intent ID
cryptoCurrency
REQUIRED
stringCrypto to buy (e.g. USDT)
chain
REQUIRED
stringBlockchain network (e.g. tron, ethereum)
fiatCurrency
REQUIRED
stringFiat currency (e.g. USD)
fiatAmount
REQUIRED
numberAmount to pay in fiat
cryptoAmount
REQUIRED
numberExpected crypto amount to receive
rate
REQUIRED
numberLocked exchange rate
totalFee
REQUIRED
numberTotal fees
quoteId
OPTIONAL
stringQuote ID from quotes endpoint

Sample Request

{
"intentId": "ri_1710345678000_a1b2c3d4e5f6g7h8",
"cryptoCurrency": "USDT",
"chain": "tron",
"fiatCurrency": "USD",
"fiatAmount": 100,
"cryptoAmount": 98.5,
"rate": 1.0,
"totalFee": 1.5
}

Response (200 OK)

{
"success": true,
"data": {
"intentId": "ri_1710345678000_a1b2c3d4e5f6g7h8",
"paymentIntentId": "pi_abc123def456",
"checkoutUrl": "https://checkout.zenpayz.com/pay/pi_abc123def456",
"fiatAmount": 100,
"fiatCurrency": "USD",
"cryptoAmount": 98.5,
"cryptoCurrency": "USDT",
"chain": "tron",
"rate": 1.0,
"expiresAt": "2026-03-15T10:00:00.000Z"
},
"message": "Buy checkout created"
}

Response Fields

ParameterTypeDescription
intentId
OPTIONAL
stringRamp intent ID
paymentIntentId
OPTIONAL
stringPayment intent for the fiat charge
checkoutUrl
OPTIONAL
stringURL to redirect customer for payment
fiatAmount
OPTIONAL
numberFiat amount to charge
fiatCurrency
OPTIONAL
stringFiat currency
cryptoAmount
OPTIONAL
numberCrypto amount customer will receive
cryptoCurrency
OPTIONAL
stringCrypto currency
chain
OPTIONAL
stringBlockchain network
rate
OPTIONAL
numberExchange rate applied
expiresAt
OPTIONAL
stringCheckout expiry (ISO 8601)

Next Steps