A step-by-step guide to accepting your first cryptocurrency payment with ZenPay.
ZenPay offers multiple ways to accept cryptocurrency payments, depending on your business needs and technical capabilities. Let's explore each option:
The easiest way to start accepting payments. No coding required.
Generate payment links to share with customers.
Seamless checkout integrated into your existing flow.
Direct API calls for complete control.
Let's start with the easiest method: creating a payment button that you can embed on your website.
From your ZenPay dashboard, go to Payments → Payment Buttons → Create New Button.
Fill in the following details:
After saving, you'll receive HTML code for your button. Copy this code to use on your website.
<script src="https://js.zenpay.io/v1/button.js"></script>
<div class="zenpay-button"
data-button-id="btn_1234567890"
data-price="25.00"
data-currency="USD"
data-name="Premium Subscription"
data-color="#4F46E5"
data-text="Pay with Crypto">
</div>Paste the code into your website where you want the button to appear. The script automatically handles the payment flow.
Checkout links are perfect when you don't have a website or want to send payment requests via email, messaging apps, or social media.
Navigate to Checkout Links: From your dashboard, go to Payments → Checkout Links → Create New Link.
Configure Link Settings: Enter product details, price, currency, and payment options.
Generate Link: Click "Create Link" to generate a unique payment URL.
Share Your Link: Copy and share the link with your customers via email, social media, or messaging apps. You can also download a QR code for the link.
https://pay.zenpay.io/c/ZP_checkout_123456abcdefFor a seamless checkout experience that matches your website design, the ZenPay Custom Checkout is the ideal solution.
// 1. Add ZenPay.js to your website
<script src="https://js.zenpay.io/v1/zenpay.js"></script>
// 2. Initialize ZenPay with your API key
<script>
const zenpay = new ZenPay('pk_test_YourPublicKey');
document.getElementById('payment-form').addEventListener('submit', async (e) => {
e.preventDefault();
try {
// Create a payment session
const session = await zenpay.createPaymentSession({
amount: 50.00,
currency: 'USD',
product_name: 'Premium Plan',
customer_email: document.getElementById('email').value,
redirect_url: 'https://yourwebsite.com/thank-you'
});
// Open the checkout modal
zenpay.openCheckout(session.id);
} catch (error) {
console.error('Error creating payment session:', error);
}
});
</script>
// 3. Add a form to your website
<form id="payment-form">
<input type="email" id="email" placeholder="Your email" required />
<button type="submit">Checkout</button>
</form>For maximum flexibility and control, you can integrate directly with our API. This is ideal for custom applications and e-commerce platforms.
// Using the ZenPay Node.js SDK
const ZenPay = require('@zenpay/node');
const zenpay = new ZenPay('sk_test_YourSecretKey');
// Create an Express route handler for payments
app.post('/create-payment', async (req, res) => {
try {
// Create a payment
const payment = await zenpay.payments.create({
amount: req.body.amount,
currency: req.body.currency,
product_name: req.body.product_name,
customer_email: req.body.email,
metadata: {
order_id: req.body.order_id,
},
webhook_url: 'https://yourwebsite.com/webhooks/zenpay',
success_url: 'https://yourwebsite.com/thank-you',
cancel_url: 'https://yourwebsite.com/cart',
});
// Return the payment data to the client
res.json({
paymentId: payment.id,
checkoutUrl: payment.checkout_url
});
} catch (error) {
console.error('Payment creation failed:', error);
res.status(500).json({ error: error.message });
}
});Before accepting real payments, test your integration using ZenPay's test mode:
pk_test_ and sk_test_tb1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0g0xb794f5ea0ba39494ce839613fffba74279579268After setting up your payment method, you can monitor payments in real-time from your ZenPay dashboard:
When a customer clicks your payment button or link, they'll see a checkout page with cryptocurrency options.
The payment appears in your dashboard with a "Pending" status while waiting for blockchain confirmations.
Once confirmed, the status changes to "Completed" and you'll receive an email notification.
Funds are settled to your ZenPay account and can be withdrawn to your connected bank account or crypto wallet.