Getting Started with CryptoPay
Welcome to CryptoPay! This guide will help you integrate our multi-chain blockchain payment gateway into your application.
tip
All calls to the API should be made to the following URL: https://api.echogate.craftfolio.dev
What is CryptoPay?
CryptoPay is a production-ready blockchain payment gateway that enables you to accept cryptocurrency payments across multiple blockchains including Ethereum, Base, Polygon, and more. Our platform provides:
- Multi-chain support - Accept payments on multiple blockchains
- Real-time notifications - Get instant webhooks when payments are received
- Enterprise security - Production-ready with proper confirmation handling
- Developer-friendly API - RESTful API with comprehensive documentation
Quick Start
1. Create an Account
First, create your merchant account by registering at our platform:
curl -X POST /api/auth/register \
-H "Content-Type: application/json" \
-d '{
"username": "your-username",
"email": "your-email@example.com",
"password": "your-secure-password",
"shop_name": "Your Business Name"
}'
2. Get Your API Key
After registration, obtain your API key from the dashboard or via API:
curl -X POST /api/auth/login \
-H "Content-Type: application/json" \
-d '{
"username": "your-username",
"password": "your-password"
}'
3. Configure Wallet Addresses
Set up wallet addresses for each blockchain you want to accept payments on:
curl -X POST /api/merchant-wallets/ \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"blockchain": 1,
"wallet_address": "0x1234567890123456789012345678901234567890",
"confirmation_threshold": 12,
"is_active": true
}'
4. Create Your First Payment Order
const createPaymentOrder = async () => {
const response = await fetch('/api/payment-orders/', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: '100.00',
currency: 'USDC',
blockchain: 'base',
order_info: JSON.stringify({
product: 'Premium Plan',
quantity: 1,
customer_id: 'user_123'
}),
nonce: Date.now() + Math.floor(Math.random() * 1000000)
})
});
const order = await response.json();
console.log('Payment order created:', order);
return order;
};
5. Handle Payment Notifications
Set up webhook endpoints to receive real-time payment notifications:
// Express.js webhook handler
app.post('/webhooks/cryptopay', (req, res) => {
const signature = req.headers['x-webhook-signature'];
const payload = JSON.stringify(req.body);
// Verify webhook signature (recommended)
const expectedSignature = crypto
.createHmac('sha256', process.env.WEBHOOK_SECRET)
.update(payload)
.digest('hex');
if (signature === expectedSignature) {
const { event, data } = req.body;
switch (event) {
case 'payment.pending':
console.log('Payment pending:', data);
break;
case 'payment.confirmed':
console.log('Payment confirmed:', data);
// Update your database, fulfill order, etc.
break;
case 'payment.failed':
console.log('Payment failed:', data);
break;
}
}
res.status(200).send('OK');
});
Next Steps
- API Reference - Complete API documentation
- Webhooks - Set up real-time notifications
- Security - Best practices for production
- Supported Blockchains - Available networks and tokens
Need Help?
- Check our FAQ
- Join our Discord community
- Email us at support@cryptopay.com