Dokumentasi API ApiKios
Panduan integrasi untuk website top-up game dan server pulsa OtomaX / IRS. Saldo dicatat dalam Rupiah bulat tanpa desimal, dan tidak dipotong kalau transaksi gagal.
https://validasi.todagames.id/api/v1
X-API-Key.
https://validasi.todagames.id/api/v1/game/check-id
/check-id.
- Format balasan
- JSON untuk aplikasi web, teks biasa untuk software server pulsa OtomaX.
- Satuan saldo
- Integer Rupiah, tanpa desimal. Contoh:
25000berarti Rp 25.000. - Anti duplikasi
- Parameter
ref_ididempoten selama 24 jam, dijaga penguncian baris di database.
Autentikasi API
header X-API-KeySetiap request ke API v1 memerlukan API Key yang valid. Buat dan kelola kuncinya di menu API Keys dashboard. Untuk modul OtomaX / IRS yang memanggil URL GET, kunci bisa dikirim sebagai query parameter.
X-API-Key: gap_live_8f7b2c9a1e04...
GET https://validasi.todagames.id/api/v1/otomax?api_key=gap_live_8f7b2c9a1e04...&ref_id=TRX1001
Pembatasan IP whitelist
daftar IP dan CIDRRequest dari IP di luar daftar akan ditolak
Sistem hanya menerima request dari alamat IP yang sudah didaftarkan. Request dari IP lain dibalas HTTP 403 Forbidden.
Daftarkan IP server Anda di menu API Keys sebelum menjalankan transaksi live.
Saldo tidak dipotong kalau transaksi gagal
Pemotongan hanya terjadi setelah transaksi benar-benar berhasil.
Kalau server game sedang gangguan, kode voucher salah, atau player ID tidak ditemukan, tidak ada saldo yang berpindah:
Saldo dipotong sesuai tarif layanan. Balasan menyertakan nickname dan ref_id.
Biaya cost: 0. Saldo tetap utuh tanpa potongan apa pun.
Daftar HTTP status code
RFC 7231| Kode | Arti | Penyebab dan tindakan |
|---|---|---|
| 200 | Berhasil | Request diproses. Periksa juga nilai boolean success di dalam balasan JSON, karena status HTTP saja tidak menandakan transaksi sukses. |
| 401 | API Key tidak valid | Header X-API-Key tidak dikirim, salah, atau kuncinya sudah dinonaktifkan. |
| 402 | Saldo tidak cukup | Saldo akun di bawah tarif layanan. Lakukan top up dari dashboard mitra, lalu ulangi request. |
| 403 | Akses ditolak | IP pengirim tidak ada di whitelist, atau akun sedang ditangguhkan. |
| 422 | Validasi parameter gagal | Parameter wajib belum lengkap atau formatnya tidak sesuai, misalnya zone kosong untuk Mobile Legends. |
| 500 | Gangguan di sisi kami | Terjadi kesalahan saat memproses transaksi. Cek riwayat transaksi di dashboard sebelum mengulang, lalu kirim ulang dengan ref_id yang sama supaya tidak terhitung dobel. |
/api/v1/user/balance
Cek saldo dan profil mitra
Gratis, tidak memotong saldo. Berguna untuk bot H2H atau modul otomasi server pulsa yang perlu tahu sisa saldo sebelum mengirim order.
Ada juga GET /api/v1/balance dan GET /api/v1/user/profile dengan data yang sama.
Cara mengirim API Key
| Cara | Contoh nilai |
|---|---|
| Authorization | Bearer gap_live_8f7b2c9a1e04... |
| X-API-Key | gap_live_8f7b2c9a1e04... |
Pilih salah satu, bukan keduanya.
GET /api/v1/otomax?api_key=YOUR_KEY&cmd=saldo
curl -X GET "https://validasi.todagames.id/api/v1/user/balance" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Accept: application/json"
$ch = curl_init("https://validasi.todagames.id/api/v1/user/balance");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"X-API-Key: YOUR_API_KEY",
"Accept: application/json"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
curl_close($ch);
print_r(json_decode($res, true));
const res = await fetch("https://validasi.todagames.id/api/v1/user/balance", {
headers: {
"X-API-Key": "YOUR_API_KEY",
"Accept": "application/json"
}
});
const data = await res.json();
console.log(data);
{
"success": true,
"name": "Mitra Game Store",
"balance": 750000,
"formatted_balance": "Rp 750.000",
"status": "active"
}
/api/v1/order
Satu endpoint untuk semua produk voucher. Kirim kode SKU, sistem mencocokkannya ke katalog voucher Anda dan mengeksekusi redeem ke provider yang sesuai. Saldo terpotong sebesar tarif layanan yang berlaku, dan hanya setelah transaksi sukses.
ref_id yang sama dalam 24 jam dibalas ulang dengan hasil transaksi pertama, tidak membuat order baru. Satu voucher juga dikunci barisnya di database (lockForUpdate), jadi dua request bersamaan tidak bisa memakai voucher yang sama.
Header request
| Header | Nilai | Keterangan |
|---|---|---|
| X-API-Key | gap_live_8f7b2c9a1e04... | Wajib |
| Content-Type | application/json | Wajib |
| Accept | application/json | Opsional. Balasan selalu JSON, tapi mengirim header ini membuat klien HTTP Anda memperlakukannya sebagai JSON sejak awal. |
| X-Idempotency-Key | uuid atau kode order | Opsional. Kalau kosong, sistem memakai ref_id. Balasan yang diulang ditandai header X-Idempotent-Replay: true. |
Body request (JSON)
| Field | Wajib | Isi |
|---|---|---|
| ref_id | Ya | ID referensi milik Anda, maksimal 100 karakter. Contoh: TRX-20261007-001. |
| sku atau code | Ya | Kode SKU produk voucher, maksimal 50 karakter. Contoh: FF50DGVR. Daftar lengkapnya ada di katalog SKU. |
| target atau game_id | Ya | User ID akun game penerima, maksimal 50 karakter. Contoh: 12345678. |
| zone_id atau zone | Opsional | Zone atau server ID. Wajib untuk Mobile Legends, contoh 1234. Maksimal 50 karakter. |
curl -X POST "https://validasi.todagames.id/api/v1/order" \
-H "X-API-Key: gap_live_8f7b2c9a1e04..." \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"ref_id": "TRX-20261004-001",
"sku": "FF50DGVR",
"target": "12345678",
"zone_id": null
}'
<?php
$payload = [
'ref_id' => 'TRX-20261004-001',
'sku' => 'FF50DGVR',
'target' => '12345678',
'zone_id' => null,
];
$ch = curl_init('https://validasi.todagames.id/api/v1/order');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-API-Key: gap_li.....',
'Content-Type: application/json',
'Accept: application/json',
],
]);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
use Illuminate\Support\Facades\Http;
$response = Http::withHeaders([
'X-API-Key' => 'gap_live_8f7b2c9a1e04...',
'Accept' => 'application/json',
])->post('https://validasi.todagames.id/api/v1/order', [
'ref_id' => 'TRX-20261004-001',
'sku' => 'FF50DGVR',
'target' => '12345678',
'zone_id' => null,
]);
$data = $response->json();
const axios = require('axios');
const response = await axios.post('https://validasi.todagames.id/api/v1/order', {
ref_id: 'TRX-20261004-001',
sku: 'FF50DGVR',
target: '12345678',
zone_id: null
}, {
headers: {
'X-API-Key': 'gap_live_8f7b2c9a1e04...',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
});
console.log(response.data);
import requests
url = "https://validasi.todagames.id/api/v1/order"
headers = {
"X-API-Key": "gap_live_8f7b2c9a1e04...",
"Content-Type": "application/json",
"Accept": "application/json"
}
payload = {
"ref_id": "TRX-20261004-001",
"sku": "FF50DGVR",
"target": "12345678",
"zone_id": None
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
{
"success": true,
"status": "Success",
"message": "Redeem voucher DuniaGames berhasil.",
"order_id": 1042,
"ref_id": "ORD-MITRA-001",
"sku": "FF50DGVR",
"product_name": "Free Fire 50 Diamond Voucher",
"target": "12345678",
"zone_id": null,
"nickname": "ProGamerID",
"sn": "Free Fire 50 Diamond. RefId: DG-77889900",
"cost": 100,
"balance_remaining": 49900
}
{
"success": false,
"status": "Failed",
"message": "Stok voucher Anda untuk produk FF50DGVR habis.",
"error_code": "OUT_OF_STOCK",
"order_id": null,
"ref_id": "ORD-MITRA-001",
"sku": "FF50DGVR",
"product_name": "Free Fire 50 Diamond Voucher",
"target": "12345678",
"cost": 0,
"balance_remaining": 50000
}
/api/v1/otomax
Endpoint untuk software server pulsa seperti OtomaX, IRS, Flash Machine, Tiger Engine, dan MD Engine. Bisa dipanggil lewat URL GET atau POST, dan balasannya teks biasa seperti yang sudah dipakai software pulsa.
Parameter Request H2H
| Parameter | Alias | Wajib | Deskripsi / Contoh |
|---|---|---|---|
| api_key | Header: X-API-Key | Ya | API Key mitra aktif. IP pengirim wajib terdaftar di IP Whitelist. |
| ref_id | clientid | Ya | ID tiket atau nomor referensi unik dari software server pulsa Anda. |
| produk | code, sku | Ya | Kode SKU produk voucher. Contoh: FF50DGVR. |
| tujuan | target, msisdn | Ya | User ID akun game tujuan penerima diamond/item. |
| serverid | zone_id | Opsional | Server / Zone ID akun game (Wajib untuk Mobile Legends). |
| callback_url | callback | Opsional | URL callback jika ingin menerima notifikasi status via HTTP GET saat transaksi selesai. |
- Sukses: Mengandung kata
SUKSES, nomor SN/RefId resmi, harga, dan sisa saldo. - Gagal: Mengandung kata
GAGAL, disertai alasan error (contoh: Stok voucher habis).
GET https://validasi.todagames.id/api/v1/otomax?api_key=gap_live_8f7b2c9a1e04...&ref_id=OTX99281&produk=FF50DGVR&tujuan=12345678&serverid=
curl -G "https://validasi.todagames.id/api/v1/otomax" \
--data-urlencode "api_key=gap_live_8f7b2c9a1e04..." \
--data-urlencode "ref_id=OTX99281" \
--data-urlencode "produk=FF50DGVR" \
--data-urlencode "tujuan=12345678"
<?php
$url = 'https://validasi.todagames.id/api/v1/otomax?' . http_build_query([
'api_key' => 'gap_live_8f7b2c9a1e04...',
'ref_id' => 'OTX99281',
'produk' => 'FF50DGVR',
'tujuan' => '12345678',
]);
$response = file_get_contents($url);
echo $response;
use Illuminate\Support\Facades\Http;
$response = Http::get('https://validasi.todagames.id/api/v1/otomax', [
'api_key' => 'gap_live_8f7b2c9a1e04...',
'ref_id' => 'OTX99281',
'produk' => 'FF50DGVR',
'tujuan' => '12345678',
]);
$text = $response->body();
const axios = require('axios');
const response = await axios.get('https://validasi.todagames.id/api/v1/otomax', {
params: {
api_key: 'gap_live_8f7b2c9a1e04...',
ref_id: 'OTX99281',
produk: 'FF50DGVR',
tujuan: '12345678'
}
});
console.log(response.data);
import requests
url = "https://validasi.todagames.id/api/v1/otomax"
params = {
"api_key": "gap_live_8f7b2c9a1e04...",
"ref_id": "OTX99281",
"produk": "FF50DGVR",
"tujuan": "12345678"
}
response = requests.get(url, params=params)
print(response.text)
#Request TRX #TRX-20260918-A8B9C0. REFID#OTX99281. SUKSES, SN:Free Fire 50 Diamond. RefId: DG-77889900. Harga:100. Sisa Saldo:49900. KP:FF50DGVR.12345678 Tanggal:2026-09-18 14:05:21
GAGAL. Stok voucher Anda untuk produk FF50DGVR habis
/api/v1/check-id
alias lama: /api/v1/game/check-id
Satu URL untuk semua validasi ID: nama pemilik rekening bank, akun e-wallet (DANA, OVO, GoPay, ShopeePay, LinkAja), token dan tagihan PLN, sampai nickname akun game. Kalau nomor atau ID tidak ditemukan, saldo Anda tidak dipotong (cost: 0).
ID yang tidak ditemukan tetap dibalas HTTP 200 dengan success: false. Periksa field itu, bukan hanya status HTTP-nya. Status 422 hanya muncul kalau code atau target tidak dikirim.
Request Body (JSON)
| Field | Tipe | Wajib | Deskripsi / Contoh |
|---|---|---|---|
| code | string | Ya |
Kode layanan: Bank (bca, mandiri, bri, dll.), E-Wallet (dana, ovo, gopay), PLN (pln), atau Game (freefire, mlbb).
|
| target | string | Ya | Nomor Rekening / No HP E-Wallet / Nomor Meter PLN / User ID Game target (contoh: "1587373516" atau "085791702018"). |
| zone | string | Opsional | Zone ID server game (Wajib untuk Mobile Legends, contoh: "1234"; kosongkan untuk bank/ewallet/pln/game lainnya). |
Endpoint ini juga menerima alias nama field supaya kode lama tetap jalan: game, service, atau service_code untuk code; lalu game_id, id, account_number, customer_id, atau meter_number untuk target.
# Contoh: Validasi Akun Bank (BCA)
curl -X POST "https://validasi.todagames.id/api/v1/check-id" \
-H "X-API-Key: gap_live_8f7b2c9a1e04..." \
-H "Content-Type: application/json" \
-d '{
"code": "bca",
"target": "1587373516"
}'
# Contoh: Validasi E-Wallet (DANA)
# curl -X POST "https://validasi.todagames.id/api/v1/check-id" -d '{"code":"dana","target":"085791702018"}'
# Contoh: Validasi PLN Token
# curl -X POST "https://validasi.todagames.id/api/v1/check-id" -d '{"code":"pln","target":"32114046926"}'
# Contoh: Validasi Game (MLBB)
# curl -X POST "https://validasi.todagames.id/api/v1/check-id" -d '{"code":"mlbb","target":"87654321","zone":"1234"}'
<?php
$payload = [
'code' => 'bca', // atau 'dana', 'pln', 'mlbb'
'target' => '1587373516',
];
$ch = curl_init('https://validasi.todagames.id/api/v1/check-id');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-API-Key: gap_live_8f7b2c9a1e04...',
'Content-Type: application/json',
],
]);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
use Illuminate\Support\Facades\Http;
$response = Http::withHeaders([
'X-API-Key' => 'gap_live_8f7b2c9a1e04...',
])->post('https://validasi.todagames.id/api/v1/check-id', [
'code' => 'dana', // atau 'bca', 'pln', 'freefire'
'target' => '085791702018',
]);
$data = $response->json();
const axios = require('axios');
const response = await axios.post('https://validasi.todagames.id/api/v1/check-id', {
code: 'bca',
target: '1587373516'
}, {
headers: { 'X-API-Key': 'gap_live_8f7b2c9a1e04...' }
});
console.log(response.data);
import requests
url = "https://validasi.todagames.id/api/v1/check-id"
headers = {"X-API-Key": "gap_live_8f7b2c9a1e04..."}
payload = {
"code": "bca",
"target": "1587373516"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
{
"success": true,
"type": "bank",
"code": "bca",
"target": "1587373516",
"name": "KUSNADI",
"username": "KUSNADI",
"cost": 50,
"balance_remaining": 499950,
"data": {
"bank_id": 2,
"bank_name": "BCA",
"bank_code": "014",
"account_number": "1587373516",
"account_name": "KUSNADI"
}
}
{
"success": false,
"message": "Rekening / ID tidak ditemukan atau tidak valid.",
"cost": 0,
"balance_remaining": 499950
}
/api/v1/voucher/check-item
Cek nama produk, nominal diamond, dan masa berlaku satu kode voucher DuniaGames sebelum dikirim ke pelanggan.
Request Body (JSON)
| Field | Tipe | Wajib | Deskripsi / Contoh |
|---|---|---|---|
| voucher_code | string | Ya | Kode voucher yang ingin diinspeksi (contoh: "DG-7711-2233-9900") |
curl -X POST "https://validasi.todagames.id/api/v1/voucher/check-item" \
-H "X-API-Key: gap_live_8f7b2c9a1e04..." \
-H "Content-Type: application/json" \
-d '{
"voucher_code": "DG-7711-2233-9900"
}'
<?php
$ch = curl_init('https://validasi.todagames.id/api/v1/voucher/check-item');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode(['voucher_code' => 'DG-7711-2233-9900']),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-API-Key: gap_live_8f7b2c9a1e04...',
'Content-Type: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
use Illuminate\Support\Facades\Http;
$response = Http::withHeaders([
'X-API-Key' => 'gap_live_8f7b2c9a1e04...',
])->post('https://validasi.todagames.id/api/v1/voucher/check-item', [
'voucher_code' => 'DG-7711-2233-9900',
]);
$data = $response->json();
const axios = require('axios');
const res = await axios.post('https://validasi.todagames.id/api/v1/voucher/check-item', {
voucher_code: 'DG-7711-2233-9900'
}, {
headers: { 'X-API-Key': 'gap_live_8f7b2c9a1e04...' }
});
console.log(res.data);
import requests
res = requests.post("https://validasi.todagames.id/api/v1/voucher/check-item", json={
"voucher_code": "DG-7711-2233-9900"
}, headers={"X-API-Key": "gap_live_8f7b2c9a1e04..."})
print(res.json())
{
"success": true,
"voucher_code": "DG-7711-2233-9900",
"item_name": "Free Fire 140 Diamonds",
"product_name": "Free Fire",
"cost": 10,
"balance_remaining": 499860
}
{
"success": false,
"message": "Kode voucher tidak valid atau sudah kadaluarsa.",
"error_code": "INVALID_VOUCHER",
"cost": 0,
"balance_remaining": 500000
}
/api/v1/voucher/check-batch
Cek beberapa kode voucher DuniaGames sekaligus, maksimal 50 kode per request. Biaya hanya dipotong untuk kode yang valid, jadi 10 kode masuk dengan 7 valid berarti Anda dibebani 7 transaksi.
Request Body (JSON)
| Field | Tipe | Wajib | Deskripsi / Contoh |
|---|---|---|---|
| voucher_codes | array<string> | Ya | Array berisi minimal 1 dan maksimal 50 kode voucher DuniaGames. |
curl -X POST "https://validasi.todagames.id/api/v1/voucher/check-batch" \
-H "X-API-Key: gap_live_8f7b2c9a1e04..." \
-H "Content-Type: application/json" \
-d '{
"voucher_codes": [
"DG-CODE-001",
"DG-CODE-002"
]
}'
<?php
$ch = curl_init('https://validasi.todagames.id/api/v1/voucher/check-batch');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode(['voucher_codes' => ['DG-CODE-001', 'DG-CODE-002']]),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-API-Key: gap_live_8f7b2c9a1e04...',
'Content-Type: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
use Illuminate\Support\Facades\Http;
$response = Http::withHeaders([
'X-API-Key' => 'gap_live_8f7b2c9a1e04...',
])->post('https://validasi.todagames.id/api/v1/voucher/check-batch', [
'voucher_codes' => ['DG-CODE-001', 'DG-CODE-002'],
]);
$data = $response->json();
const axios = require('axios');
const res = await axios.post('https://validasi.todagames.id/api/v1/voucher/check-batch', {
voucher_codes: ['DG-CODE-001', 'DG-CODE-002']
}, {
headers: { 'X-API-Key': 'gap_live_8f7b2c9a1e04...' }
});
console.log(res.data);
import requests
res = requests.post("https://validasi.todagames.id/api/v1/voucher/check-batch", json={
"voucher_codes": ["DG-CODE-001", "DG-CODE-002"]
}, headers={"X-API-Key": "gap_live_8f7b2c9a1e04..."})
print(res.json())
{
"success": true,
"total_submitted": 2,
"total_success": 2,
"cost": 20,
"balance_remaining": 499840,
"results": [
{
"voucher_code": "DG-CODE-001",
"success": true,
"item_name": "Free Fire 70 Diamonds"
},
{
"voucher_code": "DG-CODE-002",
"success": true,
"item_name": "Free Fire 140 Diamonds"
}
]
}
{
"success": false,
"message": "Field voucher_codes maksimal berisi 50 kode voucher.",
"cost": 0,
"balance_remaining": 500000
}
/api/v1/voucher/redeem
ref_id agar aman diulang
Tukarkan satu kode voucher DuniaGames langsung ke User ID akun game. Balasan berisi nomor RefID dan kode transaksi dari provider. Kalau kodenya tidak valid atau sudah pernah dipakai, saldo Anda tidak dipotong (cost: 0).
Request Body (JSON)
| Field | Tipe | Wajib | Deskripsi / Contoh |
|---|---|---|---|
| voucher_code | string | Ya | Kode voucher DuniaGames (contoh: "DG-9921-8812-4412") |
| ref_id | string | Opsional | ID referensi invoice unik dari sistem mitra (contoh: "INV-MITRA-001"). Jika diisi, otomatis memproteksi dari transaksi ganda (Idempotency). |
| game_id | string | Ya | User ID game penerima diamond/item (contoh: "123456789") |
| zone_id | string | Opsional | Zone ID server game target (contoh: "1234") |
| string | Opsional | Email penerima invoice notifikasi dari provider |
curl -X POST "https://validasi.todagames.id/api/v1/voucher/redeem" \
-H "X-API-Key: gap_live_8f7b2c9a1e04..." \
-H "Content-Type: application/json" \
-d '{
"voucher_code": "DG-9921-8812-4412",
"game_id": "123456789",
"zone_id": null
}'
<?php
$payload = [
'voucher_code' => 'DG-9921-8812-4412',
'game_id' => '123456789',
'zone_id' => null,
];
$ch = curl_init('https://validasi.todagames.id/api/v1/voucher/redeem');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-API-Key: gap_live_8f7b2c9a1e04...',
'Content-Type: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
use Illuminate\Support\Facades\Http;
$response = Http::withHeaders([
'X-API-Key' => 'gap_live_8f7b2c9a1e04...',
])->post('https://validasi.todagames.id/api/v1/voucher/redeem', [
'voucher_code' => 'DG-9921-8812-4412',
'game_id' => '123456789',
'zone_id' => null,
]);
$data = $response->json();
const axios = require('axios');
const res = await axios.post('https://validasi.todagames.id/api/v1/voucher/redeem', {
voucher_code: 'DG-9921-8812-4412',
game_id: '123456789',
zone_id: null
}, {
headers: { 'X-API-Key': 'gap_live_8f7b2c9a1e04...' }
});
console.log(res.data);
import requests
res = requests.post("https://validasi.todagames.id/api/v1/voucher/redeem", json={
"voucher_code": "DG-9921-8812-4412",
"game_id": "123456789",
"zone_id": None
}, headers={"X-API-Key": "gap_live_8f7b2c9a1e04..."})
print(res.json())
{
"success": true,
"order_id": 1042,
"ref_id": "INV-MITRA-001",
"upstream_ref_id": "TRX-DG-20260918-889912",
"username": "PRO_SLAYER_ID",
"transaction_code": "TRX-DG-20260918-889912",
"message": "Redeem voucher berhasil.",
"cost": 100,
"balance_remaining": 499870
}
{
"success": false,
"message": "Kode voucher sudah digunakan atau tidak valid.",
"error_code": "VOUCHER_ALREADY_USED",
"cost": 0,
"balance_remaining": 500000
}
Webhook dan Callback Reseller
Laporan status transaksi dikirim otomatis ke server atau software Anda melalui dua opsi jalur berikut:
Payload JSON datar langsung ke endpoint URL Anda saat pesanan selesai atau gagal.
Format query string standar H2H OtomaX untuk software pulsa / PPOB Anda.
Struktur Payload Webhook POST
| Field | Tipe | Keterangan |
|---|---|---|
| status | string | Status akhir transaksi: Sukses atau Gagal. |
| message | string | Keterangan transaksi: Transaksi Berhasil atau Transaksi Gagal. |
| sn | string | Serial Number / bukti voucher dari upstream jika sukses, atau alasan jika gagal. |
| ref_id | string | ID referensi unik dari sistem Anda saat melakukan transaksi. |
| order_id | string/int | ID pesanan unik dari GameAPI Platform. |
| produk | string | Kode SKU produk yang dipesan (contoh: FF50DGVR). |
| sisa_saldo | integer | Sisa saldo akun deposit Anda setelah transaksi selesai. |
| price | integer | Biaya/harga produk yang terpotong dari saldo Anda. |
Parameter Report Transaksi OtomaX (HTTP GET)
| Parameter | Keterangan |
|---|---|
| serverid | ID transaksi / order ID dari GameAPI Platform. |
| clientid | Ref ID dari sistem client / mitra Anda. |
| statuscode | Status transaksi: 1 = Sukses, 0 = Gagal. |
| kp | Kode produk (SKU). |
| msisdn | Nomor tujuan transaksi / User ID Game. |
| sn | Serial Number atau keterangan voucher. |
| msg | Format pesan OtomaX: #Request TRX #serverid. REFID#clientid. SUKSES/GAGAL, SN:... Harga:... Saldo:... KP:... Tanggal:... |
- Server Anda wajib membalas dengan status HTTP
200 OKjika webhook berhasil diterima. - Jika terjadi kegagalan jaringan atau timeout (15 detik), sistem kami otomatis menjadwalkan percobaan ulang hingga 3 kali.
- Anda juga dapat melakukan tes ping koneksi atau kirim ulang manual kapan saja dari menu Webhook di dashboard mitra.
<?php
// 1. Ambil isi payload JSON dari GameAPI Platform
$rawPayload = file_get_contents('php://input');
$data = json_decode($rawPayload, true);
if (!$data) {
http_response_code(400);
exit('Invalid JSON Payload');
}
// 2. Ambil parameter data transaksi
$status = $data['status'] ?? ''; // 'Sukses' atau 'Gagal'
$message = $data['message'] ?? ''; // Pesan detail transaksi
$sn = $data['sn'] ?? ''; // Serial Number / Bukti
$refId = $data['ref_id'] ?? ''; // Ref ID unik dari sistem Anda
$orderId = $data['order_id'] ?? ''; // ID pesanan dari GameAPI
$produk = $data['produk'] ?? ''; // Kode SKU produk
$sisaSaldo = $data['sisa_saldo'] ?? 0; // Sisa saldo deposit
$price = $data['price'] ?? 0; // Harga produk
// 3. Perbarui status transaksi di database Anda
if ($status === 'Sukses') {
// Transaksi Sukses: simpan $sn dan update status pesanan
} else {
// Transaksi Gagal: tandai gagal atau kembalikan saldo
}
// 4. Balas dengan HTTP 200 OK
http_response_code(200);
echo json_encode(['received' => true]);
const express = require('express');
const app = express();
app.use(express.json());
app.post('/webhook', (req, res) => {
const { status, message, sn, ref_id, order_id, produk, sisa_saldo, price } = req.body;
if (status === 'Sukses') {
// Transaksi Sukses: simpan SN dan perbarui status
console.log(`Pesanan ${ref_id} Sukses, SN: ${sn}`);
} else {
// Transaksi Gagal: tandai gagal
console.log(`Pesanan ${ref_id} Gagal: ${message}`);
}
// Wajib kembalikan HTTP 200
res.status(200).json({ received: true });
});
app.listen(3000, () => console.log('Webhook receiver ready on port 3000'));
{
"status": "Sukses",
"message": "Transaksi Berhasil",
"sn": "kipli tzy/662444522/Free Fire 50 Diamond",
"ref_id": "REF-PARTNER-753601",
"order_id": "ORD-9921283359",
"produk": "FF50DGVR",
"sisa_saldo": 109750,
"price": 250
}
{
"status": "Gagal",
"message": "Transaksi Gagal",
"sn": "Invalid ID",
"ref_id": "REF-PARTNER-753601",
"order_id": "ORD-9921283359",
"produk": "FF50DGVR",
"sisa_saldo": 110000,
"price": 0
}
https://url-mitra.com/report?serverid=ORD-9921283359&clientid=REF-PARTNER-753601&statuscode=1&kp=FF50DGVR&msisdn=662444522&sn=kipli+tzy/662444522/Free+Fire+50+Diamond&msg=%23Request+TRX+%23ORD-9921283359.+REFID%23REF-PARTNER-753601.+SUKSES%2C+SN%3Akipli+tzy/662444522/Free+Fire+50+Diamond.+Harga%3A250.+Saldo%3A109750.+KP%3AFF50DGVR.662444522+Tanggal%3A10/10/2026+12.00.00
Katalog SKU voucher DuniaGames
6 SKU aktif
Kode SKU berikut dipakai pada parameter sku di /api/v1/order dan parameter produk di /api/v1/otomax.
| Kode SKU | Game | Denominasi |
|---|---|---|
| FF50DGVR | Free Fire | 50 diamond |
| FF70DGVR | Free Fire | 70 diamond |
| FF140DGVR | Free Fire | 140 diamond |
| FF355DGVR | Free Fire | 355 diamond |
| FF720DGVR | Free Fire | 720 diamond |
| MLBB86DGVR | Mobile Legends | 86 diamond |