Spesifikasi API Integrasi & Referensi Kode untuk Website Merchant
Setiap request checkout memerlukan autentikasi API Secret Key dari file .env server kamu. Kirimkan secret key ini di HTTP Header sebagai X-API-KEY.
Membuat transaksi baru dengan kode unik otomatis. Menerima custom orderId dari sistem web kamu.
Content-Type: application/json X-API-KEY: YOUR_API_SECRET_KEY
{
"orderId": "INV-2026-1092",
"amount": 50000,
"customerName": "Budi Santoso",
"note": "Pembelian Produk #1092"
}
{
"success": true,
"data": {
"orderId": "INV-2026-1092",
"baseAmount": 50000,
"uniqueCode": 123,
"totalAmount": 50123,
"status": "PENDING",
"paymentUrl": "https://pg.warungerik.com/pay/INV-2026-1092",
"qrCodeDataUrl": "data:image/png;base64,..."
}
}
Mengecek status pembayaran real-time langsung ke GoBiz Journal API.
{
"success": true,
"data": {
"orderId": "INV-2026-1092",
"status": "PAID",
"totalAmount": 50123,
"paidAt": "2026-08-06T17:45:10.000Z"
}
}
<?php
$gatewayUrl = 'https://pg.warungerik.com/api/checkout';
$secretKey = 'YOUR_API_SECRET_KEY';
// Kirim Order ID Asli dari Sistem Website / Toko Kamu
$payload = [
'orderId' => 'INV-' . time(),
'amount' => 50000,
'customerName' => 'Budi Santoso',
'note' => 'Pembelian Produk Online'
];
$ch = curl_init($gatewayUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'X-API-KEY: ' . $secretKey
]);
$res = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!empty($res['success'])) {
// Redirect Pembeli ke Halaman QRIS Gateway
header("Location: " . $res['data']['paymentUrl']);
exit();
}
?>