API Overview
The Crypto Payment Gateway provides a comprehensive RESTful API for managing cryptocurrency transactions, addresses, and wallets.
Interactive API Testing
This overview page provides interactive examples you can test in real time! Enter your API key in the fields below and click the "Test" buttons to send requests to the server https://cp-merch-dev.wsdemo.online/api
.
If you encounter CORS errors:
- Use the "📋 Copy curl" buttons to get ready-to-use commands
- Execute commands in terminal or use Postman
- Install a browser extension to disable CORS (e.g., "CORS Unblock")
Base URL
Production:
https://api.your-gateway.com/api/v1
Demo/Testing:
https://cp-merch-dev.wsdemo.online/api
Demo Environment
Use the demo environment for testing and development. The demo API includes sample data and doesn't process real transactions.
OpenAPI Documentation: https://cp-merch-dev.wsdemo.online/api/openapi/
Authentication
All API requests require authentication using one of the following methods:
- API Key - Include
X-Api-Key
header with your API key - API Key - Include
X-Api-Key: <token>
header
API Versioning
Our API uses URI versioning. The current version is v1
, which is included in all endpoint URLs:
/api/v1/addresses
/api/v1/networks
/api/v1/withdrawals
Content Type
All API requests and responses use JSON format:
Content-Type: application/json
Rate Limiting
API requests are rate-limited to ensure fair usage:
- Standard endpoints: 1000 requests per minute
- Webhook endpoints: 100 requests per minute
- Admin endpoints: 500 requests per minute
Rate limit headers are included in all responses:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1640995200
Error Handling
The API uses standard HTTP status codes:
200 OK
- Request successful201 Created
- Resource created successfully400 Bad Request
- Invalid request parameters401 Unauthorized
- Authentication required403 Forbidden
- Insufficient permissions404 Not Found
- Resource not found429 Too Many Requests
- Rate limit exceeded500 Internal Server Error
- Server error
Error Response Format
{
"error": {
"code": "INVALID_PARAMETER",
"message": "The provided network slug is invalid",
"details": [
{
"field": "network",
"value": "invalid-network",
"constraints": {
"isNotExisting": "Network invalid-network does not exist"
}
}
]
}
}
Core Resources
Addresses
Manage cryptocurrency addresses and wallets.
Key endpoints:
POST /addresses
- Create new addressGET /addresses/{address}
- Get address detailsGET /addresses/hot-wallet/{network}
- Get hot wallet balanceGET /addresses/cold-wallet/{network}
- Get cold wallet balance
Networks
Configure and manage blockchain networks.
Key endpoints:
GET /networks
- List all networksGET /networks/{network}
- Get network detailsPUT /networks
- Configure network settingsGET /networks/last-number-blocks
- Get latest block numbers
Withdrawals
Process cryptocurrency withdrawals.
Key endpoints:
POST /withdrawals
- Initiate withdrawalGET /withdrawals/requests
- List withdrawal requestsPUT /withdrawals/request/accept
- Accept withdrawalPUT /withdrawals/request/reject
- Reject withdrawal
Transactions
Query transaction history and details.
Key endpoints:
GET /transactions
- List transactionsGET /transactions/{txId}
- Get transaction detailsGET /transactions/address/{address}
- Get address transactions
Interactive API Explorer
API Configuration
Quick API Tests
Try our API endpoints directly in your browser:
SDK Libraries
We provide official SDK libraries for popular programming languages:
Go SDK
import "github.com/your-org/crypto-gateway-go"
client := gateway.NewClient("your-api-key")
address, err := client.CreateAddress("ethereum", "")
TypeScript SDK
import { CryptoGateway } from '@your-org/crypto-gateway-ts';
const client = new CryptoGateway('your-api-key');
const address = await client.createAddress('ethereum');
Python SDK
from crypto_gateway import CryptoGateway
client = CryptoGateway('your-api-key')
address = client.create_address('ethereum')
Webhooks
Stay updated with real-time notifications:
{
"event": "transaction.confirmed",
"data": {
"txId": "0x123...",
"address": "0xabc...",
"amount": "1.5",
"coin": "ethereum",
"confirmations": 12
},
"timestamp": "2024-01-15T10:30:00Z"
}
Next Steps
- Authentication Guide - Learn how to authenticate API requests
- Addresses API - Detailed address management endpoints
- Networks API - Network configuration and monitoring
- Withdrawals API - Process cryptocurrency withdrawals