Solusi Praktis untuk Transaksi Digital
Untuk dapat mulai menggunakan API kami, Anda harus mendaftar terlebih dahulu melalui halaman pendaftaran di . Setelah melakukan pendaftaran silahkan lakukan topup saldo untuk dapat melakukan transaksi.
<?php
$apiKey = 'api key anda';
$query = [
'active' => 1, // Opsional, filter provider yang aktif
];
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://web-dev.senpay.id/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;
?>
{
"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://web-dev.senpay.id/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://web-dev.senpay.id/images/provider/1717855735f7nQaJ4A4G.jpg"
},
]
}
{
"status": 400,
"message": "Invalid API Key"
}
<?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://web-dev.senpay.id/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;
?>
{
"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": {
"code": "FFMAX-BJ-V3",
"name": "Free Fire MAX [PROMO TERMURAH] V3"
}
},
{
"id": 467,
"code": "FFMAX-BJ-V3FFMAX_ID_100",
"name": "100 Diamonds",
"active": 1,
"price": 14882,
"provider": {
"code": "FFMAX-BJ-V3",
"name": "Free Fire MAX [PROMO TERMURAH] V3"
}
},
{
"id": 468,
"code": "FFMAX-BJ-V3FFMAX_ID_1000",
"name": "1000 Diamonds",
"active": 1,
"price": 130180,
"provider": {
"code": "FFMAX-BJ-V3",
"name": "Free Fire MAX [PROMO TERMURAH] V3"
}
}
]
}
{
"status": 400,
"message": "Invalid API Key"
}
<?php
$apiKey = 'api key anda';
$productCode = 'FFMAX-BJ-V3FFMAX_ID_140'; // Wajib, Kode produk
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://web-dev.senpay.id/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;
?>
{
"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://web-dev.senpay.id/images/provider/17182474347Vr0hpu1dG.png"
}
}
}
{
"status": 400,
"message": "Produk tidak ditemukan"
}
Parameter "partner_reference" harus unique dalam waktu 24 jam terakhir!
<?php
$apiKey = 'api key anda';
$secretKey = 'secret key anda';
$payload = [
'target_product_code' => 'MLBB-BJ-V3-ALLMLBB_ID_5', // Wajib, kode produk
'partner_reference' => 'INV12345678', //Ini nomor reference anda, Harus unique dalam 24Jam terakhir
// 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://web-dev.senpay.id/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;
?>
{
"status": 200,
"data": {
"reference": "TRX24070385294000934",
"partner_reference": "INV12345678",
"provider": "Mobile Legends [PROMO TERMURAH] V3",
"product": "5 (5+0) Diamonds",
"price": 1425,
"status": "processing",
"invoice_url": "https://web-dev.senpay.id/trx/TRX24070385294000934"
}
}
{
"status": 400,
"message": "Produk sedang tidak aktif"
}
<?php
$apiKey = 'api key anda';
$reference = 'TRX4070352854773835'; // Wajib, nomor referensi transaksi
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://web-dev.senpay.id/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;
?>
TIPS: Gunakan property data.status
sebagai acuan status transaksi dan status akan berisi salah satu
dari: unpaid
, processing
,
success
, failed
, refund
,
expired
{
"status": 200,
"data": {
"reference": "TRX24070218917356867",
"partner_reference": "INV12345678",
"provider": "Pulsa Lengkap Telkomsel V3",
"product": "10.000 Pulsa REG",
"status": "success",
"status_at": "2024-07-02T13:09:08.000000Z",
"sn": "N/A",
"note": "Transaksi berhasil pada 2024/07/02 20:11:27 WIB",
"webhook_sent": true,
"created_at": "2024-07-02T13:08:38.000000Z",
"invoice_url": "https://web-dev.senpay.id/trx/TRX24070218917356867"
}
}
{
"status": 400,
"message": "Transaksi tidak ditemukan"
}
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 pastikan hanya mengizinkan webhook yang dikirim dari IP webhook kami saja: 206.189.83.1
Contoh Data Webhook
{
"webhook_type": "transaction_status",
"reference": "TRX24070385294000934",
"partner_reference": "INV12345678",
"status": "success",
"sn": "N\/A",
"note": "Transaksi berhasil pada 2024\/07\/02 20:11:27 WIB",
"sent_at": "2024-07-02T13:11:43.249729Z"
}
{
"status": 200,
"message": "Webhook berhasil diproses"
}
{
"status": 400,
"message": "Transaksi tidak ditemukan: TRX24070385294000934"
}
{
"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
}
]
}
{
"status": 200,
"message": "Harga berhasil diuperbarui"
}
{
"status": 400,
"message": "Invalid signature"
}