Integrate MugglePay with Cursor, Windsurf, and other AI-assisted coding tools to add cryptocurrency payments to your existing applications.
Quick Setup
Copy and paste this prompt into Cursor when you want to add MugglePay to your existing project:
I want to add cryptocurrency payment functionality to my existing application using MugglePay.
Please help me integrate the MugglePay API into my current [React/Next.js/Node.js] application.
Requirements:
- Accept payments in USDT, USDC
- Support multiple blockchain networks (Tron, Ethereum, Arbitrum, Base)
- Handle payment callbacks and webhooks
- Implement proper error handling and user feedback
Tech stack: [specify your preferred stack]
API Documentation:
- Create Order: https://docs.mugglepay.com/order/createorder
- Payment Callback: https://docs.mugglepay.com/order/paymentcallback
Example API call:
curl -X POST https://api.mugglepay.com/v1/orders \
-H 'Content-Type: application/json' \
-H 'token: YOUR_API_TOKEN' \
-d '{
"merchant_order_id": "order_12345",
"price_amount": 29.99,
"price_currency": "USD",
"title": "Premium Subscription",
"callback_url": "https://yoursite.com/webhooks/payment"
}'
Code Examples
Direct API Integration
Since we don't have a package, you'll integrate directly with our REST API. Here are the actual API endpoints and examples:
Create Order API
Response Format:
Redirect the page to the payment_url. If the user finishes payments, it will show the payment success.
Advanced Order with Callback
Basic Payment Button Component
API Route Handler
API Reference
Supported Tokens
The pay_currency field is optional. If it's not set, users can select manually. Here are the supported pay_currency values:
If the payment is successful, it will trigger a callback to your callback_url with the payment information. Check the Payment Callback documentation for more details.
Supported Features
Cryptocurrencies
USDT: Tron (TRC20), Ethereum (ERC20), Arbitrum (ARB20), Celo, TON