Welcome Back!
PHP Request Example
<?php
$endpoint = 'https://ugi.my.id/panel/external-api/generate';
$apiKey = 'PASTE_MASTER_API_KEY_HERE';
$token = 'PASTE_ACCEPTED_TOKEN_HERE';
$payload = [
'api_key' => $apiKey,
'token' => $token,
'action' => 'quote',
'game' => 'MLBB', // use a game code from the current panel config
'duration' => 1, // use a duration value from the current panel config
'max_devices' => 1,
'bulk' => 1,
];
$json = json_encode($payload, JSON_UNESCAPED_SLASHES);
$ch = curl_init($endpoint);
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $json,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Accept: application/json',
'Content-Length: ' . strlen($json),
],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CONNECTTIMEOUT => 10,
CURLOPT_TIMEOUT => 30,
]);
$response = curl_exec($ch);
$httpCode = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE);
$curlError = curl_error($ch);
curl_close($ch);
if ($curlError !== '') {
throw new RuntimeException('Request error: ' . $curlError);
}
$result = json_decode((string) $response, true);
if (!is_array($result)) {
throw new RuntimeException('The API returned invalid JSON (HTTP ' . $httpCode . ').');
}
if ($httpCode >= 400 || empty($result['success'])) {
throw new RuntimeException(($result['message'] ?? 'API request failed.') . ' (HTTP ' . $httpCode . ')');
}
echo 'Owner: ' . htmlspecialchars((string)($result['owner'] ?? ''), ENT_QUOTES, 'UTF-8') . "<br>";
echo 'Reduced: ' . number_format((float)($result['reduced_balance'] ?? 0), 0, ',', '.') . "<br>";
echo 'Remaining: ' . number_format((float)($result['remaining_balance'] ?? 0), 0, ',', '.') . "<br>";
foreach (($result['keys'] ?? []) as $generatedKey) {
echo htmlspecialchars((string)$generatedKey, ENT_QUOTES, 'UTF-8') . "<br>";
}
?>
Not sure how to set up the configuration on your website?
Available Games
Use the game value exactly as it appears in the following list. This list reflects the current panel configuration.
| Game Code | Value |
|---|---|
ALL | ALL |
PUBG | PUBG |
CODM | CODM |
AOV | AOV |
HOK | HOK |
FF | FF |
Available Durations
Use a numeric value for the duration column. The following prices are per-device rates, before applying the max_devices and bulk multipliers.
| Duration Value | Duration | Price / Device |
|---|---|---|
1 | 1 day - Rp15.000/Device | 15.000 Rp |
3 | 3 day - Rp25.000/Device | 25.000 Rp |
7 | 7 day - Rp50.000/Device | 50.000 Rp |
30 | 30 day - Rp100.000/Device | 100.000 Rp |
60 | 60 day - Rp180.000/Device | 180.000 Rp |
90 | 90 day - Rp270.000/Device | 270.000 Rp |
Available Parameters
| Parameter | Required | Example | Description |
|---|---|---|---|
action | No | quote | Use quote for a read-only balance/cost check; omit it for normal key generation. |
api_key | Yes | UGI_... | Master API key shown above. |
token | Yes | UGI_TK_... | Token generated by reseller/admin and ACCEPTED by owner. |
game | Yes | MLBB | Manual game list used by the external API generator. |
duration | Yes | 1 | Duration value from the current panel configuration; do not hard-code values from an older installation. |
max_devices | Yes | 1 | Allowed device count, 1–100. |
bulk | No | 1 | Number of keys to generate, 1–100. |
How it works
- Reseller/Admin generates a token request.
- Owner reviews the request and chooses ACCEPT, REJECT, or DELETE.
- Only ACCEPTED tokens can call the external generation endpoint.
- Every API request must send both
api_keyandtoken. - The external website needs no SQL table; it only sends the request and displays the API response.
Security rules
The server checks:
- Master API key matches exactly.
- Token exists and status is ACCEPT.
- Token owner still exists, is active, and is reseller/admin.
- Invalid, pending, rejected, or deleted tokens cannot generate keys.
- External generation deducts the token owner's balance using the same price × device × quantity formula as Keys/Generate.
