Accept Your First Payment
A step-by-step guide to accepting your first cryptocurrency payment with CryptoPay.
Payment Integration Options
Payment Buttons
The easiest way to start accepting payments. No coding required.
- Simple copy-paste integration
- Customizable appearance
- Best for simple websites and blogs
Checkout Links
Generate payment links to share with customers.
- No website integration needed
- Share via email, messaging, or QR codes
- Perfect for social media and remote sales
Custom Checkout
Seamless checkout integrated into your existing flow.
- Fully customizable experience
- Advanced integration capabilities
- Ideal for e-commerce platforms
API Integration
Direct API calls for complete control.
- Maximum flexibility and control
- Backend integration capabilities
- Best for custom applications
Option 1: Payment Button
Navigate to Payment Buttons
From your CryptoPay dashboard, go to Payments → Payment Buttons → Create New Button.
Configure Button Settings
Fill in the following details:
- Button name (for your reference)
- Product or service name
- Price and currency
- Accepted cryptocurrencies
- Button appearance (colors, text, size)
Copy the Button Code
After saving, you'll receive HTML code for your button. Copy this code to use on your website.
<script src="https://js.CryptoPay.io/v1/button.js"></script>
<div class="CryptoPay-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>Add to Your Website
Paste the code into your website where you want the button to appear. The script automatically handles the payment flow.
Option 2: Checkout Links
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.
Example Checkout Link:
https://pay.CryptoPay.io/c/ZP_checkout_123456abcdefOption 3: Custom Checkout
// 1. Add CryptoPay.js to your website
<script src="https://js.CryptoPay.io/v1/CryptoPay.js"></script>
// 2. Initialize CryptoPay with your API key
<script>
const CryptoPay = new CryptoPay('pk_test_YourPublicKey');
document.getElementById('payment-form').addEventListener('submit', async (e) => {
e.preventDefault();
try {
// Create a payment session
const session = await CryptoPay.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
CryptoPay.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> Option 4: API Integration
// Using the CryptoPay Node.js SDK
const CryptoPay = require('@CryptoPay/node');
const CryptoPay = new CryptoPay('sk_test_YourSecretKey');
// Create an Express route handler for payments
app.post('/create-payment', async (req, res) => {
try {
// Create a payment
const payment = await CryptoPay.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/CryptoPay',
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 });
}
}); Testing Your Integration
Before accepting real payments, test your integration using CryptoPay's test mode:
Test Mode Setup
- Toggle to Test Mode in your dashboard settings
- Use test API keys that start with
pk_test_andsk_test_
Test Wallet Addresses
tb1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0g0xb794f5ea0ba39494ce839613fffba74279579268Monitoring Your First Payment
Payment Initiated
Customer sees checkout page.
Payment Pending
Status is "Pending" while waiting confirmations.
Payment Completed
Status changes to "Completed".
Settlement
Funds settled to your account.