API Integration (Stripe-Compatible)
Zyrox provides a Stripe-compatible API that allows you to accept crypto payments using existing Stripe SDKs and code. Just change the API base URL — no other code changes required.
Quick Start
1. Get Your API Key
Go to Merchants → [Your Merchant] → Integrations → Add Integration → Stripe Emulator and you'll receive:
- API Secret Key — for authenticating API requests (like Stripe's
sk_live_xxx) - Webhook Signing Secret — for verifying webhook signatures (like Stripe's
whsec_xxx)
2. Change the API Base URL
In your existing Stripe integration code, change the base URL:
// Before (Stripe)
const stripe = require('stripe')('sk_live_xxx');
// After (Zyrox) — just add the baseURL option
const stripe = require('stripe')('YOUR_ZYROX_API_KEY', {
apiVersion: '2023-10-16',
host: 'app.zyrox.io',
port: 443,
protocol: 'https',
basePath: '/api/webhook/v1',
});
3. Create a Checkout Session
const session = await stripe.checkout.sessions.create({
mode: 'payment',
line_items: [{
price_data: {
currency: 'usd',
product_data: { name: 'Premium Plan' },
unit_amount: 2999, // $29.99 in cents
},
quantity: 1,
}],
success_url: 'https://yoursite.com/success',
cancel_url: 'https://yoursite.com/cancel',
});
// Redirect customer to session.url
4. Handle Webhooks
app.post('/webhook', express.raw({type: 'application/json'}), (req, res) => {
const sig = req.headers['stripe-signature'];
const event = stripe.webhooks.constructEvent(req.body, sig, 'YOUR_WEBHOOK_SECRET');
switch (event.type) {
case 'checkout.session.completed':
// Payment successful
break;
case 'invoice.paid':
// Subscription renewal successful
break;
}
res.json({ received: true });
});
Supported Endpoints
| Endpoint | Method | Description |
|---|---|---|
/api/webhook/v1/checkout/sessions | POST | Create a checkout session |
/api/webhook/v1/checkout/sessions/:id | GET | Retrieve a session |
Supported Webhook Events
checkout.session.completed— fired when a one-time payment or initial subscription payment is completedinvoice.paid— fired for recurring subscription payments
Subscription Support
For recurring payments, set mode: 'subscription' in the checkout session:
const session = await stripe.checkout.sessions.create({
mode: 'subscription',
line_items: [{
price_data: {
currency: 'usd',
product_data: { name: 'Monthly Plan' },
unit_amount: 999,
recurring: { interval: 'month' },
},
quantity: 1,
}],
success_url: 'https://yoursite.com/success',
cancel_url: 'https://yoursite.com/cancel',
});
Authentication
All API requests use Basic Auth with your API secret key (same as Stripe):
Authorization: Basic base64(YOUR_API_KEY:)
The Stripe SDK handles this automatically when you pass your API key.
Note: The Zyrox Stripe emulator is designed for drop-in compatibility. If you have an existing Stripe integration, the migration should take minutes, not hours.
© 2026 Zyrox. Simple and secure crypto payment processing.