BAYAR GG Docs

API Documentation

Dokumentasi REST API BAYAR GG — integrasi QRIS Admin, QRIS BAYAR GG, BRI/GoPay/Livin Merchant QRIS, OVO, dan multi e-wallet.

Contoh client PHP, Python, dan Node.js siap pakai
Quick start: create payment, cek status, webhook callback
Referensi endpoint & panduan verifikasi signature

API Key

Info: Login untuk melihat API Key Anda. Contoh di bawah menggunakan placeholder YOUR_API_KEY_HERE.
YOUR_API_KEY_HERE
Penting: Jangan bagikan API Key Anda kepada siapapun. API Key digunakan untuk mengautentikasi request ke API.

Base URL

Semua request API menggunakan base URL berikut:

https://www.bayar.gg/api

Authentication

Semua request API harus menyertakan API Key di header X-API-Key (query parameter ?apiKey= tidak lagi didukung).

X-API-Key: YOUR_API_KEY_HERE

Payment Endpoints

MethodEndpointDescription
POST/api/create-payment.phpMembuat pembayaran baru
GET/api/check-payment.phpCek status pembayaran
GET/api/list-payments.phpDaftar pembayaran dengan filter & pagination
POST /api/create-payment.php

Membuat invoice pembayaran baru. Gunakan field payment_url untuk mengarahkan pembeli ke halaman checkout.

Request Body

ParameterTypeRequiredDescription
amountnumberRequiredNominal yang harus dibayar pelanggan. Minimal Rp 1.000. Khusus qris admin, maksimal Rp 500.000.
descriptionstringOptionalCatatan transaksi yang tampil di invoice, misalnya Order #123 - Paket Premium.
customer_namestringOptionalNama pembeli. Dipakai untuk tampilan invoice dan data transaksi.
customer_emailstringOptionalEmail pembeli jika ingin disimpan di transaksi.
customer_phonestringOptionalNomor WhatsApp/HP pembeli jika ingin disimpan di transaksi.
callback_urlstringOptionalURL server Anda yang akan menerima notifikasi otomatis saat pembayaran berhasil.
redirect_urlstringOptionalHalaman tujuan setelah pembayaran sukses, misalnya halaman terima kasih atau detail order.
payment_urlstringRequiredCheckout URL yang ingin dipakai untuk transaksi ini. Wajib string HTTPS. Gunakan default https://www.bayar.gg/pay atau salah satu Checkout URL aktif di menu Developer - Checkout URL.
file_idnumberOptionalID file digital yang akan bisa diunduh setelah pembayaran sukses.
content_idnumberOptionalID konten rahasia yang akan terbuka setelah pembayaran sukses.
product_image_idnumberOptionalID gambar produk yang ditampilkan di halaman pembayaran.
payment_methodstringOptionalMetode bayar yang dipakai. Jika kosong, sistem memilih metode pertama yang tersedia di akun Anda.
use_qris_converterbooleanOptionalUbah QRIS statis BRI/GoPay/Livin menjadi QRIS nominal otomatis. Tidak berlaku untuk qris dan qris_bayar_gg.
Payment Method:
  • qris — QRIS (default, maks. Rp 500.000)
  • qris_bayar_gg — QRIS BAYAR GG per-merchant (wajib Premium aktif + approval admin + mID sudah di-assign + API key provider tersedia). Limit nominal mengikuti limit mID yang diatur admin.
  • qris_user — BRI QRIS (memerlukan langganan aktif + konfigurasi BRI, tanpa limit)
  • qris_livin — Livin Merchant QRIS / Bank Mandiri (memerlukan langganan aktif + akun Livin Merchant terhubung, tanpa limit)
  • gopay_qris — GoPay QRIS (memerlukan langganan aktif + akun GoPay Merchant terhubung via OTP, tanpa limit) Recommended
  • ovo — OVO (memerlukan langganan aktif + akun OVO terhubung)
QRIS Converter:

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 QRIS
  • qris_user → dari BRI QRIS
  • qris_livin → dari QRIS Livin Merchant (Bank Mandiri) Anda
  • qris dan qris_bayar_gg → tidak memakai converter; QRIS dinamis dibuat provider InterActive QRIS dengan nominal tertanam
  • Sistem mengambil data QRIS dari akun yang terhubung saat converter aktif
  • Konversi nominal dilakukan otomatis di halaman pembayaran
  • Response: qris_converter: true
Batasan Nominal QRIS Admin:

Batas nominal Rp 500.000 hanya berlaku untuk metode qris (QRIS Admin). Tidak berlaku untuk Livin Merchant (qris_livin), BRI Merchant QRIS, GoPay Merchant QRIS, QRIS BAYAR GG, maupun OVO.

Untuk nominal di atas Rp 500.000, gunakan qris_bayar_gg, qris_user, gopay_qris, atau qris_livin sesuai akses dan koneksi akun Anda. QRIS BAYAR GG mengikuti limit mID yang ditetapkan admin.

Catatan: Gunakan endpoint /api/get-payment-methods untuk mengecek ketersediaan, syarat Premium, grant QRIS BAYAR GG, dan limit nominal per metode.

Custom Checkout URL

payment_url response mengikuti Checkout URL aktif. Request create payment wajib mengirim payment_url string yang sudah dikonfigurasi.

Checkout URL Halaman tempat pembeli membuka checkout, misalnya https://pay.domainanda.com.
pay.js Script yang dipasang di halaman merchant. Tidak perlu membuat iframe atau container manual.
Validasi ketat URL akses dan checkout key harus cocok dengan setting merchant dan owner invoice.
1Simpan URL di menu Checkout URL.
2Pasang script pay.js di halaman itu.
3Buat transaksi lewat /api/create-payment.php dengan payment_url yang sama dengan salah satu URL aktif.
4Arahkan pembeli ke field payment_url.
Setting Checkout URLResponse payment_urlCatatan
https://pay.domainanda.com https://pay.domainanda.com/?invoice=BAYAR-... Cocok jika memakai subdomain khusus checkout.
https://domainanda.com/file.html https://domainanda.com/file.html?invoice=BAYAR-... File/path harus benar-benar sama dengan setting.
https://domainanda.com/file.js https://domainanda.com/file.js?invoice=BAYAR-... Bisa memakai file/route sesuai halaman checkout Anda.
https://domainanda.com/file.ts https://domainanda.com/file.ts?invoice=BAYAR-... Bisa dipakai jika route server Anda memang melayani path tersebut.
https://domainanda.com/pay https://domainanda.com/pay?invoice=BAYAR-... Bisa memakai route tanpa ekstensi file.
https://domainanda.com/file.php https://domainanda.com/file.php?invoice=BAYAR-... Cocok untuk halaman checkout berbasis PHP.
Default BAYAR GG https://www.bayar.gg/pay?invoice=BAYAR-... Dipakai saat Checkout URL dikosongkan.

Isi halaman checkout di domain Anda cukup memasang script berikut. Script otomatis membaca ?invoice=..., membuat tampilan checkout, memvalidasi checkout public key, dan mengirim redirect ke halaman parent setelah pembayaran selesai.

<script src="https://www.bayar.gg/api/pay.js?checkout_key=YOUR_CHECKOUT_PUBLIC_KEY_HERE"></script>
Penting:
  • Checkout URL berbeda dengan redirect_url. Checkout URL adalah halaman bayar; redirect_url adalah halaman tujuan setelah pembayaran sukses.
  • callback_url adalah webhook server-to-server. Browser pembeli tidak diarahkan ke callback_url.
  • payment_url pada request wajib dikirim sebagai string. Gunakan default BAYAR GG atau URL custom yang statusnya ON. URL custom yang OFF akan ditolak.
  • Jangan simpan URL dengan ?invoice=. Invoice ditambahkan otomatis oleh sistem.

Code Examples

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_url": "https://www.bayar.gg/pay",
    "payment_method": "qris_bayar_gg"
  }'
$response = file_get_contents('https://www.bayar.gg/api/create-payment.php', false,
    stream_context_create([
        'http' => [
            'method' => 'POST',
            'header' => "Content-Type: application/json\r\nX-API-Key: YOUR_API_KEY_HERE",
            'content' => json_encode([
                'amount' => 50000,
                'description' => 'Pembayaran Produk A',
                'payment_url' => 'https://www.bayar.gg/pay',
                'payment_method' => 'qris_bayar_gg'
            ])
        ]
    ])
);
$data = json_decode($response, true);
const res = await fetch('https://www.bayar.gg/api/create-payment.php', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        'X-API-Key': 'YOUR_API_KEY_HERE'
    },
    body: JSON.stringify({
        amount: 50000,
        description: 'Pembayaran Produk A',
        payment_url: 'https://www.bayar.gg/pay',
        payment_method: 'qris_bayar_gg'
    })
});
const data = await res.json();
import requests

response = requests.post(
    'https://www.bayar.gg/api/create-payment.php',
    headers={'X-API-Key': 'YOUR_API_KEY_HERE'},
    json={
        'amount': 50000,
        'description': 'Pembayaran Produk A',
        'payment_url': 'https://www.bayar.gg/pay',
        'payment_method': 'qris_bayar_gg'
    }
)
data = response.json()

Response Fields

FieldDescription
invoice_idKode invoice unik untuk transaksi ini.
payment_urlURL checkout yang harus dibuka pembeli. Jika Anda menyimpan Custom Checkout URL, domain/path di field ini otomatis memakai URL tersebut.
qris_stringPayload QRIS untuk transaksi ini jika metode pembayaran memakai QRIS. Untuk metode non-QRIS nilainya string kosong.
statusStatus awal transaksi. Biasanya pending sampai pembayaran diterima.
final_amountTotal nominal yang harus dibayar pelanggan setelah kode unik atau biaya lain dihitung.
Example Response
{
  "success": true,
  "data": {
    "invoice_id": "BAYAR-1778029840-86EFB7",
    "amount": 50000,
    "payment_url": "https://www.bayar.gg/pay?invoice=BAYAR-1778029840-86EFB7",
    "qris_string": "00020101021226670016COM.NOBUBANK.WWW011893600503000008791402145202090520303UMI51440014ID.CO.QRIS.WWW0215ID20243672986600303UMI5204549953033605405500005802ID5920BAYAR GG6007JAKARTA6105123456304ABCD",
    "expires_at": "2026-04-16 12:30:00",
    "status": "pending",
    "payment_method": "qris_bayar_gg",
    "payment_method_label": "QRIS BAYAR GG",
    "unique_code": 0,
    "final_amount": 50000
  }
}
GET /api/check-payment.php

Mengecek status pembayaran berdasarkan Invoice ID.

Query Parameters

ParameterTypeRequiredDescription
invoicestringRequiredInvoice ID pembayaran
tokenstringConditionalToken polling dari halaman /pay (HMAC invoice). Merchant: gunakan header X-API-Key milik owner invoice.

Code Examples

curl -X GET "https://www.bayar.gg/api/check-payment.php?invoice=PAY-admin-1234567890-ABC123" \
  -H "X-API-Key: YOUR_API_KEY_HERE"
$invoice = 'PAY-admin-1234567890-ABC123';
$response = file_get_contents(
    'https://www.bayar.gg/api/check-payment.php?invoice=' . urlencode($invoice),
    false,
    stream_context_create([
        'http' => ['header' => "X-API-Key: YOUR_API_KEY_HERE"]
    ])
);
$data = json_decode($response, true);
const invoice = 'PAY-admin-1234567890-ABC123';
const res = await fetch(
    `https://www.bayar.gg/api/check-payment.php?invoice=${invoice}`,
    { headers: { 'X-API-Key': 'YOUR_API_KEY_HERE' } }
);
const data = await res.json();
import requests

response = requests.get(
    'https://www.bayar.gg/api/check-payment.php',
    headers={'X-API-Key': 'YOUR_API_KEY_HERE'},
    params={'invoice': 'PAY-admin-1234567890-ABC123'}
)
data = response.json()
Example Response
{
  "success": true,
  "invoice_id": "PAY-admin-1234567890-ABC123",
  "status": "paid",
  "amount": 50000,
  "final_amount": 50347,
  "payment_method": "gopay_qris",
  "paid_at": "2026-04-16 12:25:30",
  "paid_reff_num": "TRX123456789",
  "expires_at": "2026-04-16 12:30:00"
}
GET /api/list-payments.php

Mendapatkan daftar pembayaran dengan filter, search, dan pagination.

Query Parameters

ParameterTypeRequiredDescription
searchstringOptionalCari berdasarkan invoice, deskripsi, nama/email/HP pelanggan New
statusstringOptionalFilter by status: pending, paid, expired, cancelled
payment_methodstringOptionalFilter by method: qris, qris_bayar_gg, qris_user, gopay_qris, ovo New
paid_viastringOptionalFilter pembayaran sukses by method: qris, qris_user, gopay_qris, ovo New
start_datestringOptionalFilter dari tanggal (YYYY-MM-DD)
end_datestringOptionalFilter sampai tanggal (YYYY-MM-DD)
pagenumberOptionalHalaman (default: 1)
limitnumberOptionalJumlah per halaman (default: 20, max: 100)

Code Examples

curl -X GET "https://www.bayar.gg/api/list-payments.php?status=paid&page=1&limit=10" \
  -H "X-API-Key: YOUR_API_KEY_HERE"
$response = file_get_contents(
    'https://www.bayar.gg/api/list-payments.php?status=paid&page=1&limit=10',
    false,
    stream_context_create([
        'http' => ['header' => "X-API-Key: YOUR_API_KEY_HERE"]
    ])
);
$data = json_decode($response, true);
const res = await fetch(
    'https://www.bayar.gg/api/list-payments.php?status=paid&page=1&limit=10',
    { headers: { 'X-API-Key': 'YOUR_API_KEY_HERE' } }
);
const data = await res.json();
import requests

response = requests.get(
    'https://www.bayar.gg/api/list-payments.php',
    headers={'X-API-Key': 'YOUR_API_KEY_HERE'},
    params={'status': 'paid', 'page': 1, 'limit': 10}
)
data = response.json()
Example Response
{
  "success": true,
  "data": [
    {
      "invoice_id": "PAY-admin-1234567890-ABC123",
      "amount": 50000,
      "final_amount": 50347,
      "status": "paid",
      "payment_method": "gopay_qris",
      "paid_at": "2026-04-16 12:25:30",
      "created_at": "2026-04-16 12:20:00"
    }
  ],
  "pagination": { "page": 1, "limit": 10, "total": 42, "total_pages": 5 }
}

Account Endpoints

MethodEndpointDescription
GET/api/get-payment-methods.phpDaftar metode pembayaran & ketersediaan
GET/api/get-account-status.phpStatus akun & integrasi
GET/api/get-statistics.phpStatistik pembayaran
GET /api/get-payment-methods.php

Mendapatkan daftar metode pembayaran dan status ketersediaan. Response menyertakan user_status.has_active_subscription, grant QRIS BAYAR GG, dan status koneksi metode pembayaran.

Code Examples

curl -X GET "https://www.bayar.gg/api/get-payment-methods.php" \
  -H "X-API-Key: YOUR_API_KEY_HERE"
$response = file_get_contents(
    'https://www.bayar.gg/api/get-payment-methods.php',
    false,
    stream_context_create([
        'http' => ['header' => "X-API-Key: YOUR_API_KEY_HERE"]
    ])
);
$data = json_decode($response, true);
const res = await fetch(
    'https://www.bayar.gg/api/get-payment-methods.php',
    { headers: { 'X-API-Key': 'YOUR_API_KEY_HERE' } }
);
const data = await res.json();
import requests

response = requests.get(
    'https://www.bayar.gg/api/get-payment-methods.php',
    headers={'X-API-Key': 'YOUR_API_KEY_HERE'}
)
data = response.json()
Example Response
{
  "success": true,
  "data": {
    "payment_methods": [
      {
        "id": "qris",
        "name": "QRIS",
        "description": "Pembayaran via QRIS (Admin)",
        "enabled": true,
        "available": true,
        "requirements": []
      },
      {
        "id": "qris_bayar_gg",
        "name": "QRIS BAYAR GG",
        "description": "Pembayaran via QRIS BAYAR GG (per-user mID di-assign admin)",
        "enabled": true,
        "available": true,
        "subscription_required": true,
        "has_grant": true,
        "has_mid": true,
        "max_amount": 500000,
        "requirements": []
      },
      {
        "id": "gopay_qris",
        "name": "GoPay QRIS",
        "available": false,
        "requirements": ["GoPay Merchant harus terhubung"]
      }
    ],
    "user_status": {
      "has_active_subscription": true,
      "has_qris_bayar_gg_grant": true,
      "has_gopay_connected": false
    },
    "feature_status": {
      "qris": true,
      "qris_bayar_gg": true,
      "qris_user": true,
      "ovo": true,
      "gopay_qris": true
    }
  }
}
GET /api/get-account-status.php

Mendapatkan status akun, integrasi, dan ringkasan statistik.

Code Examples

curl -X GET "https://www.bayar.gg/api/get-account-status.php" \
  -H "X-API-Key: YOUR_API_KEY_HERE"
$response = file_get_contents(
    'https://www.bayar.gg/api/get-account-status.php',
    false,
    stream_context_create([
        'http' => ['header' => "X-API-Key: YOUR_API_KEY_HERE"]
    ])
);
$data = json_decode($response, true);
const res = await fetch(
    'https://www.bayar.gg/api/get-account-status.php',
    { headers: { 'X-API-Key': 'YOUR_API_KEY_HERE' } }
);
const data = await res.json();
import requests

response = requests.get(
    'https://www.bayar.gg/api/get-account-status.php',
    headers={'X-API-Key': 'YOUR_API_KEY_HERE'}
)
data = response.json()
Example Response
{
  "success": true,
  "account": {
    "username": "admin",
    "email": "admin@bayar.gg",
    "is_verified": true
  },
  "integrations": {"gopay": true, "bri": false, "ovo": false}
}
GET /api/get-statistics.php

Mendapatkan statistik pembayaran detail dengan breakdown per metode.

Query Parameters

ParameterTypeRequiredDescription
periodstringOptionalPeriode statistik: all, today, week, month, year (default: all)

Code Examples

curl -X GET "https://www.bayar.gg/api/get-statistics.php?period=month" \
  -H "X-API-Key: YOUR_API_KEY_HERE"
$response = file_get_contents(
    'https://www.bayar.gg/api/get-statistics.php?period=month',
    false,
    stream_context_create([
        'http' => ['header' => "X-API-Key: YOUR_API_KEY_HERE"]
    ])
);
$data = json_decode($response, true);
const res = await fetch(
    'https://www.bayar.gg/api/get-statistics.php?period=month',
    { headers: { 'X-API-Key': 'YOUR_API_KEY_HERE' } }
);
const data = await res.json();
import requests

response = requests.get(
    'https://www.bayar.gg/api/get-statistics.php',
    headers={'X-API-Key': 'YOUR_API_KEY_HERE'},
    params={'period': 'month'}
)
data = response.json()
Example Response
{
  "success": true,
  "period": "month",
  "total_transactions": 150,
  "total_amount": 7500000,
  "total_paid": 120,
  "breakdown": {"qris": 80, "gopay_qris": 30, "ovo": 10}
}

Digital Products Endpoints

MethodEndpointDescription
GET/api/list-files.phpDaftar file digital
GET/api/list-contents.phpDaftar hidden content
GET/api/list-images.phpDaftar foto produk
GET /api/list-files.php

Mendapatkan daftar file digital yang sudah diupload.

Query Parameters

ParameterTypeRequiredDescription
active_onlybooleanOptionalHanya file aktif (default: true)

Code Examples

curl -X GET "https://www.bayar.gg/api/list-files.php?active_only=true" \
  -H "X-API-Key: YOUR_API_KEY_HERE"
$response = file_get_contents(
    'https://www.bayar.gg/api/list-files.php?active_only=true',
    false,
    stream_context_create([
        'http' => ['header' => "X-API-Key: YOUR_API_KEY_HERE"]
    ])
);
$data = json_decode($response, true);
const res = await fetch(
    'https://www.bayar.gg/api/list-files.php?active_only=true',
    { headers: { 'X-API-Key': 'YOUR_API_KEY_HERE' } }
);
const data = await res.json();
import requests

response = requests.get(
    'https://www.bayar.gg/api/list-files.php',
    headers={'X-API-Key': 'YOUR_API_KEY_HERE'},
    params={'active_only': 'true'}
)
data = response.json()
Example Response
{
  "success": true,
  "data": [
    {"id": 1, "filename": "ebook.pdf", "size": 2048576, "active": true}
  ]
}
GET /api/list-contents.php

Mendapatkan daftar hidden content yang sudah dibuat.

Query Parameters

ParameterTypeRequiredDescription
active_onlybooleanOptionalHanya konten aktif (default: true)

Code Examples

curl -X GET "https://www.bayar.gg/api/list-contents.php?active_only=true" \
  -H "X-API-Key: YOUR_API_KEY_HERE"
$response = file_get_contents(
    'https://www.bayar.gg/api/list-contents.php?active_only=true',
    false,
    stream_context_create([
        'http' => ['header' => "X-API-Key: YOUR_API_KEY_HERE"]
    ])
);
$data = json_decode($response, true);
const res = await fetch(
    'https://www.bayar.gg/api/list-contents.php?active_only=true',
    { headers: { 'X-API-Key': 'YOUR_API_KEY_HERE' } }
);
const data = await res.json();
import requests

response = requests.get(
    'https://www.bayar.gg/api/list-contents.php',
    headers={'X-API-Key': 'YOUR_API_KEY_HERE'},
    params={'active_only': 'true'}
)
data = response.json()
Example Response
{
  "success": true,
  "data": [
    {"id": 1, "title": "License Key", "type": "text", "active": true}
  ]
}
GET /api/list-images.php

Mendapatkan daftar foto produk yang sudah diupload.

Query Parameters

ParameterTypeRequiredDescription
active_onlybooleanOptionalHanya gambar aktif (default: true)

Code Examples

curl -X GET "https://www.bayar.gg/api/list-images.php?active_only=true" \
  -H "X-API-Key: YOUR_API_KEY_HERE"
$response = file_get_contents(
    'https://www.bayar.gg/api/list-images.php?active_only=true',
    false,
    stream_context_create([
        'http' => ['header' => "X-API-Key: YOUR_API_KEY_HERE"]
    ])
);
$data = json_decode($response, true);
const res = await fetch(
    'https://www.bayar.gg/api/list-images.php?active_only=true',
    { headers: { 'X-API-Key': 'YOUR_API_KEY_HERE' } }
);
const data = await res.json();
import requests

response = requests.get(
    'https://www.bayar.gg/api/list-images.php',
    headers={'X-API-Key': 'YOUR_API_KEY_HERE'},
    params={'active_only': 'true'}
)
data = response.json()
Example Response
{
  "success": true,
  "data": [
    {"id": 1, "filename": "product.jpg", "url": "https://...", "active": true}
  ]
}

QRIS Converter Endpoints

MethodEndpointDescription
POST/api/qris-convert.phpKonversi QRIS statis → dinamis dengan nominal
GET POST/api/qris-info.phpInfo & validasi QRIS
POST /api/qris-convert.php

Mengkonversi QRIS statis ke QRIS dinamis dengan nominal tertanam. Support input text QRIS atau gambar QRIS.

Request Body (JSON)

ParameterTypeRequiredDescription
nominalnumberRequiredNominal yang akan ditanam di QRIS (dalam Rupiah)
qrisstringPilih salah satuString QRIS yang akan dikonversi
imagestringPilih salah satuBase64 encoded gambar QR code
image_urlstringPilih salah satuURL gambar QR code

File Upload (Multipart Form Data)

FieldTypeDescription
nominalnumberNominal yang akan ditanam
imagefileFile gambar QR code (JPEG, PNG, GIF, WebP)
Tips: Gunakan qr_image_url untuk menampilkan QR code yang sudah dikonversi langsung di aplikasi Anda.

Code Examples

curl -X POST https://www.bayar.gg/api/qris-convert.php \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY_HERE" \
  -d '{
    "qris": "00020101021126...",
    "nominal": 50000
  }'
$response = file_get_contents('https://www.bayar.gg/api/qris-convert.php', false,
    stream_context_create([
        'http' => [
            'method' => 'POST',
            'header' => "Content-Type: application/json\r\nX-API-Key: YOUR_API_KEY_HERE",
            'content' => json_encode([
                'qris' => '00020101021126...',
                'nominal' => 50000
            ])
        ]
    ])
);
$data = json_decode($response, true);
const res = await fetch('https://www.bayar.gg/api/qris-convert.php', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        'X-API-Key': 'YOUR_API_KEY_HERE'
    },
    body: JSON.stringify({
        qris: '00020101021126...',
        nominal: 50000
    })
});
const data = await res.json();
import requests

response = requests.post(
    'https://www.bayar.gg/api/qris-convert.php',
    headers={'X-API-Key': 'YOUR_API_KEY_HERE'},
    json={
        'qris': '00020101021126...',
        'nominal': 50000
    }
)
data = response.json()
Example Response
{
  "success": true,
  "qris": "00020101021226...",
  "qr_image_url": "https://www.bayar.gg/qris-info/api/qr.php?data=...",
  "merchant_name": "GOPAY MERCHANT",
  "amount": 50000
}
GET POST /api/qris-info.php

Mendapatkan informasi dari QRIS tanpa mengkonversinya. Berguna untuk validasi dan preview.

Query Parameters (GET)

ParameterTypeRequiredDescription
qrisstringRequiredString QRIS untuk dianalisis
Use Case: Gunakan endpoint ini untuk validasi QRIS sebelum proses konversi, atau untuk menampilkan preview merchant info ke user.

Code Examples

curl -X GET "https://www.bayar.gg/api/qris-info.php?qris=00020101021126..." \
  -H "X-API-Key: YOUR_API_KEY_HERE"
$response = file_get_contents(
    'https://www.bayar.gg/api/qris-info.php?qris=00020101021126...',
    false,
    stream_context_create([
        'http' => ['header' => "X-API-Key: YOUR_API_KEY_HERE"]
    ])
);
$data = json_decode($response, true);
const res = await fetch(
    'https://www.bayar.gg/api/qris-info.php?qris=00020101021126...',
    { headers: { 'X-API-Key': 'YOUR_API_KEY_HERE' } }
);
const data = await res.json();
import requests

response = requests.get(
    'https://www.bayar.gg/api/qris-info.php',
    headers={'X-API-Key': 'YOUR_API_KEY_HERE'},
    params={'qris': '00020101021126...'}
)
data = response.json()
Example Response
{
  "success": true,
  "merchant_name": "GOPAY MERCHANT",
  "merchant_city": "JAKARTA",
  "amount": 0,
  "is_dynamic": false
}

WhatsApp Store API

MethodEndpointDescription
GET/api/wa-store-orders.phpDaftar pesanan WA Store
POST/api/wa-store-complete.phpUpdate status pesanan
GET /api/wa-store-orders.php

Ambil daftar pesanan WhatsApp Store atau detail pesanan tertentu. Mendukung pencarian berdasarkan nomor order, nama customer, atau nomor telepon.

Query Parameters

ParameterTipeRequiredKeterangan
order_numberstringOptionalAmbil detail satu pesanan (e.g. WA260329-A1B2)
statusstringOptionalFilter: pending, waiting_payment, paid, processing, completed, cancelled
searchstringOptionalCari berdasarkan nomor order, nama customer, nomor telepon, atau invoice ID
limitintegerOptionalMax 100, default 50
offsetintegerOptionalPagination offset

Code Examples

curl -X GET "https://www.bayar.gg/api/wa-store-orders.php?status=paid&limit=10" \
  -H "X-API-Key: YOUR_API_KEY_HERE"
$response = file_get_contents(
    'https://www.bayar.gg/api/wa-store-orders.php?status=paid&limit=10',
    false,
    stream_context_create([
        'http' => ['header' => "X-API-Key: YOUR_API_KEY_HERE"]
    ])
);
$data = json_decode($response, true);
const res = await fetch(
    'https://www.bayar.gg/api/wa-store-orders.php?status=paid&limit=10',
    { headers: { 'X-API-Key': 'YOUR_API_KEY_HERE' } }
);
const data = await res.json();
import requests

response = requests.get(
    'https://www.bayar.gg/api/wa-store-orders.php',
    headers={'X-API-Key': 'YOUR_API_KEY_HERE'},
    params={'status': 'paid', 'limit': 10}
)
data = response.json()
Example Response
{
  "success": true,
  "data": [
    {
      "order_number": "WA260329-A1B2",
      "customer_name": "Rahim",
      "status": "paid",
      "total": 75000
    }
  ],
  "total": 5
}
POST /api/wa-store-complete.php

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

ParameterTipeRequiredKeterangan
order_numberstringRequiredNomor order WA Store
statusstringOptionalcompleted, cancelled (default: completed)
notifybooleanOptionalKirim notifikasi WhatsApp ke customer (default: true)
Validasi: Status completed hanya bisa diset jika pesanan sudah berstatus paid atau processing. Pesanan completed tidak bisa di-cancel.

Code Examples

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
  }'
$response = file_get_contents('https://www.bayar.gg/api/wa-store-complete.php', false,
    stream_context_create([
        'http' => [
            'method' => 'POST',
            'header' => "Content-Type: application/json\r\nX-API-Key: YOUR_API_KEY_HERE",
            'content' => json_encode([
                'order_number' => 'WA260329-A1B2',
                'status' => 'completed',
                'notify' => true
            ])
        ]
    ])
);
$data = json_decode($response, true);
const res = await fetch('https://www.bayar.gg/api/wa-store-complete.php', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        'X-API-Key': 'YOUR_API_KEY_HERE'
    },
    body: JSON.stringify({
        order_number: 'WA260329-A1B2',
        status: 'completed',
        notify: true
    })
});
const data = await res.json();
import requests

response = requests.post(
    'https://www.bayar.gg/api/wa-store-complete.php',
    headers={'X-API-Key': 'YOUR_API_KEY_HERE'},
    json={
        'order_number': 'WA260329-A1B2',
        'status': 'completed',
        'notify': True
    }
)
data = response.json()
Example Response
{
  "success": true,
  "message": "Order completed successfully",
  "order": {
    "order_number": "WA260329-A1B2",
    "status": "completed"
  }
}

OVO Integration

Integrasi OVO memungkinkan Anda menerima pembayaran langsung ke akun OVO Anda dengan pencocokan nominal otomatis.

Langkah Setup

  1. Buka menu PengaturanHubungkan OVO
  2. Masukkan nomor OVO Anda dan verifikasi dengan kode OTP
  3. Masukkan PIN OVO untuk menyelesaikan koneksi
  4. Setelah terhubung, Anda dapat membuat pembayaran dengan metode OVO

Cara Kerja Pencocokan

StepProses
1Customer membayar ke nomor OVO Anda dengan nominal yang tepat (termasuk kode unik)
2Sistem mengecek mutasi OVO setiap beberapa detik
3Jika ditemukan transaksi masuk dengan nominal yang cocok, pembayaran otomatis dikonfirmasi
4Callback 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"
  }'
Penting: Pastikan customer mentransfer dengan nominal yang tepat termasuk kode unik agar pembayaran terdeteksi otomatis.

QRIS BAYAR GG Integration

QRIS BAYAR GG memungkinkan user memakai QRIS dinamis dengan mID merchant sendiri yang di-assign admin. Metode ini cocok untuk Payment Link, WhatsApp Store, Donasi, dan integrasi API yang membutuhkan QRIS per merchant dengan webhook otomatis.

Syarat Menggunakan QRIS BAYAR GG via API

Alur Integrasi

  1. User request akses QRIS BAYAR GG dari dashboard dan chat admin untuk approval production.
  2. Admin mengaktifkan akses, mengisi mID merchant, dan mengatur limit nominal per transaksi.
  3. Developer cek ketersediaan via GET /api/get-payment-methods.php.
  4. Buat invoice via POST /api/create-payment.php dengan payment_method: "qris_bayar_gg".
  5. Gunakan payment_url untuk membuka checkout hosted page. Payload QRIS diproses di halaman checkout BAYAR GG.
  6. Status paid diproses otomatis melalui webhook provider dan polling /api/check-payment.php.

Contoh Request dengan QRIS BAYAR GG

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": 75000,
    "description": "Pembayaran QRIS BAYAR GG",
    "customer_name": "Budi",
    "customer_phone": "6281234567890",
    "payment_method": "qris_bayar_gg",
    "payment_url": "https://www.bayar.gg/pay",
    "callback_url": "https://example.com/payment-webhook",
    "redirect_url": "https://example.com/thank-you"
  }'

Response QRIS BAYAR GG

{
  "success": true,
  "data": {
    "invoice_id": "BAYAR-1778029840-86EFB7",
    "amount": 75000,
    "final_amount": 75000,
    "unique_code": 0,
    "payment_method": "qris_bayar_gg",
    "payment_method_label": "QRIS BAYAR GG",
    "status": "pending",
    "payment_url": "https://www.bayar.gg/pay?invoice=BAYAR-1778029840-86EFB7",
    "qris_string": "00020101021226670016COM.NOBUBANK.WWW011893600503000008791402145202090520303UMI51440014ID.CO.QRIS.WWW0215ID20243672986600303UMI5204549953033605405750005802ID5920BAYAR GG6007JAKARTA6105123456304ABCD"
  }
}
Info: QRIS BAYAR GG tidak memakai kode unik. final_amount adalah nominal pembayaran ditambah profit/fee persen yang diatur user (jika ada). Detail QRIS diproses di halaman checkout dari field payment_url.
Penting: Tombol Mark as Paid QRIS BAYAR GG tidak tersedia di panel user. Jika terjadi kebutuhan koreksi manual, proses hanya dilakukan oleh admin untuk menjaga audit webhook dan settlement.

BRI Merchant QRIS Integration

BRI Merchant QRIS memungkinkan Anda menerima pembayaran langsung ke rekening BRI Anda sendiri dengan QRIS merchant Anda.

Keuntungan BRI Merchant QRIS

Langkah Setup

  1. Pastikan langganan Anda aktif (trial atau berbayar)
  2. Buka menu BRI QRIS Merchant di dashboard
  3. Masukkan kredensial BRI API Anda (Host, Username, Password, MID, TID)
  4. Test koneksi untuk memastikan API berfungsi
  5. Upload gambar QRIS merchant Anda
  6. 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"
  }'
Info: Pembayaran via BRI Merchant QRIS tidak menambah saldo yang bisa di-withdraw karena dana langsung masuk ke rekening Anda.
Penting: Pastikan kredensial BRI API valid dan gambar QRIS sudah diupload sebelum menggunakan metode ini.

GoPay Merchant QRIS Integration

GoPay Merchant QRIS memungkinkan Anda menerima pembayaran langsung ke akun GoPay Merchant Anda sendiri menggunakan QRIS.

Keuntungan GoPay Merchant QRIS

Langkah Setup

  1. Pastikan langganan Anda aktif (trial atau berbayar)
  2. Buka menu GoPay Merchant QRIS di dashboard
  3. Capture token dari GoPay Merchant App menggunakan HTTP Inspector
  4. Paste JSON token + device info di halaman koneksi
  5. Upload gambar QRIS GoPay Merchant Anda
  6. 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"
}
Info: Pembayaran via GoPay Merchant QRIS tidak menambah saldo yang bisa di-withdraw karena dana langsung masuk ke akun GoPay Merchant Anda.
Penting: Token GoPay Merchant memiliki masa berlaku terbatas. Pastikan token masih valid dan gambar QRIS sudah diupload sebelum menggunakan metode ini. Perbarui token secara berkala.

Livin Merchant QRIS Integration

Livin Merchant QRIS memungkinkan Anda menerima pembayaran QRIS langsung ke rekening settlement Bank Mandiri Anda menggunakan akun Livin' Merchant.

Keuntungan Livin Merchant QRIS

Cara Menghubungkan

  1. Buka menu Livin' Merchant di dashboard
  2. Masukkan nomor HP & password akun Livin' Merchant Anda, lalu pilih outlet (jika punya beberapa)
  3. Setelah terhubung, buat pembayaran dengan metode qris_livin

Contoh Request dengan Livin 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_livin"
  }'
Info: Pembayaran via Livin Merchant QRIS tidak menambah saldo yang bisa di-withdraw karena dana langsung masuk ke rekening settlement Mandiri Anda.
Penting: Pastikan akun Livin Merchant tetap terhubung agar pembayaran terdeteksi otomatis. Jika muncul "merchant tidak ditemukan" saat bayar, paste/upload QRIS asli Anda di halaman Livin' Merchant.

Webhook 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",
  "payment_method": "qris_bayar_gg",
  "amount": 50000,
  "final_amount": 50000,
  "unique_code": 0,
  "paid_at": "2024-01-15 12:25:30",
  "paid_amount": 50000,
  "paid_reff_num": "QRIS-BGG-36556065",
  "paid_via": "qris_bayar_gg",
  "iqris_payment_customername": "BUDI",
  "iqris_payment_methodby": "BCA",
  "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

HeaderDescription
Content-Typeapplication/json
X-Webhook-Eventpayment.paid
X-Webhook-SignatureHMAC SHA256 signature untuk verifikasi
X-Webhook-TimestampUnix timestamp saat callback dikirim
X-Invoice-IDInvoice 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'); // Developer → Webhook & Callback

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 menu Developer → Webhook & Callback:

SettingKeterangan
Default Callback URLURL default yang otomatis digunakan jika callback_url tidak disertakan saat create payment.
Webhook Secret KeySecret key unik per user (whsec_xxx) untuk memverifikasi signature callback. Bisa di-regenerate kapan saja.
Callback LogsRiwayat 20 callback terakhir beserta status HTTP response.
Penting: Signature menggunakan Webhook Secret Key Anda (bukan API Key). Dapatkan di menu Developer → Webhook & Callback.

Payment Status

StatusDescription
pendingMenunggu pembayaran
paidPembayaran berhasil
expiredPembayaran expired (melebihi batas waktu)
cancelledPembayaran dibatalkan

Error Codes

HTTP CodeDescription
200Success
400Bad Request — Parameter tidak valid
401Unauthorized — API Key tidak valid
404Not Found — Resource tidak ditemukan
405Method Not Allowed
429Too Many Requests — Rate limit exceeded
500Internal Server Error
BAYAR GG AI Agent Online 24/7

Percakapan telah diakhiri

Browser Cache