API Reference
CyberPay provides a comprehensive suite of cross-chain payment APIs that enable developers to easily integrate cryptocurrency payments across multiple blockchain networks.
Payment Flow APIs
The core payment APIs follow a structured 5-step process:
🏪 Create Checkout
Initialize a payment session with product details and merchant configuration.
- Set payment amount and settlement currency
- Configure return URLs and webhooks
- Get available payment methods
💰 Get Quote
Get real-time pricing and routing for cross-chain payments.
- Real-time exchange rates and fees
- Optimal routing across multiple networks
- Transparent fee breakdown
📋 Create Order
Lock in pricing and create an executable payment order.
- Reserve quoted prices
- Set payment constraints and deadlines
- Generate order tracking ID
🚀 Execute Payment
Generate transaction data for user wallet execution.
- Step-by-step transaction plan
- Gas optimization and estimation
- Multi-step cross-chain routing
📊 Query Status
Monitor payment progress in real-time.
- Complete transaction history
- Real-time status updates
- Detailed event timeline
Data & Utility APIs
📈 Token Prices
- Real-time cryptocurrency prices
- Historical price data
- Multi-currency support
🪙 Supported Tokens
- Complete token directory
- Network availability
- Contract addresses and metadata
🌐 Supported Chains
- Blockchain network information
- Network status and capabilities
- Bridge and DEX integrations
💳 Wallet Balance
- Multi-chain balance queries
- Token balance aggregation
- Real-time balance updates
Merchant Tools
⚙️ Merchant Configuration
- API key management
- Settlement preferences
- Rate limits and permissions
💸 Payout Management
- Settlement history
- Batch payout processing
- Reconciliation tools
🔔 Webhook Setup
- Real-time event notifications
- Signature verification
- Event filtering and routing
API Features
⚡ High Performance
- Sub-second response times
- Intelligent caching mechanisms
- Load balancing and redundancy
🔒 Enterprise Security
- Multi-signature wallet architecture
- Pre-transaction validation
- Comprehensive audit trails
🌐 Multi-Chain Support
- Ethereum - Maximum liquidity and DeFi ecosystem
- Polygon - Low-cost, fast transactions
- Optimism - Layer 2 scaling with Ethereum security
- Arbitrum - High-throughput Layer 2 solution
- Base - Coinbase's Layer 2 network
- More networks being added regularly
Quick Start
1. Get API Access
# Sign up for API access
curl -X POST https://api.cyberpay.org/auth/register \
-H "Content-Type: application/json" \
-d '{"email": "your@email.com"}'2. Basic Request Format
const response = await fetch('https://api.cyberpay.org/v1/checkout/create', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
body: JSON.stringify({
merchantId: 'your_merchant_id',
amount: '99.99',
currency: 'USDC',
productInfo: {
name: 'Premium Subscription'
},
returnUrl: 'https://yourstore.com/success'
})
});3. Standard Response Format
All API responses follow a consistent structure:
{
"success": true,
"data": {
// Response data
},
"error": null,
"timestamp": "2024-01-01T00:00:00Z"
}Error Handling
Common Error Codes
| Code | Description | Solution |
|---|---|---|
| 400 | Bad Request | Check request parameters |
| 401 | Unauthorized | Verify API key |
| 429 | Rate Limited | Reduce request frequency |
| 500 | Server Error | Retry or contact support |
Error Response Format
{
"success": false,
"data": null,
"error": {
"code": "INVALID_PARAMETERS",
"message": "Invalid request parameters",
"details": {
"field": "amount",
"reason": "Amount must be a positive number"
}
},
"timestamp": "2024-01-01T00:00:00Z"
}Rate Limits
- Standard: 100 requests/minute
- Premium: 1000 requests/minute
- Enterprise: Custom limits available
SDK Support
We provide SDKs for popular programming languages:
# JavaScript/TypeScript
npm install @cyberpay/sdk
# Python
pip install cyberpay-python
# Go
go get github.com/cyberpay/cyberpay-goAPI Endpoints
Payment Flow
- Create Checkout - Initialize payment session
- Get Quote - Get real-time pricing
- Create Order - Lock in pricing
- Execute Payment - Process payment
- Query Status - Monitor progress
Data & Utilities
- Token Prices - Real-time price data
- Supported Tokens - Available tokens
- Supported Chains - Network information
- Wallet Balance - Balance queries
Merchant Tools
- Merchant Config - Account settings
- Payout Management - Settlement tools
- Webhook Setup - Event notifications
Next Steps
- Start with the basics: Protocol Overview
- Try your first call: Authentication
- Explore SDKs: JavaScript SDK
- Integration guides: Best Practices
Support
- 📧 Email: support@cyberpay.org
- 💬 Telegram: @cyberpay_support
- 📖 GitHub: cyberpay/docs
