DARKXCODE API Documentation
Integrate our services into your applications with our powerful API
REST API
JSON Responses
API Key Authentication
Rate Limiting
Authentication
All API requests require authentication using an API key. Include your API key in the request headers.
Request Header Example
GET /api/v1/products HTTP/1.1
Host: api.darkxcode.site
Authorization: Bearer sk_live_your_api_key_here
Content-Type: application/json
X-API-Version: 1.0
Note: Keep your API keys secure. Do not share them in client-side code or public repositories.
API Endpoints
All endpoints are prefixed with https://api.darkxcode.site/api/v1/
| Endpoint | Method | Description | Authentication |
|---|---|---|---|
/products |
GET | Retrieve products list | Required |
/products/{id} |
GET | Get specific product details | Required |
/orders |
POST | Create a new order | Required |
/orders/{id} |
GET | Get order details | Required |
/wallet-address |
GET | Get payment wallet address | Required |
/validate-coupon |
POST | Validate coupon code | Required |
/webhook |
POST | Webhook endpoint | Webhook Secret |
Products API
Get Products List
Request
GET /api/v1/products?page=1&limit=10&category=automation HTTP/1.1
Authorization: Bearer your_api_key
Response
{
"success": true,
"data": {
"products": [
{
"id": "prod_001",
"name": "Web Scraping Bot",
"description": "Advanced web scraping solution...",
"price": 299.99,
"category": "automation",
"duration": "lifetime",
"features": ["Feature 1", "Feature 2"],
"stock": 50,
"images": ["image1.jpg", "image2.jpg"]
}
],
"pagination": {
"current_page": 1,
"total_pages": 5,
"total_products": 50,
"per_page": 10
}
}
}
Query Parameters
| Parameter | Type | Description | Default |
|---|---|---|---|
page |
integer | Page number | 1 |
limit |
integer | Items per page (max 50) | 10 |
category |
string | Filter by category | null |
search |
string | Search in product name/description | null |
min_price |
float | Minimum price filter | 0 |
max_price |
float | Maximum price filter | 10000 |
sort |
string | Sort by (price_asc, price_desc, name_asc, name_desc) | name_asc |
Orders API
Create Order
Request
POST /api/v1/orders HTTP/1.1
Authorization: Bearer your_api_key
Content-Type: application/json
{
"product_id": "prod_001",
"customer_email": "customer@example.com",
"customer_telegram": "@username",
"payment_method": "USDT",
"coupon_code": "WELCOME10"
}
Response
{
"success": true,
"data": {
"order_id": "ORD-20231231-ABC123",
"invoice_url": "https://darkxcode.site/invoice?id=ORD-20231231-ABC123",
"payment_address": "TY7g8i9o0p1l2k3j4h5g6f7d8s9a0q1w2e3",
"amount": 269.99,
"currency": "USDT",
"expires_at": "2023-12-31T23:59:59Z"
}
}
Webhooks
Webhooks allow you to receive real-time notifications about order status changes.
Webhook Events
order.created- New order createdorder.paid- Order payment confirmedorder.completed- Order deliveredorder.cancelled- Order cancelled
Webhook Payload Example
Webhook Payload
{
"event": "order.paid",
"data": {
"order_id": "ORD-20231231-ABC123",
"customer_email": "customer@example.com",
"product_id": "prod_001",
"amount": 299.99,
"currency": "USDT",
"paid_at": "2023-12-31T12:30:45Z"
},
"signature": "sha256_hmac_signature"
}
Security: Always verify webhook signatures using your webhook secret.
Rate Limiting
API requests are limited to prevent abuse. Limits are applied per API key.
| Plan | Requests per Minute | Requests per Day | Burst Limit |
|---|---|---|---|
| Free | 60 | 1,000 | 100 |
| Pro | 300 | 10,000 | 500 |
| Enterprise | 1,000 | 100,000 | 2,000 |
Rate limit headers are included in all responses:
Rate Limit Headers
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
X-RateLimit-Reset: 1617235200
Retry-After: 60
Error Handling
All errors return a JSON response with appropriate HTTP status codes.
Error Response Example
{
"success": false,
"error": {
"code": "invalid_api_key",
"message": "Invalid or expired API key",
"details": "Please check your API key and try again"
},
"timestamp": "2023-12-31T12:00:00Z"
}
Common Error Codes
| HTTP Status | Error Code | Description |
|---|---|---|
| 400 | invalid_request |
Request parameters are invalid |
| 401 | invalid_api_key |
API key is invalid or expired |
| 403 | insufficient_permissions |
API key lacks required permissions |
| 404 | not_found |
Requested resource not found |
| 429 | rate_limit_exceeded |
Rate limit exceeded |
| 500 | internal_error |
Internal server error |
Code Examples
cURL Example
curl -X GET \
'https://api.darkxcode.site/api/v1/products?page=1&limit=10' \
-H 'Authorization: Bearer your_api_key' \
-H 'Content-Type: application/json'
Python Example
import requests
api_key = 'your_api_key'
headers = {
'Authorization': f'Bearer {api_key}',
'Content-Type': 'application/json'
}
response = requests.get(
'https://api.darkxcode.site/api/v1/products',
headers=headers,
params={'page': 1, 'limit': 10}
)
if response.status_code == 200:
data = response.json()
print(data)
else:
print(f'Error: {response.status_code}')
Node.js Example
const axios = require('axios');
const apiKey = 'your_api_key';
axios.get('https://api.darkxcode.site/api/v1/products', {
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
},
params: {
page: 1,
limit: 10
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error.response?.data || error.message);
});
PHP Example
Error: 404
Need Help?
If you have questions about our API or need assistance with integration, don't hesitate to contact our support team.