Dokumentasi API QrisP2P
QrisP2P memungkinkan website dan aplikasi Anda menghasilkan QRIS Dinamis ber-nominal otomatis secara instan, mendeteksi pembayaran masuk secara otomatis dari akun GoPay Merchant (GoBiz), dan menerima notifikasi webhook real-time ke sistem Anda tanpa potongan biaya pihak ketiga.
https://qrisp2p.com
Alur Integrasi Cepat (Quickstart)
Buat Invoice
Panggil endpoint /payment/create untuk membuat tagihan dan memperoleh string/gambar QRIS.
Tampilkan QRIS
Tampilkan qr_image ke pembeli atau arahkan ke link payment_url bawaan.
Terima Webhook
Ketika dana masuk, QrisP2P mengirim notifikasi POST otomatis ke Callback URL Anda.
Autentikasi & Keamanan
Setiap request ke endpoint privat wajib menyertakan header HTTP X-API-Key. Kunci API dapat Anda peroleh dan kelola di halaman Dashboard Merchant → Kredensial API.
X-API-Key: iak_live_a1b2c3d4e5f6g7h8i9j0...
Content-Type: application/json
Sistem QrisP2P mendukung IP Whitelist (Mode Fleksibel). Jika daftar IP kosong, request API dapat diakses dari server manapun. Begitu Anda mendaftarkan IP di menu Kredensial API → Daftar Putih IP, proteksi ketat otomatis aktif dan request dari IP lain akan ditolak dengan pesan HTTP 403 Forbidden. Endpoint pembuatan tagihan juga dilindungi Rate Limit 60 request/menit per API Key.
- Paket Langganan Aktif: Akun merchant wajib memiliki paket aktif. Jika kedaluwarsa, API merespon
HTTP 402 Payment Required. - Koneksi GoBiz & QRIS Statis: Akun merchant wajib terhubung dengan GoBiz di dashboard. Jika belum, API merespon
HTTP 400 Bad Request.
| HTTP Status | Kondisi | Penjelasan & Solusi |
|---|---|---|
| 200 OK | Berhasil | Permintaan berhasil diproses (cek status, batalkan tagihan, cek akun). |
| 201 Created | Invoice Dibuat | Tagihan baru dan Dynamic QRIS berhasil diterbitkan. |
| 400 Bad Request | Parameter Salah | Amount kurang dari Rp 1.000, reference kosong, atau QRIS toko belum diset. |
| 401 Unauthorized | Kunci Tidak Valid | Header X-API-Key tidak disertakan atau API Key salah/non-aktif. |
| 402 Payment Required | Langganan Habis | Paket langganan merchant kedaluwarsa. Silakan perpanjang di dashboard. |
| 403 Forbidden | IP Ditolak / Banned | IP server pemanggil belum didaftarkan di IP Whitelist atau akun ditangguhkan. |
| 404 Not Found | Data Tidak Ada | Nomor invoice atau referensi pesanan merchant tidak ditemukan. |
/api/v1/payment/create
Membuat tagihan invoice baru serta menghasilkan string & gambar Dynamic QRIS secara otomatis.
| Field | Tipe | Status | Deskripsi |
|---|---|---|---|
| amount | Integer | Wajib | Nominal pembayaran pokok (minimal Rp 1.000). |
| reference | String | Opsional | ID pesanan unik merchant (contoh: ORDER-9921). |
| customer_name | String | Opsional | Nama pelanggan pembeli. |
| customer_phone | String | Opsional | Nomor telepon/WhatsApp pelanggan. |
| description | String | Opsional | Keterangan atau rincian transaksi. |
| callback_url | String | Opsional | URL Webhook khusus untuk transaksi ini. |
<?php
$payload = [
'amount' => 25000,
'reference' => 'ORDER-9921',
'customer_name' => 'Budi Santoso',
'description' => 'Pembelian Paket Premium'
];
$ch = curl_init('https://qrisp2p.com/api/v1/payment/create');
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: iak_live_xxxxxxxxxxxxxxxxxxxxxxxx'
]);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
print_r($result);
curl -X POST https://qrisp2p.com/api/v1/payment/create \
-H "Content-Type: application/json" \
-H "X-API-Key: iak_live_xxxxxxxxxxxxxxxxxxxxxxxx" \
-d '{
"amount": 25000,
"reference": "ORDER-9921",
"customer_name": "Budi Santoso",
"description": "Pembelian Paket Premium"
}'
{
"success": true,
"data": {
"invoice": "INV202610300001",
"reference": "ORDER-9921",
"amount": 25014,
"nominal": 25000,
"unique_code": 14,
"qris_string": "00020101021226590014ID.LINKAJA.WWW0118936009110000000000520458125303360540725014.005802ID5914Toko Berkah6007Jakarta61051234062070703A0163045E1B",
"qr_image": "https://qrisp2p.com/payment.php?inv=INV202610300001&qr=1",
"payment_url": "https://qrisp2p.com/payment.php?inv=INV202610300001",
"status": "pending",
"expired_at": "2026-10-30 14:15:00"
}
}
/api/v1/payment/status/{reference}
Memeriksa status pembayaran transaksi secara real-time via server backend Anda.
<?php
$reference = 'ORDER-9921';
$ch = curl_init('https://qrisp2p.com/api/v1/payment/status/' . $reference);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-API-Key: iak_live_xxxxxxxxxxxxxxxxxxxxxxxx'
]);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
print_r($result);
curl -X GET https://qrisp2p.com/api/v1/payment/status/ORDER-9921 \ -H "X-API-Key: iak_live_xxxxxxxxxxxxxxxxxxxxxxxx"
{
"success": true,
"data": {
"invoice": "INV-20261030-A1B2",
"reference": "ORDER-9921",
"amount": 25014,
"nominal": 25000,
"unique_code": 14,
"status": "success",
"payment_method": "qris",
"qris_string": "000201...",
"qr_image": "https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=...",
"payment_url": "https://qrisp2p.com/payment.php?inv=INV-20261030-A1B2",
"description": "Pembelian Paket Premium",
"paid_at": "2026-10-30 14:02:18",
"expired_at": "2026-10-30 14:15:00",
"created_at": "2026-10-30 14:00:00"
}
}
Nilai field status resmi adalah: pending (menunggu bayar), success (lunas), failed (dibatalkan), atau expired (kedaluwarsa).
/api/v1/payment/cancel
Membatalkan invoice transaksi pending secara manual sebelum waktu kadaluarsa.
<?php
$payload = ['reference' => 'ORDER-9921'];
$ch = curl_init('https://qrisp2p.com/api/v1/payment/cancel');
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: iak_live_xxxxxxxxxxxxxxxxxxxxxxxx'
]);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
print_r($result);
curl -X POST https://qrisp2p.com/api/v1/payment/cancel \
-H "Content-Type: application/json" \
-H "X-API-Key: iak_live_xxxxxxxxxxxxxxxxxxxxxxxx" \
-d '{"reference": "ORDER-9921"}'
{
"success": true,
"message": "Transaksi berhasil dibatalkan",
"data": {
"reference": "ORDER-9921",
"status": "failed"
}
}
/api/v1/account/status
Memeriksa status koneksi akun GoBiz, status sinkronisasi, dan nomor telepon terhubung.
<?php
$ch = curl_init('https://qrisp2p.com/api/v1/account/status');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-API-Key: iak_live_xxxxxxxxxxxxxxxxxxxxxxxx'
]);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
print_r($result);
curl -X GET https://qrisp2p.com/api/v1/account/status \ -H "X-API-Key: iak_live_xxxxxxxxxxxxxxxxxxxxxxxx"
{
"success": true,
"data": {
"is_connected": true,
"merchant_name": "Toko Berkah",
"brand_name": "Berkah Store",
"phone_number": "081****5678",
"last_synced_at": "2026-10-30 14:04:10"
}
}
GET /payment.php?inv={reference}&check=1
⚠️ Keamanan Frontend:
Jangan pernah memanggil endpoint /api/v1/payment/status langsung dari JavaScript browser pembeli karena akan mengekspos API Key rahasia Anda. Gunakan endpoint publik aman berikut untuk polling otomatis di halaman checkout buatan Anda sendiri:
// Polling status di browser pembeli setiap 3 detik
setInterval(async () => {
const res = await fetch('https://qrisp2p.com/payment.php?inv=ORDER-9921&check=1');
const json = await res.json();
if (json.status === 'success') {
window.location.href = '/payment-success.php?order=ORDER-9921';
}
}, 3000);
Notifikasi Webhook Callback
Ketika mutasi GoBiz mendeteksi pembayaran yang cocok dengan invoice pending, sistem akan langsung mengirimkan HTTP POST secara real-time ke URL Callback Anda dengan header signature keamanan HMAC-SHA256.
Anda dapat mendaftarkan hingga 5 endpoint webhook sekaligus pada Dashboard. Setiap transaksi lunas akan disiarkan secara paralel ke seluruh server tujuan (misal Website Toko, Bot Telegram, dan Software Pembukuan/ERP) menggunakan curl_multi tanpa perantara.
{
"event": "payment.updated",
"invoice": "INV-20261030-A1B2",
"reference": "ORDER-9921",
"amount": 25014,
"nominal": 25000,
"unique_code": 14,
"status": "success",
"payment_method": "qris",
"paid_at": "2026-10-30 14:02:18",
"timestamp": "2026-10-30T14:02:18+07:00"
}
Verifikasi Signature Webhook (PHP)
Pastikan script callback di server Anda memvalidasi header signature HMAC-SHA256 agar terhindar dari pemalsuan notifikasi:
<?php
// 1. Ambil Webhook Secret dari Dashboard Merchant
$webhookSecret = 'whsec_live_abcdef123456...';
// 2. Ambil raw JSON body & header signature
$rawPayload = file_get_contents('php://input');
$signatureHeader = $_SERVER['HTTP_X_SIGNATURE'] ?? '';
// 3. Bersihkan prefix "sha256=" jika ada
$receivedSignature = str_replace('sha256=', '', $signatureHeader);
// 4. Hitung HMAC-SHA256 dari raw payload (Stripe / GitHub Standard)
$expectedSignature = hash_hmac('sha256', $rawPayload, $webhookSecret);
// 5. Validasi timing-attack safe
if (hash_equals($expectedSignature, $receivedSignature)) {
$data = json_decode($rawPayload, true);
$orderId = $data['reference'];
$status = $data['status']; // 'success'
if ($status === 'success') {
// UPDATE STATUS PESANAN ANDA MENJADI LUNAS DI SINI
}
http_response_code(200);
echo json_encode(['status' => 'success', 'message' => 'Webhook processed']);
} else {
http_response_code(401);
echo json_encode(['status' => 'unauthorized', 'message' => 'Invalid signature']);
}
Official QrisP2P Client
Class PHP Native zero-dependency siap pakai untuk mempercepat integrasi tanpa perlu repot menulis curl manual:
<?php
require_once 'QrisP2PClient.php';
$client = new QrisP2PClient(
'https://qrisp2p.com',
'iak_live_xxxxxxxxxxxxxxxxxxxxxxxx',
'whsec_live_abcdef123456...'
);
// 1. Buat Pembayaran QRIS Dinamis
$invoice = $client->createPayment(25000, 'ORDER-9921', 'Budi Santoso');
$qrisString = $invoice['data']['qris_string'];
$qrImage = $invoice['data']['qr_image'];
// 2. Cek Status Transaksi
$status = $client->checkStatus('ORDER-9921');
// 3. Batalkan Tagihan Pending
$cancel = $client->cancelPayment('ORDER-9921');
// 4. Validasi Webhook Callback (Otomatis & Aman)
$webhook = $client->verifyWebhook();
if ($webhook['isValid']) {
$orderId = $webhook['data']['reference'];
$status = $webhook['data']['status']; // 'success'
if ($status === 'success') {
// UPDATE STATUS PESANAN ANDA MENJADI LUNAS DI SINI
}
QrisP2PClient::respondWebhook(true, 'Payment recorded');
} else {
QrisP2PClient::respondWebhook(false, $webhook['error'], 401);
}