Welcome to CryptoGate API
Build powerful cryptocurrency payment integrations with our RESTful API
Base URL
https://api.cryptogate.live/
Security
All API requests must be made over HTTPS. Requests made over plain HTTP will fail. API requests without authentication will also fail.
Response Format
All API responses are returned in JSON format with appropriate HTTP status codes.
RESTful API
Clean, predictable URLs and standard HTTP response codes make integration straightforward.
Secure by Default
API keys, HTTPS-only, and webhook signature verification keep your integration secure.
Developer Friendly
Comprehensive documentation, code examples, and SDKs in multiple languages.
Authentication
Authenticate your API requests with API keys
The CryptoGate API uses API keys to authenticate requests. You can view and manage your API keys in the Dashboard.
Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, etc.
API Key Types
Secret Key: Use this key for server-side requests. It has full access to your account and should be kept confidential.
Public Key: Use this key for client-side integrations (payment buttons, etc.). It has limited permissions.
Making Authenticated Requests
Include your API key in the Authorization header
using the Bearer authentication scheme:
curl https://api.cryptogate.live//payments \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json"
Quick Start Guide
Get up and running in minutes
Step 1: Create an Account
Sign up for a CryptoGate account at cryptogate.live/signup and verify your email.
Step 2: Generate API Keys
Navigate to your dashboard and generate your API keys. Save your secret key in a secure location.
Step 3: Create Your First Payment
Make a POST request to create a payment:
curl -X POST https://api.cryptogate.live//payments \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": "0.001",
"description": "Test Payment",
"redirect_url": "https://yourstore.com/success"
}'
Step 4: Handle the Response
You'll receive a JSON response with payment details:
{
"id": "pay_1234567890",
"status": "pending",
"amount": "0.001",
"currency": "BTC",
"payment_address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
"payment_url": "https://cryptogate.live/pay/pay_1234567890",
"created_at": "2025-10-18T10:30:00Z",
"expires_at": "2025-10-18T11:30:00Z"
}
Step 5: Direct User to Payment
Redirect your customer to the payment_url or
display the payment_address and QR code.
Error Handling
Understanding and handling API errors
CryptoGate uses conventional HTTP response codes to indicate the success or failure of an API request.
HTTP Status Codes
Request succeeded
Resource created successfully
Invalid request parameters
Invalid or missing API key
Resource not found
Rate limit exceeded
Server error occurred
Error Response Format
{
"error": {
"type": "invalid_request",
"message": "Amount must be greater than 0",
"param": "amount"
}
}
Create Simple Payment
Create a basic payment without product details
/api/payment/create/simple
This endpoint can be used with either your Public Key or Secret Key. Public keys can only create payments, not list or view them.
Request Parameters
amount_usd
required
return_url
required
Example Request
curl -X POST https://api.cryptogate.live/api/payment/create/simple \
-H "Authorization: Bearer YOUR_PUBLIC_OR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount_usd": 150.00,
"return_url": "https://yourstore.com/complete"
}'
Response
{
"success": true,
"transaction_id": "txid_abc123xyz",
"payment_url": "https://cryptogate.live/payments/?id=txid_abc123xyz",
"amount_usd": "150.00",
"expires_at": "2025-12-03T15:30:00Z",
"status": "pending"
}
Note: The customer selects their preferred cryptocurrency on the payment page. No crypto address is generated until the customer chooses BTC, ETH, LTC, DASH, or DOGE.
Create Advanced Payment
Create itemized payment with product breakdown
/api/payment/create/advanced
This endpoint can be used with either your Public Key or Secret Key. Public keys can only create payments, not list or view them.
Request Parameters
return_url
required
items
required
tax
required
invoice_id
optional
Item Object Fields
product_id
required
name
required
quantity
required
unit_price
required
Example Request
curl -X POST https://api.cryptogate.live/api/payment/create/advanced \
-H "Authorization: Bearer YOUR_PUBLIC_OR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"return_url": "https://yourstore.com/order/12345/complete",
"tax": 8.90,
"items": [
{
"product_id": "prod_hosting_annual",
"name": "Website Hosting - Annual Plan",
"quantity": 1,
"unit_price": 120.00
},
{
"product_id": "prod_ssl_wildcard",
"name": "SSL Certificate - Wildcard",
"quantity": 1,
"unit_price": 35.00
}
]
}'
Response
{
"success": true,
"transaction_id": "txid_xyz789abc",
"payment_url": "https://cryptogate.live/payment?id=txid_xyz789abc",
"amount_usd": "163.90",
"items_count": 2,
"expires_at": "2025-12-03T15:30:00Z",
"status": "pending"
}
Get Payment
Retrieve details of a specific payment
/api/payment/{payment_id}
This endpoint requires your Secret Key. Public keys cannot view payment details.
Path Parameters
payment_id
required
Example Request
curl https://api.cryptogate.live/api/payment/txid_abc123xyz \
-H "Authorization: Bearer YOUR_SECRET_KEY"
Response
{
"id": "pay_1234567890",
"status": "completed",
"amount": "0.001",
"amount_received": "0.001",
"currency": "BTC",
"description": "Order #12345",
"payment_address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
"transaction_hash": "a1b2c3d4e5f6...",
"confirmations": 3,
"created_at": "2025-10-18T10:30:00Z",
"completed_at": "2025-10-18T10:45:00Z",
"expires_at": "2025-10-18T11:30:00Z",
"metadata": {
"order_id": "12345",
"customer_id": "cus_987654"
}
}
Payment Status Values
pending
Payment created, awaiting payment from customer
processing
Payment received, awaiting confirmations
completed
Payment confirmed and completed
expired
Payment window expired without payment
cancelled
Payment cancelled by merchant
failed
Payment failed or insufficient amount received
List Payments
Retrieve a list of all payments
/api/payments
This endpoint requires your Secret Key. Public keys cannot list payments.
Query Parameters
limit
optional
starting_after
optional
status
optional
currency
optional
Example Request
curl "https://api.cryptogate.live/api/payments?limit=10&status=completed" \
-H "Authorization: Bearer YOUR_SECRET_KEY"
Response
{
"success": true,
"data": [
{
"transaction_id": "txid_abc123xyz",
"status": "completed",
"amount_usd": "150.00",
"currency": "BTC",
"created_at": "2025-12-03T10:30:00Z",
"completed_at": "2025-12-03T10:45:00Z"
},
{
"transaction_id": "txid_xyz789abc",
"status": "completed",
"amount_usd": "163.90",
"currency": "ETH",
"created_at": "2025-12-03T09:15:00Z",
"completed_at": "2025-12-03T09:25:00Z"
}
],
"has_more": true,
"total_count": 87
}
Fetch Crypto Prices
Get real-time cryptocurrency prices in USD
/api/crypto/prices
Retrieve current market prices for supported cryptocurrencies. Prices are updated in real-time from major exchanges.
Query Parameters
currencies
optional
Example Request
curl "https://api.cryptogate.live/api/crypto/prices?currencies=BTC,ETH,LTC" \
-H "Authorization: Bearer YOUR_API_KEY"
Response
{
"success": true,
"timestamp": "2025-12-08T15:30:00Z",
"prices": {
"BTC": {
"usd": 42150.50,
"change_24h": 2.34
},
"ETH": {
"usd": 2245.75,
"change_24h": -0.87
},
"LTC": {
"usd": 95.30,
"change_24h": 1.12
}
}
}
Check Address Balance
Query the balance of any cryptocurrency address
/api/crypto/balance
Check the balance of any cryptocurrency address. Supports BTC, ETH, LTC, DASH, and DOGE addresses.
Query Parameters
address
required
currency
required
Example Request
curl "https://api.cryptogate.live/api/crypto/balance?address=bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh¤cy=BTC" \
-H "Authorization: Bearer YOUR_API_KEY"
Response
{
"success": true,
"address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
"currency": "BTC",
"balance": "0.00150000",
"balance_usd": "63.23",
"unconfirmed_balance": "0.00000000",
"total_received": "0.00250000",
"total_sent": "0.00100000",
"transaction_count": 3
}
Network Fee Estimates
Get current network fee estimates for different confirmation speeds
/api/crypto/fees
Retrieve estimated transaction fees for different confirmation speeds (fast, normal, slow). Helps you estimate costs before sending cryptocurrency.
Query Parameters
currency
required
Example Request
curl "https://api.cryptogate.live/api/crypto/fees?currency=BTC" \
-H "Authorization: Bearer YOUR_API_KEY"
Response
{
"success": true,
"currency": "BTC",
"timestamp": "2025-12-08T15:30:00Z",
"fees": {
"fast": {
"fee_per_byte": 25,
"estimated_confirmation": "10-20 minutes",
"total_fee_btc": "0.00005000",
"total_fee_usd": "2.11"
},
"normal": {
"fee_per_byte": 15,
"estimated_confirmation": "30-60 minutes",
"total_fee_btc": "0.00003000",
"total_fee_usd": "1.26"
},
"slow": {
"fee_per_byte": 8,
"estimated_confirmation": "60-120 minutes",
"total_fee_btc": "0.00001600",
"total_fee_usd": "0.67"
}
}
}
Transaction Details
Look up transaction status and confirmation details
/api/crypto/transaction/{txid}
Retrieve detailed information about a specific cryptocurrency transaction, including confirmations, block height, and transaction status.
Path Parameters
txid
required
Query Parameters
currency
required
Example Request
curl "https://api.cryptogate.live/api/crypto/transaction/a1b2c3d4e5f6...?currency=BTC" \
-H "Authorization: Bearer YOUR_API_KEY"
Response
{
"success": true,
"txid": "a1b2c3d4e5f6...",
"currency": "BTC",
"status": "confirmed",
"confirmations": 6,
"block_height": 820450,
"block_hash": "00000000000000000002a7c4c1e48d76c5a37902165a270156b7a8d72728a054",
"timestamp": "2025-12-08T14:15:00Z",
"amount": "0.00150000",
"fee": "0.00003000",
"inputs": [
{
"address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
"amount": "0.00200000"
}
],
"outputs": [
{
"address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
"amount": "0.00150000"
},
{
"address": "1BoatSLRHtKNngkdXEeobR76b53LETtpyT",
"amount": "0.00047000"
}
]
}
Webhook Setup
Configure webhooks to receive real-time payment notifications
Webhooks are available on the Business+ and Enterprise plans. Upgrade your plan to access this feature.
Webhooks allow your application to receive real-time notifications when payment events occur. Instead of polling the API for payment status, your server will receive HTTP POST requests whenever a payment is created, updated, or completed.
Setting Up Webhooks
- Log in to your CryptoGate dashboard
- Navigate to Settings → Webhooks
- Click "Add Webhook Endpoint"
- Enter your webhook URL (must be HTTPS)
- Select which events you want to receive
- Save your endpoint and copy the signing secret
Webhook URL Requirements
- Must use HTTPS protocol
- Must return 200 OK status within 10 seconds
- Must be publicly accessible (no localhost)
- Should verify webhook signatures
Webhook Events
Types of events sent to your webhook endpoint
Available Events
payment.created
Triggered when a new payment is created
payment.processing
Triggered when payment is received and awaiting confirmations
payment.completed
Triggered when payment is confirmed and completed
payment.failed
Triggered when payment fails (insufficient amount, etc.)
payment.expired
Triggered when payment window expires without payment
payment.cancelled
Triggered when a payment is cancelled
Webhook Payload
{
"id": "evt_1234567890",
"type": "payment.completed",
"created_at": "2025-10-18T10:45:00Z",
"data": {
"id": "pay_1234567890",
"status": "completed",
"amount": "0.001",
"currency": "BTC",
"transaction_hash": "a1b2c3d4e5f6...",
"confirmations": 3,
"metadata": {
"order_id": "12345"
}
}
}
Webhook Security
Verify webhook authenticity and secure your endpoint
CryptoGate signs all webhook requests with a secret key. You should verify these signatures to ensure webhooks are genuinely from CryptoGate.
Signature Verification
Each webhook request includes a
X-CryptoGate-Signature header containing the HMAC
signature:
const crypto = require('crypto');
function verifyWebhook(payload, signature, secret) {
const computedSignature = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(computedSignature)
);
}
// Usage in Express
app.post('/webhooks', express.raw({type: 'application/json'}), (req, res) => {
const signature = req.headers['x-cryptogate-signature'];
const payload = req.body.toString();
if (!verifyWebhook(payload, signature, YOUR_WEBHOOK_SECRET)) {
return res.status(401).send('Invalid signature');
}
const event = JSON.parse(payload);
// Process the event...
res.status(200).send('OK');
});
Best Practices
- Always verify webhook signatures
- Use HTTPS for your webhook endpoint
- Store webhook secrets securely
- Implement idempotency (webhooks may be sent multiple times)
- Return 200 OK quickly, process async if needed
- Log all webhook events for debugging
SDKs & Libraries
Official SDKs and community libraries
Node.js / JavaScript
Official SDK for Node.js and browser environments
npm install @cryptogate/sdk
PHP
Official PHP library for server-side integrations
composer require cryptogate/cryptogate-php
Community Libraries
The following libraries are maintained by the community. While we appreciate these contributions, they are not officially supported.
- Ruby: cryptogate-ruby by @developer123
- Java: cryptogate-java by @javacoder
- .NET: CryptoGate.NET by @dotnetdev
Rate Limits
API rate limits by plan
To ensure fair usage and system stability, we apply rate limits based on your plan tier.
Rate Limit Headers
All API responses include rate limit information in the headers:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 57
X-RateLimit-Reset: 1697626200
Handling Rate Limits
When you exceed your rate limit, the API will return a
429 Too Many Requests error. Implement exponential
backoff when retrying failed requests.
Testing & Sandbox
Test your integration safely
CryptoGate provides a sandbox environment for testing your integration without using real cryptocurrency.
Test Mode
Enable test mode in your dashboard to generate test API keys. Test mode uses the same API endpoints but operates in a simulated environment.
Test API keys are prefixed with test_sk_ for
secret keys and test_pk_ for public keys.
Test Card Numbers
Use these test payment addresses to simulate different scenarios:
test_btc_success
Success
Simulates a successful Bitcoin payment with instant confirmation
test_eth_slow
Slow
Simulates an Ethereum payment that takes 10 minutes to confirm
test_ltc_failed
Failed
Simulates a failed payment (insufficient amount)
Going Live
- Complete testing in sandbox mode
- Generate production API keys in your dashboard
- Update your code to use production keys
- Test with a small real transaction
- Monitor your integration in the dashboard