Setiap proyek (mis. Bot Telegram 1, Bot Telegram 2, Website) punya API key dan
callback default. Saat membuat order, kirim header X-Project-Key —
order otomatis tercatat ke proyek itu & pembayaran lunas otomatis dikirim ke callback-nya.
| Proyek | API Key | Callback | Statistik | Status | Aksi |
|---|
| Ref | Proyek | Nominal | Status | Dibuat | Klien |
|---|
Gateway ini berjalan sebagai layanan terpisah (jalankan di VPS/server Anda dan expose melalui domain). Projek lain cukup memanggil HTTP API-nya — tidak perlu menyimpan seluruh proyek gateway di setiap aplikasi.
Buka tab Proyek, tambahkan aplikasi Anda (Bot Telegram, Website, dll). Setiap proyek mendapat API key dan callback default. Saat order dibuat dengan key itu, pembayaran lunas otomatis di-POST ke callback proyek tersebut.
const r = await fetch('https://PAY-URL-ANDA/api/orders', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Project-Key': 'pk_live_xxxxxxxxxxxx' // dari tab Proyek
},
body: JSON.stringify({
amount: 50000, clientRef: 'ORDER-001'
// callbackUrl opsional; jika kosong, pakai callback default proyek
})
});
const { data } = await r.json();
// data.qrImage -> PNG QR base64, tampilkan ke pembeli
// data.qrisPayload -> string QRIS
// data.orderId -> simpan untuk polling status
// data.reference -> ID unik QRIS
/* POST ke callback URL proyek Anda */
{
"type": "payment.succeeded",
"project": { "id": "…", "name": "Bot Telegram 1" },
"order": {
"id": "…", "reference": "…", "clientRef": "…",
"amount": 50000, "currency": "IDR", "status": "paid",
"paidAt": "2026-08-23T05:00:00.000Z", "providerTxId": "…"
}
}
curl -X POST https://PAY-URL-ANDA/api/orders \
-H "Content-Type: application/json" \
-H "X-Project-Key: pk_live_xxx" \
-d '{"amount":50000,"clientRef":"ORDER-PL"}'
$ch = curl_init('https://PAY-URL-ANDA/api/orders');
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'amount'=>50000, 'clientRef'=>'ORDER-PL'
]));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = json_decode(curl_exec($ch), true);
// tampilkan $res['data']['qrImage'], simpan $res['data']['orderId']
POST /api/orders buat order (amount, clientRef, callbackUrl, expireSeconds)
GET /api/orders/:id cek status (pending/paid/cancelled)
GET /api/orders/:id/qr.png gambar QR langsung (untuk <img src>)
POST /api/orders/:id/cancel batalkan order pending
Callback otomatis saat lunas: JSON {"type":"payment.succeeded","order":{...}} POST ke callbackUrl