Otomasi QRIS GoPay Merchant: buat QRIS dinamis, deteksi pembayaran otomatis, webhook otomatis.
Base URL: {BASE_URL} — setiap owner mendapat API key masing-masing (lihat menu API Keys di dashboard).
// 1. Dapatkan API Key dari dashboard (menu API Keys) // 2. Set callback URL untuk terima webhook (menu Pengaturan) // 3. Generate QRIS, sistem auto-polling, webhook masuk otomatis curl -X POST {BASE_URL}/qris/generate \ -H "Authorization: Bearer agp_xxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"amount": 50000}'
Kirim header Authorization: Bearer <API_KEY>. Key dapat dinonaktifkan kapan pun dari dashboard.
| Method | Endpoint |
|---|---|
| POST | /qris/generate |
// Body { "amount": 50000, "external_id": "order-42", "callback_url": "https://sistem.webhook", "expires_in": 600000 } // Response { "success": true, "message": "QRIS dibuat", "data": { "transaction_id": "pay_lxm3k9xxxx", "amount": 50000, "unique_amount": 50001, "status": "pending", "paid": false, "qr_url": "https://{BASE_URL}/qr/pay_lxm3k9xxxx.png", "checkout_url": "https://{BASE_URL}/pay/abcd1234efgh", "callback_url": "https://sistem.webhook", "expires_at": "2026-09-21T01:00:00.000Z" } }
• unique_amount adalah nominal yang harus dibayar pelanggan (amount + offset unik agar bisa dibedakan antarpesanan).
• QRIS berlaku default 10 menit (maks 15 menit). Sistem cek pembayaran tiap 3 detik dan mengirim webhook saat lunas.
| Method | Endpoint |
|---|---|
| POST | /qris/status |
// Body { "transaction_id": "pay_lxm3k9xxxx" } // Response saat lunas { "success": true, "data": { "transaction_id": "pay_lxm3k9xxxx", "status": "settlement", "transaction_status": "settlement", "paid": true, "paid_at": "2026-09-21T00:50:12.000Z", "mode": "gopay" | "demo" } }
Status: pending → settlement (paid) / expired / cancelled.
| Method | Endpoint |
|---|---|
| POST | /qris/cancel |
{ "transaction_id": "pay_lxm3k9xxxx" }| Method | Endpoint |
|---|---|
| GET | /qris/list |
Mengembalikan 100 transaksi terakhir owner.
Saat transaksi lunas, sistem mengirim POST ke callback_url Anda.
X-Signature: <HMAC-SHA256(raw-body, webhook-secret)>
Content-Type: application/json
{
"event": "payment.success",
"transaction_id": "pay_...",
"amount": 50000,
"unique_amount": 50001,
"external_id": "order-42",
"status": "settlement",
"paid": true,
"page_url": "https://{BASE_URL}/pay/abcd1234efgh",
"paid_at": "2026-09-21T00:50:12.000Z"
}
• Wajib return HTTP 200. Gagal → retry 5x dengan jeda meningkat.
• Verifikasi tanda tangan dengan HMAC-SHA256 memakai webhook secret Anda (menu Pengaturan).
• Cek duplikasi berdasarkan transaction_id agar idempotent.
POST /qris/generate → { "success": true, "data": { "transaction_id": "pay_...", "amount": 10000, "qr_url": "..." } }
// Ambil qr_url, kirim ke customer (WhatsApp/Telegram/email).
// Polling /qris/status tiap 3 detik:
// saat paid=true => proses order
// saat expired => batalkan
// Atau pakai webhook untuk notifikasi instan.
Setiap QRIS punya payment link /pay/:token. Customer membuka link, QR + countdown + status berubah otomatis saat lunas. Responsive mobile & desktop.