Mulai Integrasi BAYAR GG API
Ikuti langkah cepat berikut untuk membuat payment link pertama, mengecek status pembayaran, dan menerima webhook callback.
-
Ambil API Key
Login ke dashboard BAYAR GG, buka menu Settings/API, lalu salin API key Anda. -
Set environment variable
Jangan hardcode API key di source code. Simpan di environment. -
Buat payment link
Panggil endpointPOST /api/create-payment.php, lalu redirect customer kepayment_url. -
Terima callback
Pasangcallback_urldan verifikasi signature webhook di server Anda.
1. Setup environment
export BAYAR_GG_API_KEY="YOUR_API_KEY_HERE"
export BAYAR_GG_BASE_URL="https://www.bayar.gg/api"
2. Create payment (cURL)
curl -X POST https://www.bayar.gg/api/create-payment.php \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY_HERE" \
-d '{
"amount": 10000,
"description": "Pembayaran Produk A",
"customer_name": "Budi",
"callback_url": "https://example.com/webhook/bayar-gg",
"redirect_url": "https://example.com/thank-you",
"payment_url": "https://www.bayar.gg/pay",
"payment_method": "qris_livin",
"use_qris_converter": true
}'
3. Pilih contoh kode
PHP
Gunakan client class di examples/php/BayarGgClient.php.
cd examples/php
BAYAR_GG_API_KEY="YOUR_API_KEY_HERE" php example.php
Python
Install dependency lalu jalankan sample checkout.
cd examples/python
pip install -r requirements.txt
BAYAR_GG_API_KEY="YOUR_API_KEY_HERE" python example.py
Node.js
Client berbasis fetch/ESM untuk backend Node.js.
cd examples/nodejs
npm install
BAYAR_GG_API_KEY="YOUR_API_KEY_HERE" node example.mjs
4. Endpoint penting
| Endpoint | Fungsi |
POST /api/create-payment.php | Buat payment link baru |
GET /api/check-payment.php?invoice=... | Cek status invoice |
GET /api/get-payment-methods.php | Daftar metode bayar yang tersedia |
POST callback_url | Webhook saat pembayaran sukses |
BAYAR GG API Integrations
Contoh integrasi resmi untuk REST API yang tampil di API Docs BAYAR GG menggunakan PHP, Python, dan Node.js. Repository ini dibuat agar developer bisa langsung membuat payment link, cek status pembayaran, membaca riwayat transaksi, memakai QRIS Converter, Digital Product API, WhatsApp Store API, dan webhook callback dari website atau backend sendiri.
API production: https://www.bayar.gg/api
Fitur API
- Buat payment link QRIS / metode pembayaran aktif.
- Cek status invoice dan riwayat pembayaran.
- Ambil daftar payment method yang tersedia untuk akun.
- Statistik akun dan status fitur pembayaran.
- QRIS Converter untuk mengubah QRIS statis menjadi dinamis.
- Digital Product API untuk file, konten, dan foto produk.
- WhatsApp Store order API.
- Callback/webhook pembayaran sukses ke server Anda.
Scope Repository Ini
Repository ini hanya berisi endpoint yang ada di halaman https://www.bayar.gg/api-docs.
Yang termasuk:
- Payment API.
- Account API.
- Digital Products API.
- QRIS Converter API.
- WhatsApp Store API.
- Integration guide untuk OVO, QRIS BAYAR GG, BRI Merchant QRIS, GoPay Merchant QRIS, Livin Merchant QRIS.
- Webhook callback reference.
Fitur API Premium di API Docs
| Fitur | Keterangan |
| QRIS BAYAR GG | QRIS dinamis per merchant dengan mID sendiri, webhook otomatis, dan settlement provider |
| BRI Merchant QRIS | Hubungkan QRIS BRI merchant sendiri, dana langsung ke rekening BRI |
| GoPay Merchant QRIS | Hubungkan akun GoPay Merchant via OTP, cocok untuk QRIS merchant GoPay |
| Livin Merchant QRIS | Hubungkan akun Livin' Merchant (Bank Mandiri), dana langsung ke rekening settlement Mandiri |
| OVO Direct Payment | Integrasi OVO untuk auto-matching mutasi pembayaran |
| QRIS Converter | Convert QRIS statis menjadi QRIS dinamis dengan nominal |
| Webhook Callback | Callback otomatis untuk integrasi backend website Anda |
Quick Start
PHP
cd examples/php
BAYAR_GG_API_KEY="YOUR_API_KEY_HERE" php example.php
Python
cd examples/python
python3 -m pip install -r requirements.txt
BAYAR_GG_API_KEY="YOUR_API_KEY_HERE" python3 example.py
Node.js
cd examples/nodejs
npm install
BAYAR_GG_API_KEY="YOUR_API_KEY_HERE" node example.mjs
Authentication
Semua endpoint API memakai header:
X-API-Key: YOUR_API_KEY_HERE
Accept: application/json
Payment Method
Metode yang umum dipakai:
qrisqris_bayar_ggqris_userqris_livingopay_qrisovo
Links
- API Docs:
https://www.bayar.gg/api-docs - Production API:
https://www.bayar.gg/api - Dashboard:
https://www.bayar.gg/dashboard