API Key
YOUR_API_KEY_HERE.
Base URL
Authentication
Semua request API harus menyertakan API Key di header:
X-API-Key: YOUR_API_KEY_HERE
Atau sebagai query parameter:
?apiKey=YOUR_API_KEY_HERE
Payment Endpoints
Membuat pembayaran baru dengan opsi produk digital, foto produk, dan redirect URL.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
amount |
number | Required | Nominal pembayaran (minimal Rp 1.000, maksimal Rp 500.000 untuk QRIS Admin) |
description |
string | Optional | Deskripsi pembayaran |
customer_name |
string | Optional | Nama pelanggan |
customer_email |
string | Optional | Email pelanggan |
customer_phone |
string | Optional | No. HP pelanggan |
callback_url |
string | Optional | URL webhook saat pembayaran sukses |
redirect_url |
string | Optional | URL redirect setelah pembayaran sukses New |
file_id |
number | Optional | ID file digital yang akan diberikan setelah bayar New |
content_id |
number | Optional | ID hidden content yang akan dibuka setelah bayar New |
product_image_id |
number | Optional | ID foto produk yang ditampilkan di halaman pembayaran New |
payment_method |
string | Optional | Metode pembayaran: qris, qris_user, gopay_qris, atau ovo (default: qris) |
use_qris_converter |
boolean | Optional | Aktifkan QRIS Converter untuk membuat QRIS dinamis dengan nominal tertanam (default: false). QRIS string otomatis diambil dari akun yang terhubung (GoPay Merchant / BRI QRIS) sesuai metode pembayaran. |
qris- QRIS (default, maks. Rp 500.000)qris_user- BRI QRIS (memerlukan langganan aktif + konfigurasi BRI, tanpa limit)gopay_qris- GoPay QRIS (memerlukan langganan aktif + akun GoPay Merchant terhubung via OTP, tanpa limit) Recommendedovo- OVO (memerlukan langganan aktif + akun OVO terhubung)
Aktifkan use_qris_converter: true untuk membuat QRIS dinamis dengan nominal tertanam otomatis.
- QRIS string otomatis diambil dari akun yang terhubung sesuai
payment_method gopay_qris→ dari GoPay QRISqris_user→ dari BRI QRISqris→ dari QRIS- Tidak perlu kirim
qris_stringsecara manual - Konversi nominal dilakukan otomatis di halaman pembayaran
- Response:
qris_converter: true
Untuk metode pembayaran qris maksimal nominal adalah Rp 500.000. Untuk nominal lebih besar, gunakan metode qris_user atau gopay_qris (GoPay Merchant QRIS — hubungkan via OTP, tanpa limit).
/api/get-payment-methods untuk mengecek ketersediaan dan user_status.has_active_subscription.
Mengecek status pembayaran berdasarkan Invoice ID.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
invoice |
string | Required | Invoice ID pembayaran |
Mendapatkan daftar pembayaran dengan filter, search, dan pagination.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
search |
string | Optional | Cari berdasarkan invoice, deskripsi, nama/email/HP pelanggan New |
status |
string | Optional | Filter by status: pending, paid, expired, cancelled |
payment_method |
string | Optional | Filter by method: qris, qris_user, gopay_qris, ovo New |
paid_via |
string | Optional | Filter pembayaran sukses by method: qris, qris_user, gopay_qris, ovo New |
start_date |
string | Optional | Filter dari tanggal (YYYY-MM-DD) |
end_date |
string | Optional | Filter sampai tanggal (YYYY-MM-DD) |
page |
number | Optional | Halaman (default: 1) |
limit |
number | Optional | Jumlah per halaman (default: 20, max: 100) |
Account & Status Endpoints New
Mendapatkan daftar metode pembayaran dan status ketersediaan. Response menyertakan user_status.has_active_subscription (langganan aktif diperlukan untuk create payment dan metode qris_user, gopay_qris, ovo).
Mendapatkan status akun, integrasi, dan ringkasan statistik.
Mendapatkan statistik pembayaran detail dengan breakdown per metode.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
period |
string | Optional | Periode statistik: all, today, week, month, year (default: all) |
Digital Products Endpoints
Mendapatkan daftar file digital yang sudah diupload.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
active_only |
boolean | Optional | Hanya file aktif (default: true) |
Mendapatkan daftar hidden content yang sudah dibuat.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
active_only |
boolean | Optional | Hanya konten aktif (default: true) |
Mendapatkan daftar foto produk yang sudah diupload.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
active_only |
boolean | Optional | Hanya gambar aktif (default: true) |
QRIS Converter Endpoints New
Mengkonversi QRIS statis ke QRIS dinamis dengan nominal tertanam. Support input text QRIS atau gambar QRIS.
Request Body (JSON)
| Parameter | Type | Required | Description |
|---|---|---|---|
nominal |
number | Required | Nominal yang akan ditanam di QRIS (dalam Rupiah) |
qris |
string | Pilih salah satu | String QRIS yang akan dikonversi |
image |
string | Pilih salah satu | Base64 encoded gambar QR code |
image_url |
string | Pilih salah satu | URL gambar QR code |
File Upload (Multipart Form Data)
| Field | Type | Description |
|---|---|---|
nominal |
number | Nominal yang akan ditanam |
image |
file | File gambar QR code (JPEG, PNG, GIF, WebP) |
qr_image_url untuk menampilkan QR code yang sudah dikonversi langsung di aplikasi Anda.
Mendapatkan informasi dari QRIS tanpa mengkonversinya. Berguna untuk validasi dan preview.
Query Parameters (GET)
| Parameter | Type | Required | Description |
|---|---|---|---|
qris |
string | Required | String QRIS untuk dianalisis |
WhatsApp Store API New
Ambil daftar pesanan WhatsApp Store atau detail pesanan tertentu. Mendukung pencarian berdasarkan nomor order, nama customer, atau nomor telepon.
Query Parameters
| Parameter | Tipe | Required | Keterangan |
|---|---|---|---|
order_number | string | Optional | Ambil detail satu pesanan (e.g. WA260329-A1B2) |
status | string | Optional | Filter: pending, waiting_payment, paid, processing, completed, cancelled |
search | string | Optional | Cari berdasarkan nomor order, nama customer, nomor telepon, atau invoice ID |
limit | integer | Optional | Max 100, default 50 |
offset | integer | Optional | Pagination offset |
Contoh Request
# Filter by status
curl -X GET "https://www.bayar.gg/api/wa-store-orders.php?status=paid&limit=10" \
-H "X-API-Key: YOUR_API_KEY_HERE"
# Search orders
curl -X GET "https://www.bayar.gg/api/wa-store-orders.php?search=Rahim" \
-H "X-API-Key: YOUR_API_KEY_HERE"
Update status pesanan WA Store (completed, cancelled). Pesanan hanya bisa diselesaikan (completed) jika sudah dibayar (status: paid/processing). Pesanan yang sudah selesai tidak bisa dibatalkan. Notifikasi WhatsApp otomatis dikirim ke customer.
Body Parameters
| Parameter | Tipe | Required | Keterangan |
|---|---|---|---|
order_number | string | Required | Nomor order WA Store |
status | string | Optional | completed, cancelled (default: completed) |
notify | boolean | Optional | Kirim notifikasi WhatsApp ke customer (default: true) |
completed hanya bisa diset jika pesanan sudah berstatus paid atau processing. Pesanan completed tidak bisa di-cancel.
Contoh Request
curl -X POST https://www.bayar.gg/api/wa-store-complete.php \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY_HERE" \
-d '{
"order_number": "WA260329-A1B2",
"status": "completed",
"notify": true
}'
OVO Integration New
Cara Kerja OVO Payment
Integrasi OVO memungkinkan Anda menerima pembayaran langsung ke akun OVO Anda dengan pencocokan nominal otomatis.
Langkah Setup
- Buka menu Pengaturan → Hubungkan OVO
- Masukkan nomor OVO Anda dan verifikasi dengan kode OTP
- Masukkan PIN OVO untuk menyelesaikan koneksi
- Setelah terhubung, Anda dapat membuat pembayaran dengan metode OVO
Cara Kerja Pencocokan
| Step | Proses |
|---|---|
| 1 | Customer membayar ke nomor OVO Anda dengan nominal yang tepat (termasuk kode unik) |
| 2 | Sistem mengecek mutasi OVO setiap beberapa detik |
| 3 | Jika ditemukan transaksi masuk dengan nominal yang cocok, pembayaran otomatis dikonfirmasi |
| 4 | Callback dikirim ke URL yang Anda tentukan |
Contoh Request dengan OVO
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": 50000,
"description": "Pembayaran Produk A",
"payment_method": "ovo"
}'
BRI Merchant QRIS Integration New
Cara Kerja BRI Merchant QRIS
BRI Merchant QRIS memungkinkan Anda menerima pembayaran langsung ke rekening BRI Anda sendiri dengan QRIS merchant Anda.
Keuntungan BRI Merchant QRIS
- Dana langsung ke rekening Anda - Tidak perlu proses withdrawal
- QRIS merchant Anda sendiri - Menggunakan credentials BRI API Anda
- Real-time detection - Pembayaran dideteksi otomatis via BRI API
Langkah Setup
- Pastikan langganan Anda aktif (trial atau berbayar)
- Buka menu BRI QRIS Merchant di dashboard
- Masukkan kredensial BRI API Anda (Host, Username, Password, MID, TID)
- Test koneksi untuk memastikan API berfungsi
- Upload gambar QRIS merchant Anda
- Setelah terhubung, Anda dapat membuat pembayaran dengan metode
qris_user
Contoh Request dengan BRI Merchant QRIS
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": 50000,
"description": "Pembayaran Produk A",
"payment_method": "qris_user"
}'
GoPay Merchant QRIS Integration New
Cara Kerja GoPay Merchant QRIS
GoPay Merchant QRIS memungkinkan Anda menerima pembayaran langsung ke akun GoPay Merchant Anda sendiri menggunakan QRIS.
Keuntungan GoPay Merchant QRIS
- Dana langsung ke GoPay Anda - Tidak perlu proses withdrawal
- QRIS GoPay Merchant - Menggunakan akun GoPay Merchant Anda sendiri
- Real-time detection - Pembayaran dideteksi otomatis via GoPay Merchant API
- Tanpa limit nominal - Tidak ada batasan Rp 500.000 seperti QRIS Admin
Langkah Setup
- Pastikan langganan Anda aktif (trial atau berbayar)
- Buka menu GoPay Merchant QRIS di dashboard
- Capture token dari GoPay Merchant App menggunakan HTTP Inspector
- Paste JSON token + device info di halaman koneksi
- Upload gambar QRIS GoPay Merchant Anda
- Setelah terhubung, buat pembayaran dengan metode
gopay_qris
Contoh Request dengan GoPay Merchant QRIS
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": 50000,
"description": "Pembayaran Produk A",
"payment_method": "gopay_qris"
}'
Response
{
"success": true,
"payment": {
"invoice_id": "PAY-admin-1234567890-ABC123",
"amount": 50000,
"unique_code": 347,
"final_amount": 50347,
"payment_method": "gopay_qris",
"status": "pending",
"expires_at": "2026-02-15 12:30:00"
},
"payment_url": "https://www.bayar.gg/pay?invoice=PAY-admin-1234567890-ABC123"
}
Webhook & Callback
Callback
Jika Anda menyertakan callback_url saat membuat pembayaran, sistem akan mengirim POST request ke URL tersebut saat pembayaran berhasil.
Callback Payload
{
"event": "payment.paid",
"invoice_id": "PAY-admin-1234567890-ABC123",
"status": "paid",
"amount": 50000,
"final_amount": 50123,
"unique_code": 123,
"paid_at": "2024-01-15 12:25:30",
"paid_amount": 50123,
"paid_reff_num": "TRX123456789",
"customer_name": "John Doe",
"customer_email": "john@example.com",
"customer_phone": "08123456789",
"description": "Pembayaran Produk A",
"redirect_url": "https://yoursite.com/thank-you",
"has_file": true,
"has_content": false,
"timestamp": 1705312530,
"signature": "sha256_hmac_signature"
}
Callback Headers
| Header | Description |
|---|---|
Content-Type |
application/json |
X-Webhook-Event |
payment.paid |
X-Webhook-Signature |
HMAC SHA256 signature untuk verifikasi |
X-Webhook-Timestamp |
Unix timestamp saat callback dikirim |
X-Invoice-ID |
Invoice ID pembayaran |
Verifikasi Signature
<?php
// Verifikasi callback signature
$payload = json_decode(file_get_contents('php://input'), true);
$signature = $_SERVER['HTTP_X_WEBHOOK_SIGNATURE'] ?? '';
$timestamp = $_SERVER['HTTP_X_WEBHOOK_TIMESTAMP'] ?? '';
// Buat signature untuk verifikasi
$signatureData = $payload['invoice_id'] . '|' . $payload['status'] . '|' . $payload['final_amount'] . '|' . $timestamp;
$expectedSignature = hash_hmac('sha256', $signatureData, 'YOUR_WEBHOOK_SECRET'); // Pengaturan → Webhook
if (hash_equals($expectedSignature, $signature)) {
// Signature valid, proses callback
if ($payload['status'] === 'paid') {
// Update order status
http_response_code(200);
echo json_encode(['success' => true]);
}
} else {
// Signature tidak valid
http_response_code(401);
echo json_encode(['error' => 'Invalid signature']);
}
?>
Webhook Settings
Konfigurasi webhook tersedia di Pengaturan → Webhook:
| Setting | Keterangan |
|---|---|
Default Callback URL |
URL default yang otomatis digunakan jika callback_url tidak disertakan saat create payment. |
Webhook Secret Key |
Secret key unik per user (whsec_xxx) untuk memverifikasi signature callback. Bisa di-regenerate kapan saja. |
Callback Logs |
Riwayat 20 callback terakhir beserta status HTTP response. |
Webhook Secret Key Anda (bukan API Key). Dapatkan di Pengaturan → Webhook.
Telegram Notifications & 2FA
BAYAR GG mendukung notifikasi real-time dan verifikasi 2 langkah melalui Telegram Bot.
Fitur Telegram
| Fitur | Keterangan |
|---|---|
| Notifikasi Login | Terima pemberitahuan setiap kali ada login ke akun Anda (password, Facebook, 2FA). Termasuk info IP dan metode login. |
| Notifikasi Pembayaran | Terima pemberitahuan real-time saat pembayaran berhasil (invoice, nominal, waktu). |
| Verifikasi 2 Langkah (2FA) | OTP 6 digit dikirim ke Telegram setiap login. Berlaku 5 menit, max 5x percobaan. |
| Reset Password OTP | Kode OTP untuk reset password dikirim via Telegram Bot (bukan SMS/WhatsApp). |
Cara Menghubungkan
- Buka Pengaturan → Telegram
- Klik Hubungkan Telegram
- Klik link yang muncul, lalu tekan START di Telegram
- Aktifkan Notifikasi dan/atau 2FA
Login dengan Facebook
Pengguna dapat mendaftar dan login menggunakan akun Facebook.
Ketentuan
- Akun Facebook akan di-link berdasarkan
facebook_idatau email yang cocok. - Jika username sudah terpakai, sistem otomatis menambah 3 karakter random.
- Akun Facebook tidak memiliki password — menu ubah password disembunyikan.
- Wajib mengisi nomor HP setelah login pertama kali.
- Jika 2FA aktif, OTP tetap diminta via Telegram sebelum masuk dashboard.
Payment Status
| Status | Description |
|---|---|
| pending | Menunggu pembayaran |
| paid | Pembayaran berhasil |
| expired | Pembayaran expired (melebihi batas waktu) |
| cancelled | Pembayaran dibatalkan |
Error Codes
| HTTP Code | Description |
|---|---|
200 |
Success |
400 |
Bad Request - Parameter tidak valid |
401 |
Unauthorized - API Key tidak valid |
404 |
Not Found - Resource tidak ditemukan |
405 |
Method Not Allowed |
429 |
Too Many Requests - Rate limit exceeded |
500 |
Internal Server Error |