API Documentation
Comprehensive guide to integrate with LaoTopup API
Quick Navigation
Quick Links
📋 Overview
The LaoTopup API allows you to integrate game top-up services into your applications. All API endpoints accept and return JSON.
Base URL
https://api.laotopup.com/api
Secure
All communications use HTTPS with API key authentication
Fast
Average response time under 500ms for all endpoints
Global
Supports multiple currencies and languages
Support
24/7 technical support available
🔑 Authentication
All API requests require authentication using your API key. Include the api_key parameter in the JSON body of every request.
Request Format
{
"api_key": "your_api_key_here",
// ... other parameters
}
Getting Your API Key
- Register an account on LaoTopup
- Go to your Profile page
- Find your API Key in the API Settings section
- Copy the API Key for use in your applications
Security Note
Never share your API key publicly. Use environment variables or secure storage.
🔌 API Endpoints
All endpoints use POST method and require Content-Type: application/json header.
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/balance | Check account balance |
| POST | /api/services | Get list of available services |
| POST | /api/order | Create a new order |
| POST | /api/status | Check order status |
| POST | /api/history | Get transaction history |
/api/balance
Retrieve your current account balance and spending statistics.
Request Example
{
"api_key": "API-XXXXXXXXXXXX"
}
Response Example
{
"status": true,
"username": "john_doe",
"saldo": 150.50,
"spend": 200.00,
"role": "platinum"
}
Code Examples
const checkBalance = async () => {
const response = await fetch('https://api.laotopup.com/api/balance', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
api_key: 'API-XXXXXXXXXXXX'
})
});
const data = await response.json();
console.log('Balance:', data.saldo);
};
checkBalance();
<?php
$url = 'https://api.laotopup.com/api/balance';
$data = ['api_key' => 'API-XXXXXXXXXXXX'];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json'
]);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
echo 'Balance: ' . $result['saldo'];
?>
import requests
url = "https://api.laotopup.com/api/balance"
payload = {"api_key": "API-XXXXXXXXXXXX"}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
data = response.json()
print(f"Balance: {data['saldo']}")
curl -X POST https://api.laotopup.com/api/balance \
-H "Content-Type: application/json" \
-d '{"api_key": "API-XXXXXXXXXXXX"}'
/api/services
Get a list of all available game top-up services with prices adjusted according to your role.
Request Example
{
"api_key": "API-XXXXXXXXXXXX"
}
Response Example
{
"status": true,
"data": [
{
"product_name": "Mobile Legends 86 Diamond",
"category": "Games",
"layanan": "Mobile Legends",
"buyer_sku_code": "ml86",
"price": "10.00",
"status": "Available"
}
// ... more services
]
}
/api/order
Create a new game top-up order.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key |
| buyer_sku_code | String | Yes | Product SKU from services list |
| customer_id | String | Yes | Customer game ID/phone number |
| zone_id | String | Optional | Game zone/server ID (for some games) |
| slug | String | Optional | Product slug (for specific products) |
Request Example
{
"api_key": "API-XXXXXXXXXXXX",
"buyer_sku_code": "ml100",
"customer_id": "1234567890",
"zone_id": "optional_zone_id",
"slug": "required_for_synn_products"
}
Response Example
{
"status": true,
"message": "Order successfully created",
"order_id": "ORDER-123456789",
"produk": "Mobile Legends 100 Diamond",
"harga": 12.50,
"customer_no": "1234567890",
"status_transaksi": "Pending"
}
/api/status
Check the status of a transaction by order ID.
Request Example
{
"api_key": "API-XXXXXXXXXXXX",
"order_id": "ORDER-123456789"
}
/api/history
Retrieve your transaction history.
Request Example
{
"api_key": "API-XXXXXXXXXXXX"
}
⚠️ Error Codes
| Code | Message | Description |
|---|---|---|
| 400 | Invalid API Key | The provided API key is invalid or expired |
| 401 | Unauthorized | Missing or incorrect authentication |
| 402 | Insufficient Balance | Account balance is insufficient for transaction |
| 404 | Service Not Found | Requested service/product is not available |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Server-side error occurred |
💡 Best Practices
Security
- Never expose your API key in client-side code
- Use environment variables for API keys
- Implement IP whitelisting in your account settings
- Rotate API keys periodically
Performance
- Cache service lists to reduce API calls
- Implement retry logic with exponential backoff
- Use webhooks for real-time status updates
- Batch operations when possible
Reliability
- Always verify transaction status after order placement
- Implement timeout handling for API calls
- Store order IDs for future reference
- Monitor API response times and error rates