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://rekbercafe.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://rekbercafe.com/member/setting?tab=api. Kredensial API tersebut bersifat rahasia sehingga Anda harus menjaganya seperti Anda menjaga data login akun Anda
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.
API ini digunakan untuk mendapatkan daftar kategori produk kami
<?php
$apiKey = 'api key anda';
$query = [
'active' => 1, // tidak wajib, filter kategori yang aktif
];
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://rekbercafe.com/api/prepaid/category?' . 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,
]);
$response = curl_exec($ch);
$error = curl_error($ch);
curl_close($ch);
echo $error ? $error : $response;
?>
Contoh Respon Sukses
{
"status": 200,
"data": [
{
"id": 1,
"name": "Top Up",
"type": "GAME",
"active": 1
}
]
}
Contoh Respon Gagal
{
"status": 400,
"message": "Invalid API Key"
}
API ini digunakan untuk mendapatkan detail kategori
<?php
$apiKey = 'api key anda';
$categoryId = 1; // dari api list kategori
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://rekbercafe.com/api/prepaid/category/' . $categoryId,
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,
]);
$response = curl_exec($ch);
$error = curl_error($ch);
curl_close($ch);
echo $error ? $error : $response;
?>
Contoh Respon Sukses
{
"status": 200,
"data": {
"id": 1,
"name": "Top Up",
"type": "GAME",
"active": 1
}
}
Contoh Respon Gagal
{
"status": 400,
"message": "Kategori tidak ditemukan"
}
API ini digunakan untuk mendapatkan daftar provider produk kami
<?php
$apiKey = 'api key anda';
$query = [
'category' => 1, // tidak wajib, dari api list kategori
'active' => 1, // tidak wajib, filter provider yang aktif
];
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://rekbercafe.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,
]);
$response = curl_exec($ch);
$error = curl_error($ch);
curl_close($ch);
echo $error ? $error : $response;
?>
Contoh Respon Sukses
{
"status": 200,
"data": [
{
"id": 1,
"prepaid_category_id": 1,
"code": "GI",
"name": "Genshin Impact",
"icon": "genshin-impact.png",
"icon_url": "https://rekbercafe.com/images/provider/o7CFC4g0az954vh5.png",
"has_server": 1,
"has_region": 0,
"active": 1,
"servers": [
{
"id": 1,
"prepaid_provider_id": 1,
"code": "os_asia",
"name": "Asia Server"
},
{
"id": 2,
"prepaid_provider_id": 1,
"code": "os_america",
"name": "America Server"
}
]
},
{
"id": 2,
"prepaid_category_id": 1,
"code": "FF",
"name": "Free Fire",
"icon": "free-fire.png",
"icon_url": "https://rekbercafe.com/images/provider/3yFc54dew6BV4xZe.png",
"has_server": 0,
"has_region": 0,
"active": 1,
"servers": []
},
{
"id": 3,
"prepaid_category_id": 1,
"code": "ML",
"name": "Mobile Legends",
"icon": "mobile-legends.png",
"icon_url": "https://rekbercafe.com/images/provider/j76kN0o36FSQwV32.png",
"has_server": 1,
"has_region": 0,
"active": 1,
"servers": []
}
]
}
Contoh Respon Gagal
{
"status": 400,
"message": "Invalid API Key"
}
API ini digunakan untuk mendapatkan detail provider
<?php
$apiKey = 'api key anda';
$providerId = 1; // dari api list provider
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://rekbercafe.com/api/prepaid/provider/' . $providerId,
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,
]);
$response = curl_exec($ch);
$error = curl_error($ch);
curl_close($ch);
echo $error ? $error : $response;
?>
Contoh Respon Sukses
{
"status": 200,
"data": {
"id": 1,
"prepaid_category_id": 1,
"code": "GI",
"name": "Genshin Impact",
"icon": "genshin-impact.png",
"icon_url": "https://rekbercafe.com/images/provider/cTCdd41as5aX3w2v.png",
"addinfo": "Genesis Crystals",
"description": "",
"instruction": ["Masukkan ID Akun dan pilih Server", "Pilih nominal"],
"has_server": 1,
"has_region": 0,
"active": 1,
"category": {
"id": 1,
"name": "Top Up"
},
"servers": [
{
"id": 1,
"prepaid_provider_id": 1,
"code": "os_asia",
"name": "Asia Server"
},
{
"id": 2,
"prepaid_provider_id": 1,
"code": "os_america",
"name": "America Server"
}
]
}
}
Contoh Respon Gagal
{
"status": 400,
"message": "Provider tidak ditemukan"
}
API ini digunakan untuk mendapatkan daftar produk produk kami
<?php
$apiKey = 'api key anda';
$query = [
'category' => 1, // tidak wajib, dari api list kategori
'provider' => 1, // tidak wajib, dari api list provider,
'active' => 1, // tidak wajib, filter produk yang aktif
];
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://rekbercafe.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,
]);
$response = curl_exec($ch);
$error = curl_error($ch);
curl_close($ch);
echo $error ? $error : $response;
?>
Contoh Respon Sukses
{
"status": 200,
"data": [
{
"id": 1,
"prepaid_category_id": 1,
"prepaid_provider_id": 1,
"code": "FF123",
"name": "123 Diamond",
"active": 1,
"price": 10000
},
{
"id": 2,
"prepaid_category_id": 1,
"prepaid_provider_id": 1,
"code": "FF240",
"name": "240 Diamond",
"active": 1,
"price": 10000
}
]
}
Contoh Respon Gagal
{
"status": 400,
"message": "Invalid API Key"
}
API ini digunakan untuk mendapatkan detail produk
<?php
$apiKey = 'api key anda';
$productCode = 'FF240'; // dari api list produk
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://rekbercafe.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,
]);
$response = curl_exec($ch);
$error = curl_error($ch);
curl_close($ch);
echo $error ? $error : $response;
?>
Contoh Respon Sukses
{
"status": 200,
"data": {
"id": 1,
"prepaid_category_id": 1,
"prepaid_provider_id": 1,
"code": "FF240",
"name": "240 Diamond",
"active": 1,
"price": 10000,
"category": {
"id": 1,
"name": "Top Up"
},
"provider": {
"id": 1,
"name": "Free Fire",
"icon": "free-fire.png",
"icon_url": "https://rekbercafe.com/img/produk/free-fire.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 = [
'code' => 'FF123', // kode produk dari api list produk
'target' => '123456789', // nomor/id tujuan pengisian
'zone' => 'os_asia', // id zone/server (jika ada)
];
$json = json_encode($payload);
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://rekbercafe.com/api/prepaid/transaction/create',
CURLOPT_FRESH_CONNECT => true,
CURLOPT_HEADER => false,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Signature: ' . hash_hmac('sha256', $json, $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,
]);
$response = curl_exec($ch);
$error = curl_error($ch);
curl_close($ch);
echo $error ? $error : $response;
?>
Contoh Respon Sukses
{
"status": 200,
"message": "Transaksi Anda sedang diproses",
"data": {
"id": "WGG123ABCDE",
"provider_name": "Free Fire",
"product_code": "FF123",
"product_name": "123 Diamond",
"target": "1234567",
"zone": null,
"region": null,
"total_amount": 10000
}
}
Contoh Respon Gagal
{
"status": 400,
"message": "Produk sedang tidak aktif"
}
API ini digunakan untuk mendapatkan detail transaksi. Bisa juga untuk status transaksi
<?php
$apiKey = 'api key anda';
$transactionId = 'API12345678900000000'; // dari api order
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://rekbercafe.com/api/prepaid/transaction/' . $transactionId,
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,
]);
$response = curl_exec($ch);
$error = curl_error($ch);
curl_close($ch);
echo $error ? $error : $response;
?>
Contoh Respon Sukses
{
"status": 200,
"data": {
"id": "WGG123ABCDE",
"provider_name": "Free Fire",
"product_code": "FF123",
"product_name": "123 Diamond",
"target": "1234567",
"zone": null,
"region": null,
"total_amount": 10000,
"status": "processing", // 'unpaid', 'processing', 'success', 'failed', 'refund', 'expired'
"status_at": "2022-01-01T00:00:00.000Z",
"sn": null,
"note": "Transaksi sedang diproses",
"via": "api",
"created_at": "2022-01-01T00:00:00.000Z",
}
}
Contoh Respon Gagal
{
"status": 400,
"message": "Transaksi tidak ditemukan"
}