Tujuan
Kami menyediakan fasilitas API untuk melakukan transaksi melalui API.
Di halaman ini kami sediakan dokumentasi teknis tentang cara menggunakan API kami.
Untuk dapat mulai menggunakan API kami, Anda harus mendaftar terlebih dahulu
melalui halaman pendaftaran di https://tokowendigg.com/auth/register.
Setelah melakukan pendaftaran silahkan lakukan topup saldo untuk dapat melakukan
transaksi.
Kredensial API
Untuk mengakses API kami, Anda harus membuat sebuah API Key & Secret Key
melalui halaman
https://tokowendigg.com/member/setting?tab=api
.
Kredensial API tersebut bersifat rahasia sehingga Anda harus menjaganya dengan bijak
Perubahan
Jika di kemudian hari Anda lupa untuk menyimpan kredensial API Anda
ataupun Anda ingin mengubah kredensial API,
silahkan hapus kredensial API lama kemudian buatlah kredensial baru
dan ubah setelan kredensial di situs Anda mengikuti kredensial API baru tersebut
agar layanan Anda tetap dapat mengakses API kami.
Bantuan
Jika Anda masih merasa kebingungan akan proses integrasi via API ini,
silahkan hubungi kami melalui tombol chat di pojok kanan bawah layar anda.
Webhook ini dikirim untuk notifikasi perubahan harga produk pada web kami
Kami akan mengirim notifikasi ke URL webhook yang telah anda tentukan
pada pengaturan akun di
https://tokowendigg.com/member/setting?tab=webhook
.
Webhook akan dikirimkan ketika transaksi anda berubah statusnya menjadi:
success
yang artinya transaksi anda sukses/tuntas,failed
yang artinya transaksi anda gagal, atauexpired
yang artinya transaksi kedaluwarsa.
Untuk keamanan, silahkan whitelist IP webhook kami dan pastikanuntuk
hanya mengizinkan webhook yang dikirim dari IP webhook kami saja:
95.111.198.189
Contoh Data Webhook
{
"webhook_type": "transaction_status",
"reference": "API24070244415211481",
"status": "success",
"sn": "N\/A",
"note": "Transaksi berhasil pada 2024\/07\/02 20:11:27 WIB",
"sent_at": "2024-07-02T13:11:43.249729Z"
}
Contoh Respon Sukses
{
"status": 200,
"message": "Webhook berhasil diiproses"
}
Contoh Respon Gagal
{
"status": 400,
"message": "Invalid signature"
}
Webhook ini dikirim untuk notifikasi perubahan harga produk pada web kami
{
"webhook_type": "price_update",
"data": [
{
"product_code": "MLBB-BJ-V3-ALLMLBB_ID_5",
"price_old": 1425,
"price_new": 1480
},
{
"product_code": "MLBB-BJ-V3-ALLMLBB_ID_10",
"price_old": 2868,
"price_new": 1920
},
{
"product_code": "MLBB-BJ-V3-ALLMLBB_ID_15",
"price_old": 4255,
"price_new": 4290
}
]
}
Contoh Respon Sukses
{
"status": 200,
"message": "Harga berhasil diuperbarui"
}
Contoh Respon Gagal
{
"status": 400,
"message": "Invalid signature"
}
API ini digunakan untuk mendapatkan daftar provider produk kami
<?php
$apiKey = 'api key anda';
$query = [
'active' => 1, // Opsional, filter provider yang aktif
];
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://tokowendigg.com/api/prepaid/provider?' . http_build_query($query),
CURLOPT_FRESH_CONNECT => true,
CURLOPT_HEADER => false,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Accept: application/json',
],
CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FAILONERROR => false,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_SSL_VERIFYPEER => false,
]);
$response = curl_exec($ch);
$error = curl_error($ch);
curl_close($ch);
echo $error ? $error : $response;
?>
Contoh Respon Sukses
{
"status": 200,
"data": [
{
"id": 9,
"code": "AKV-BJ",
"name": "Astra Knights of Veda V3",
"active": 1,
"icon": "1717861533U2HAY5jfw1.png",
"forms": [ // Gunakan property 'key' dibawah ini untuk payload pada saat melakukan order
{
"label": "UID",
"key": "id",
"type": "text"
},
{
"label": "Sever List/Server ID",
"key": "server",
"type": "dropdown", // Jika type nya 'dropdown' maka ia memiliki dopdown options
"options": [
{
"name": "AMERICAS",
"code": "10040400"
},
{
"name": "KR / JP / TW",
"code": "10040300"
},
{
"name": "SEA / OCE",
"code": "10040200"
}
]
}
],
"icon_url": "https://tokowendigg.com/images/provider/1717861533U2HAY5jfw1.png"
},
{
"id": 6,
"code": "ABM22-RCF",
"name": "ARENA BREAKOUT [PROMO TERMURAH] Q2",
"active": 1,
"icon": "1717855735f7nQaJ4A4G.jpg",
"forms": [
{
"label": "User ID",
"key": "player_id",
"type": "text" // Jika type nya 'text' maka ia tidak memiliki dopdown options
},
{
"label": "Sever List/Server ID",
"key": "server",
"type": "text"
}
],
"icon_url": "https://tokowendigg.com/images/provider/1717855735f7nQaJ4A4G.jpg"
},
]
}
Contoh Respon Gagal
{
"status": 400,
"message": "Invalid API Key"
}
API ini digunakan untuk mendapatkan daftar produk produk kami
<?php
$apiKey = 'api key anda';
$query = [
'provider' => 'FFMAX-BJ-V3', // Wajib, kode provider dari api List Provider
'active' => 1, // Opsional, filter provider yang aktif
];
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://tokowendigg.com/api/prepaid/product?' . http_build_query($query),
CURLOPT_FRESH_CONNECT => true,
CURLOPT_HEADER => false,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Accept: application/json',
],
CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FAILONERROR => false,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_SSL_VERIFYPEER => false,
]);
$response = curl_exec($ch);
$error = curl_error($ch);
curl_close($ch);
echo $error ? $error : $response;
?>
Contoh Respon Sukses
{
"status": 200,
"data": [
{
"id": 466,
"code": "FFMAX-BJ-V3FFMAX_ID_10", // Gunakan ini untuk payload 'target_product_code' pada saat melakukan order
"name": "10 Diamonds",
"active": 1,
"price": 1864,
"provider": {
"id": 159,
"code": "FFMAX-BJ-V3",
"name": "Free Fire MAX [PROMO TERMURAH] V3",
"active": 1
}
},
{
"id": 467,
"code": "FFMAX-BJ-V3FFMAX_ID_100",
"name": "100 Diamonds",
"active": 1,
"price": 14882,
"provider": {
"id": 159,
"code": "FFMAX-BJ-V3",
"name": "Free Fire MAX [PROMO TERMURAH] V3",
"active": 1
}
},
{
"id": 468,
"code": "FFMAX-BJ-V3FFMAX_ID_1000",
"name": "1000 Diamonds",
"active": 1,
"price": 130180,
"provider": {
"id": 159,
"code": "FFMAX-BJ-V3",
"name": "Free Fire MAX [PROMO TERMURAH] V3",
"active": 1
}
}
]
}
Contoh Respon Gagal
{
"status": 400,
"message": "Invalid API Key"
}
API ini digunakan untuk mendapatkan detail produk
<?php
$apiKey = 'api key anda';
$productCode = 'FFMAX-BJ-V3FFMAX_ID_140'; // Wajib, Kode produk
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://tokowendigg.com/api/prepaid/product/' . $productCode,
CURLOPT_FRESH_CONNECT => true,
CURLOPT_HEADER => false,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Accept: application/json',
],
CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FAILONERROR => false,
// Hanya aktifkan jika error SSL
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_SSL_VERIFYPEER => false,
]);
$response = curl_exec($ch);
$error = curl_error($ch);
curl_close($ch);
echo $error ? $error : $response;
?>
Contoh Respon Sukses
{
"status": 200,
"data": {
"id": 472,
"code": "FFMAX-BJ-V3FFMAX_ID_140",
"name": "140 Diamonds",
"active": 1,
"price": 18610,
"provider": {
"id": 49,
"code": "FFMAX-BJ-V3",
"name": "Free Fire MAX [PROMO TERMURAH] V3",
"icon": "17182474347Vr0hpu1dG.png",
"icon_url": "https://tokowendigg.com/images/provider/17182474347Vr0hpu1dG.png"
}
}
}
Contoh Respon Gagal
{
"status": 400,
"message": "Produk tidak ditemukan"
}
API ini digunakan untuk melakukan order produk
<?php
$apiKey = 'api key anda';
$secretKey = 'secret key anda';
$payload = [
'target_product_code' => 'MLBB-BJ-V3-ALLMLBB_ID_5', // Wajib, kode produk yang ingin di order
// Payload dibawah ini harus mengikuti property 'data.forms.*.key' di Provider Listings
// Payload yang ada pada 'data.forms.*.key' adalah mandatory atau wajib diisi
'id' => '1122334455',
'server' => '112233',
];
$json = json_encode($payload);
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://tokowendigg.com/api/prepaid/transaction/create',
CURLOPT_FRESH_CONNECT => true,
CURLOPT_HEADER => false,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Signature: ' . $secretKey,
'Content-Type: application/json',
'Accept: application/json',
],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $json,
CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FAILONERROR => false,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_SSL_VERIFYPEER => false,
]);
$response = curl_exec($ch);
$error = curl_error($ch);
curl_close($ch);
echo $error ? $error : $response;
?>
Contoh Respon Sukses
{
"status": 200,
"data": {
"type": "order",
"reference": "API24070144287694389",
"provider": "Pulsa Lengkap Tri V3",
"product": "10.000 Pulsa REG",
"price": 10575,
"status": "processing",
"invoice_url": "https://tokowendigg.com/trx/API24070144287694389",
"expired_at": "2024-07-02T07:45:21.000000Z"
}
}
Contoh Respon Gagal
{
"status": 400,
"message": "Produk sedang tidak aktif"
}
API ini digunakan untuk melakukan deposit saldo
<?php
$apiKey = 'api key anda';
$secretKey = 'secret key anda';
$payload = [
'amount' => 500000,
'via' => 'bca', // Wajib diisi 'bca' untuk saat ini
];
$json = json_encode($payload);
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://tokowendigg.com/api/prepaid/transaction/deposit',
CURLOPT_FRESH_CONNECT => true,
CURLOPT_HEADER => false,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Signature: ' . $secretKey,
'Content-Type: application/json',
'Accept: application/json',
],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $json,
CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FAILONERROR => false,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_SSL_VERIFYPEER => false,
]);
$response = curl_exec($ch);
$error = curl_error($ch);
curl_close($ch);
echo $error ? $error : $response;
?>
Contoh Respon Sukses
{
"status": 200,
"data": {
"type": "deposit",
"reference": "API24071345143053340",
"provider": "DEPOSIT",
"product": "Isi Saldo Rp. 500.000",
"price": 500655,
"via": "Bank BCA",
"status": "unpaid",
"invoice_url": "https://tokowendigg.com/trx/API24071345143053340",
"expired_at": "2024-07-13T08:10:35.000000Z"
}
}
Contoh Respon Gagal
{
"status": 400,
"message": "Minimum nominal untuk menggunakan metode pembayaran ini Rp 10.000"
}
API ini digunakan untuk mendapatkan detail status order dan status deposit
<?php
$apiKey = 'api key anda';
$reference = 'API24070144287694389'; // Wajib, nomor referensi transaksi
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://tokowendigg.com/api/prepaid/transaction/' . $reference,
CURLOPT_FRESH_CONNECT => true,
CURLOPT_HEADER => false,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Accept: application/json',
],
CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FAILONERROR => false,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_SSL_VERIFYPEER => false,
]);
$response = curl_exec($ch);
$error = curl_error($ch);
curl_close($ch);
echo $error ? $error : $response;
?>
Contoh Respon Sukses
Gunakan property
data.status
sebagai aucan status transaksi.
Status akan berisi salah satu dari:
unpaid
, processing
, success
, failed
, refund
, expired
{
"status": 200,
"data": {
"reference": "API24070144287694389",
"provider": "Pulsa Lengkap Tri V3",
"product": "10.000 Pulsa REG",
"status": "success",
"status_at": "2024-07-01T07:47:57.000000Z",
"sn": "R24070110116094757",
"note": "Transaksi berhasil pada 2024/07/01 14:47:57 WIB",
"webhook_sent": false,
"created_at": "2024-07-01T07:45:21.000000Z",
"invoice_url": "https://tokowendigg.com/trx/API24070144287694389",
"expired_at": "2024-07-02T07:45:21.000000Z"
}
}
Contoh Respon Gagal
{
"status": 400,
"message": "Transaksi tidak ditemukan"
}
API ini digunakan untuk cek saldo
<?php
$apiKey = 'api key anda';
$secretKey = 'secret key anda';
$payload = []; // Payload kosongkan saja
$json = json_encode($payload);
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://tokowendigg.com/api/prepaid/transaction/balance',
CURLOPT_FRESH_CONNECT => true,
CURLOPT_HEADER => false,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Signature: ' . $secretKey,
'Content-Type: application/json',
'Accept: application/json',
],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $json,
CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FAILONERROR => false,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_SSL_VERIFYPEER => false,
]);
$response = curl_exec($ch);
$error = curl_error($ch);
curl_close($ch);
echo $error ? $error : $response;
?>
Contoh Respon Sukses
{
"status": 200,
"data": {
"username": "zorro",
"level": "reseller",
"balance": 500000
}
}
Contoh Respon Gagal
{
"status": 400,
"message": "Anda tidak memiliki akses ke api kami"
}