G
GoPayGateway API v1.0 Live
Panduan Teknis Integrasi Official API

Dokumentasi Integrasi GoPay Merchant & QRIS API

Integrasikan pembayaran otomatis QRIS GoPay ke toko online Anda (PHP, Laravel, Node.js, Python, & Frontend Web) dengan verifikasi lunas real-time.

{/* Quick Credentials Box */}
Kredensial Autentikasi API Live Status Sesi: Aktif (Valid)
Base URL Server: https://gopay.afifzuhri.com
Secret API Key: gopay_secret_key_2026

1. Alur Pembayaran (Payment Flow)

Sistem transaksi bekerja secara otomatis dengan pembuatan QRIS dinamis dan pengecekan mutasi masuk:

  1. Website/Aplikasi Anda memanggil API GET /create-qris?amount=25000.
  2. Server merespon link checkout qris_url, kode string qris_code, dan trx_id.
  3. Pembeli memindai QRIS menggunakan aplikasi **GoPay**, **BCA Mobile**, **ShopeePay**, **OVO**, **DANA**, atau M-Banking lainnya.
  4. Website Anda memverifikasi status kelunasan via GET /check-payment?amount=25000&trx_id=....
GET / POST

/create-qris — Buat QRIS Pembayaran

Mencetak kode QRIS dinamis berbasis standar EMVCo (CRC16) sesuai nominal transaksi. QR aktif selama 5 menit.

Contoh Request URL:

GET https://gopay.afifzuhri.com/create-qris?amount=25000&api_key=gopay_secret_key_2026

Contoh Respon JSON Sukses:

{
  "success": true,
  "data": {
    "qris_id": "abc123xyz",
    "trx_id": "TRX-A3F8K2M9",
    "qris_url": "https://gopay.afifzuhri.com/qr/abc123xyz",
    "qris_code": "00020101021126580014ID.GO-JEK.WWW...",
    "amount": 25000,
    "expires_at": "2026-08-27T07:25:00.000Z",
    "expires_in": "5 menit"
  }
}
GET / POST

/check-payment — Verifikasi Pembayaran Lunas

Memeriksa apakah mutasi dana sebesar nominal tertentu sudah masuk ke akun GoPay Merchant.

Contoh Request URL:

GET https://gopay.afifzuhri.com/check-payment?amount=25000&trx_id=TRX-A3F8K2M9&api_key=gopay_secret_key_2026

Contoh Respon JSON (Lunas):

{
  "success": true,
  "paid": true,
  "transaction": {
    "transaction_id": "gopay-tx-123456",
    "amount": 25000,
    "payer_issuer": "GoPay / BCA",
    "payment_type": "QRIS",
    "transaction_time": "2026-08-27T06:40:00.000Z"
  }
}

5. Contoh Kode PHP Native

<?php
$baseUrl = 'https://gopay.afifzuhri.com';
$apiKey = 'gopay_secret_key_2026';
$amount = 25000;

// 1. Buat QRIS
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $baseUrl . '/create-qris?amount=' . $amount);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-Api-Key: ' . $apiKey]);
$res = json_decode(curl_exec($ch), true);
curl_close($ch);

if ($res['success']) {
    $qrisUrl = $res['data']['qris_url'];
    $trxId   = $res['data']['trx_id'];
    echo "Scan QRIS di sini: " . $qrisUrl;
}
?>

6. Contoh Kode Laravel

use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'X-Api-Key' => 'gopay_secret_key_2026',
])->get('https://gopay.afifzuhri.com/create-qris', [
    'amount' => 25000,
]);

$result = $response->json();