BAYAR GG
API Docs Website
Contoh Integrasi

bayar-gg-api-integrations

Contoh integrasi endpoint API Docs BAYAR GG untuk PHP, Python, dan Node.js

branch main update 2026-06-10 PHP · Python · Node.js
main 25 file & folder
Root
.env.example
Environment variables example
.gitignore
Git ignore rules
README.md
Project overview and quick start
docs/
docs
API endpoint reference, tutorial, and webhooks
docs/api-docs-endpoints.md
Endpoint list from BAYAR GG API Docs
docs/endpoints.json
Machine-readable endpoint list
docs/tutorial-lengkap.md
Full integration tutorial
docs/webhooks.md
Webhook callback reference
examples/
examples/cli
CLI examples for PHP, Python, Node.js
examples/cli/bayar-gg-cli.mjs
Node.js CLI client
examples/cli/bayar-gg-cli.php
PHP CLI client
examples/cli/bayar_gg_cli.py
Python CLI client
examples/nodejs
Node.js API client and sample
examples/nodejs/bayar-gg-client.mjs
Node.js client class
examples/nodejs/example.mjs
Node.js usage example
examples/php
PHP API client and sample
examples/php/BayarGgClient.php
PHP client class
examples/php/example.php
PHP usage example
examples/python
Python API client and sample
examples/python/bayar_gg_client.py
Python client class
examples/python/example.py
Python usage example
examples/web
Web demo examples
examples/web/php/index.php
PHP web checkout demo
examples/web/python/app.py
Python Flask web demo
examples/web/nodejs/server.mjs
Node.js Express web demo
Panduan Integrasi ZIP

Mulai Integrasi BAYAR GG API

Ikuti langkah cepat berikut untuk membuat payment link pertama, mengecek status pembayaran, dan menerima webhook callback.

  1. Ambil API Key
    Login ke dashboard BAYAR GG, buka menu Settings/API, lalu salin API key Anda.
  2. Set environment variable
    Jangan hardcode API key di source code. Simpan di environment.
  3. Buat payment link
    Panggil endpoint POST /api/create-payment.php, lalu redirect customer ke payment_url.
  4. Terima callback
    Pasang callback_url dan 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

EndpointFungsi
POST /api/create-payment.phpBuat payment link baru
GET /api/check-payment.php?invoice=...Cek status invoice
GET /api/get-payment-methods.phpDaftar metode bayar yang tersedia
POST callback_urlWebhook saat pembayaran sukses
README.md

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

FiturKeterangan
QRIS BAYAR GGQRIS dinamis per merchant dengan mID sendiri, webhook otomatis, dan settlement provider
BRI Merchant QRISHubungkan QRIS BRI merchant sendiri, dana langsung ke rekening BRI
GoPay Merchant QRISHubungkan akun GoPay Merchant via OTP, cocok untuk QRIS merchant GoPay
Livin Merchant QRISHubungkan akun Livin' Merchant (Bank Mandiri), dana langsung ke rekening settlement Mandiri
OVO Direct PaymentIntegrasi OVO untuk auto-matching mutasi pembayaran
QRIS ConverterConvert QRIS statis menjadi QRIS dinamis dengan nominal
Webhook CallbackCallback 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:

  • qris
  • qris_bayar_gg
  • qris_user
  • qris_livin
  • gopay_qris
  • ovo

Links

  • API Docs: https://www.bayar.gg/api-docs
  • Production API: https://www.bayar.gg/api
  • Dashboard: https://www.bayar.gg/dashboard