Integrate MugglePay cryptocurrency payments into your website in minutes. This guide walks you through the complete setup process.
MugglePay provides a pre-built payment page and complete checkout experience that can be branded for your business. Integrate once and gain new features as MugglePay evolves.
A website or application that needs to accept payments
Basic knowledge of HTTP APIs and webhooks
Access to your server's backend code
Integration Steps
Step 1: Register and Get API Key
Create Merchant Account
Sign up with your invitation code
Complete your merchant profile
Get Your API Key
Navigate to the API section in your dashboard
Copy your unique API authentication token
Keep this token secure - never expose it in client-side code
Learn more : Authentication Guide
Choose from our pre-designed payment buttons or create your own:
Step 3: Create Order API Integration
When a customer clicks the payment button, your backend should call the Create Order API :
Backend Implementation Example
Step 4: Handle Payment Flow
4.1 Redirect to Payment Page
After successful order creation, redirect customers to the MugglePay payment page:
4.2 Payment Callback (Webhook)
Set up webhook handling to receive real-time payment notifications:
Important : If you're not receiving webhook notifications, check:
Your callback_url is correctly set in the Create Order request
Your webhook endpoint is publicly accessible
Step 5: Testing and Validation
5.1 Test Your Integration
Create test orders with small amounts
Test the complete flow from button click to payment completion
Verify webhook notifications are received correctly
Test error scenarios (expired orders, cancellations)
5.2 Monitor in Merchant Portal
Track all transactions and orders in the Merchant Portalarrow-up-right :
Complete Integration Example
Here's a minimal working example:
Test with small amounts before going live
Implement proper error handling
Use HTTPS for all API calls
Store API tokens securely
Don't expose API tokens in client-side code
Don't skip webhook validation
Don't assume payments will always succeed
Don't forget to handle edge cases
Troubleshooting
Webhook Not Receiving Notifications
Check URL accessibility : Ensure your webhook endpoint is publicly accessible
Verify callback_url : Make sure it's correctly set in Create Order requests
Test manually : Use the Merchant Portal to trigger test callbacks
Order Creation Fails
Check API token : Verify your authentication token is correct
Required fields : Ensure all required parameters are provided
Rate limits : Check if you've exceeded API rate limits
Payment Not Confirming
Network congestion : Some blockchain networks may be slow
Order expiry : Orders expire after 60 minutes (crypto) or 3 hours (fiat)
Contact support : Reach out if issues persist
Complete the integration following this guide
Test thoroughly with small amounts
Set up monitoring for your payment flow
Go live with real customers
Optimize based on usage patterns
Community : Join our developer community for tips and best practices
Last updated 6 months ago