Create Sell Checkout
Create a checkout intent to execute an off-ramp (crypto to fiat) transaction. Pass the onramp value from a sell quote response.
POST
https://api.zenpayz.com/payment/api/v1/off-ramp/checkoutBearer · API key
Request
Headers
| Header | Description |
|---|---|
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
| Parameter | Type | Description |
|---|---|---|
onramp REQUIRED | string | Identifier from sell quote response |
source REQUIRED | string | Crypto ID (e.g. btc_bitcoin) |
destination REQUIRED | string | Fiat currency (e.g. usd) |
amount REQUIRED | number | Crypto amount to sell |
type REQUIRED | string | sell |
paymentMethod REQUIRED | string | Payout method (e.g. bank_transfer) |
walletAddress OPTIONAL | string | Source wallet address. See Wallet Addresses |
walletMemo OPTIONAL | string | Memo/tag for XRP, XLM, etc. |
network OPTIONAL | string | Blockchain network |
country OPTIONAL | string | ISO country code |
sessionId OPTIONAL | string | Checkout session ID for tracking |
walletAddresses OPTIONAL | object | Network-to-address mappings |
Response
Success (200 OK)
{
"success": true,
"data": {
"transactionId": "txn_def456",
"redirectUrl": "https://checkout.example.com/...",
"status": "pending"
},
"message": "Sell checkout intent created"
}
Response Fields
| Parameter | Type | Description |
|---|---|---|
transactionId OPTIONAL | string | Unique transaction identifier |
redirectUrl OPTIONAL | string | URL to redirect the user to complete the sell |
status OPTIONAL | string | Initial status (pending) |
Error Responses
| Code | HTTP | Message |
|---|---|---|
| VALIDATION_ERROR | 400 | Invalid request body |
| OFFRAMP_CHECKOUT_FAILED | 500 | Failed to create sell checkout |
Examples
- cURL
- JavaScript
- Python
curl -X POST https://api.zenpayz.com/payment/api/v1/off-ramp/checkout \
-H "Content-Type: application/json" \
-d '{
"onramp": "moonpay",
"source": "btc_bitcoin",
"destination": "usd",
"amount": 0.01,
"type": "sell",
"paymentMethod": "bank_transfer",
"walletAddress": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh"
}'
const response = await fetch('https://api.zenpayz.com/payment/api/v1/off-ramp/checkout', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
onramp: 'moonpay',
source: 'btc_bitcoin',
destination: 'usd',
amount: 0.01,
type: 'sell',
paymentMethod: 'bank_transfer',
walletAddress: 'bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh',
}),
});
const { data } = await response.json();
window.location.href = data.redirectUrl;
import requests
response = requests.post(
"https://api.zenpayz.com/payment/api/v1/off-ramp/checkout",
json={
"onramp": "moonpay",
"source": "btc_bitcoin",
"destination": "usd",
"amount": 0.01,
"type": "sell",
"paymentMethod": "bank_transfer",
"walletAddress": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
},
)
data = response.json()["data"]
print(f"Transaction: {data['transactionId']}")
print(f"Redirect to: {data['redirectUrl']}")
Next Steps
- Transaction Status -- Poll transaction progress
- Sell Quotes -- Get quotes before checkout
- Wallet Addresses -- Understand wallet resolution