### List Files Response Example Source: https://www.bayar.gg/api-docs Example JSON response structure for the list files endpoint. ```json { "success": true, "data": [ {"id": 1, "filename": "ebook.pdf", "size": 2048576, "active": true} ] } ``` -------------------------------- ### Example Response for Create Payment Source: https://www.bayar.gg/api-docs This is an example response when creating a payment. It includes payment details and a URL to complete the payment. ```JSON { "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-04-16 12:30:00" }, "payment_url": "https://www.bayar.gg/pay?invoice=PAY-admin-1234567890-ABC123" } ``` -------------------------------- ### List Images Response Example Source: https://www.bayar.gg/api-docs Example JSON response structure for the list images endpoint. ```json { "success": true, "data": [ {"id": 1, "filename": "product.jpg", "url": "https://...", "active": true} ] } ``` -------------------------------- ### Example Response for QRIS Info Source: https://www.bayar.gg/api-docs This is an example of the JSON response received when querying QRIS information. ```json { "success": true, "merchant_name": "GOPAY MERCHANT", "merchant_city": "JAKARTA", "amount": 0, "is_dynamic": false } ``` -------------------------------- ### Example Response for QRIS Conversion Source: https://www.bayar.gg/api-docs This is an example of the JSON response received after successfully converting a static QRIS to a dynamic QRIS. ```json { "success": true, "qris": "00020101021226...", "qr_image_url": "https://www.bayar.gg/qris-info/api/qr.php?data=...", "merchant_name": "GOPAY MERCHANT", "amount": 50000 } ``` -------------------------------- ### List Contents Response Example Source: https://www.bayar.gg/api-docs Example JSON response structure for the list contents endpoint. ```json { "success": true, "data": [ {"id": 1, "title": "License Key", "type": "text", "active": true} ] } ``` -------------------------------- ### Example Response for Check Payment Source: https://www.bayar.gg/api-docs This is an example response when checking a payment's status. It provides details about the payment, including its current status. ```JSON { "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" } ``` -------------------------------- ### Statistics Response Example Source: https://www.bayar.gg/api-docs Example JSON response structure for the statistics endpoint. ```json { "success": true, "period": "month", "total_transactions": 150, "total_amount": 7500000, "total_paid": 120, "breakdown": {"qris": 80, "gopay_qris": 30, "ovo": 10} } ``` -------------------------------- ### Example API Response for Orders Source: https://www.bayar.gg/api-docs Illustrates the structure of a successful response when fetching store orders. ```JSON { "success": true, "data": [ { "order_number": "WA260329-A1B2", "customer_name": "Rahim", "status": "paid", "total": 75000 } ], "total": 5 } ``` -------------------------------- ### GET /api/list-images.php Source: https://www.bayar.gg/api-docs Retrieves a list of product images. Supports filtering by active status. Requires an API key. ```APIDOC ## GET /api/list-images.php ### Description Retrieves a list of product images. Supports filtering by active status. Requires an API key. ### Method GET ### Endpoint /api/list-images.php ### Query Parameters - **active_only** (boolean) - Optional - Filters the results to include only active images. Defaults to true. ### Headers - **X-API-Key** (string) - Required - Your API key for authentication. ### Request Example ```json { "active_only": true } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **data** (array) - An array of image objects. - **id** (integer) - The unique identifier of the image. - **filename** (string) - The name of the image file. - **url** (string) - The URL of the image. - **active** (boolean) - Indicates if the image is active. #### Response Example ```json { "success": true, "data": [ {"id": 1, "filename": "product.jpg", "url": "https://...", "active": true} ] } ``` ``` -------------------------------- ### Example API Response for Order Completion Source: https://www.bayar.gg/api-docs Shows the expected response format after successfully updating an order's status. ```JSON { "success": true, "message": "Order completed successfully", "order": { "order_number": "WA260329-A1B2", "status": "completed" } } ``` -------------------------------- ### Get QRIS Information and Validation (Node.js) Source: https://www.bayar.gg/api-docs Retrieve information from a QRIS without converting it. Useful for validation and previewing merchant information. Use GET or POST method. ```javascript 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(); ``` -------------------------------- ### Get QRIS Information and Validation (Python) Source: https://www.bayar.gg/api-docs Retrieve information from a QRIS without converting it. Useful for validation and previewing merchant information. Use GET or POST method. ```python 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() ``` -------------------------------- ### GET /api/list-files.php Source: https://www.bayar.gg/api-docs Retrieves a list of digital files. Supports filtering by active status. Requires an API key. ```APIDOC ## GET /api/list-files.php ### Description Retrieves a list of digital files. Supports filtering by active status. Requires an API key. ### Method GET ### Endpoint /api/list-files.php ### Query Parameters - **active_only** (boolean) - Optional - Filters the results to include only active files. Defaults to true. ### Headers - **X-API-Key** (string) - Required - Your API key for authentication. ### Request Example ```json { "active_only": true } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **data** (array) - An array of digital file objects. - **id** (integer) - The unique identifier of the file. - **filename** (string) - The name of the file. - **size** (integer) - The size of the file in bytes. - **active** (boolean) - Indicates if the file is active. #### Response Example ```json { "success": true, "data": [ {"id": 1, "filename": "ebook.pdf", "size": 2048576, "active": true} ] } ``` ``` -------------------------------- ### GET /api/wa-store-orders.php Source: https://www.bayar.gg/api-docs Retrieve a list of WA Store orders filtered by status and limit. ```APIDOC ## GET /api/wa-store-orders.php ### Description Retrieve a list of WA Store orders. ### Method GET ### Endpoint https://www.bayar.gg/api/wa-store-orders.php ### Parameters #### Query Parameters - **status** (string) - Optional - Filter by order status (e.g., paid) - **limit** (integer) - Optional - Number of records to return ### Response #### Success Response (200) - **success** (boolean) - Status of the request - **data** (array) - List of orders - **total** (integer) - Total count of orders #### Response Example { "success": true, "data": [ { "order_number": "WA260329-A1B2", "customer_name": "Rahim", "status": "paid", "total": 75000 } ], "total": 5 } ``` -------------------------------- ### GET /api/list-payments.php Source: https://www.bayar.gg/api-docs Lists payments with filtering and pagination. ```APIDOC ## GET /api/list-payments.php Lists payments with filtering and pagination. ### Description This endpoint retrieves a list of payment transactions. You can filter the results by various criteria and paginate through the list to manage large datasets. ### Method GET ### Endpoint `/api/list-payments.php` ### Parameters #### Query Parameters - **limit** (integer) - Optional - The number of results to return per page (default: 10). - **page** (integer) - Optional - The page number to retrieve (default: 1). - **status** (string) - Optional - Filter payments by status (e.g., `paid`, `pending`, `failed`). - **start_date** (string) - Optional - Filter payments from this date (YYYY-MM-DD). - **end_date** (string) - Optional - Filter payments up to this date (YYYY-MM-DD). ### Response #### Success Response (200) - **data** (array) - An array of payment objects. - **transaction_id** (string) - Unique identifier for the transaction. - **status** (string) - The current status of the payment. - **amount** (number) - The payment amount. - **created_at** (string) - Timestamp when the payment was created. - **pagination** (object) - Pagination details. - **total_items** (integer) - Total number of items available. - **total_pages** (integer) - Total number of pages. - **current_page** (integer) - The current page number. - **per_page** (integer) - Number of items per page. #### Response Example ```json { "data": [ { "transaction_id": "txn_12345abcde", "status": "paid", "amount": 10000, "created_at": "2023-10-27T10:00:00Z" }, { "transaction_id": "txn_67890fghij", "status": "pending", "amount": 25000, "created_at": "2023-10-27T10:15:00Z" } ], "pagination": { "total_items": 50, "total_pages": 5, "current_page": 1, "per_page": 10 } } ``` ``` -------------------------------- ### GET /api/wa-store-orders.php Source: https://www.bayar.gg/api-docs Retrieves a list of WhatsApp Store orders or details of a specific order, with support for filtering and searching. ```APIDOC ## GET /api/wa-store-orders.php ### Description Retrieves a list of WhatsApp Store orders or details of a specific order, with support for filtering and searching. ### Method GET ### Endpoint /api/wa-store-orders.php ### Parameters #### Query Parameters - **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 ``` -------------------------------- ### Get QRIS Information and Validation (PHP) Source: https://www.bayar.gg/api-docs Retrieve information from a QRIS without converting it. Useful for validation and previewing merchant information. Use GET or POST method. ```php $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); ``` -------------------------------- ### Get QRIS Information and Validation (cURL) Source: https://www.bayar.gg/api-docs Retrieve information from a QRIS without converting it. Useful for validation and previewing merchant information. Use GET or POST method. ```bash curl -X GET "https://www.bayar.gg/api/qris-info.php?qris=00020101021126..." \ -H "X-API-Key: YOUR_API_KEY_HERE" ``` -------------------------------- ### GET /api/qris-info.php Source: https://www.bayar.gg/api-docs Retrieves information from a QRIS string without conversion, useful for validation and previewing merchant details. ```APIDOC ## GET /api/qris-info.php ### Description Retrieves information from a QRIS string without conversion, useful for validation and previewing merchant details. ### Method GET ### Endpoint /api/qris-info.php ### Parameters #### Query Parameters - **qris** (string) - Required - String QRIS untuk dianalisis ### Response #### Success Response (200) - **success** (boolean) - Status of the operation - **merchant_name** (string) - Name of the merchant - **merchant_city** (string) - City of the merchant - **amount** (number) - The nominal amount if present - **is_dynamic** (boolean) - Whether the QRIS is dynamic #### Response Example { "success": true, "merchant_name": "GOPAY MERCHANT", "merchant_city": "JAKARTA", "amount": 0, "is_dynamic": false } ``` -------------------------------- ### GET /api/check-payment.php Source: https://www.bayar.gg/api-docs Checks the status of a payment. ```APIDOC ## GET /api/check-payment.php Checks the status of a payment. ### Description This endpoint allows you to retrieve the current status of a payment transaction using its unique transaction ID. ### Method GET ### Endpoint `/api/check-payment.php` ### Parameters #### Query Parameters - **transaction_id** (string) - Required - The unique identifier for the transaction. ### Response #### Success Response (200) - **transaction_id** (string) - Unique identifier for the transaction. - **status** (string) - The current status of the payment (e.g., `pending`, `paid`, `failed`, `expired`). - **amount** (number) - The payment amount. - **paid_at** (string) - Timestamp when the payment was completed (if paid). #### Response Example ```json { "transaction_id": "txn_12345abcde", "status": "paid", "amount": 10000, "paid_at": "2023-10-27T10:30:00Z" } ``` ``` -------------------------------- ### GoPay Merchant QRIS Payment Response Source: https://www.bayar.gg/api-docs This is an example of a successful payment creation response when using GoPay Merchant QRIS. It includes payment details and a URL for the payment process. ```json { "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" } ``` -------------------------------- ### GET /api/get-statistics.php Source: https://www.bayar.gg/api-docs Retrieves statistics for a specified period. Requires an API key for authentication. ```APIDOC ## GET /api/get-statistics.php ### Description Retrieves statistics for a specified period. Requires an API key for authentication. ### Method GET ### Endpoint /api/get-statistics.php ### Query Parameters - **period** (string) - Required - The period for which to retrieve statistics (e.g., 'month'). ### Headers - **X-API-Key** (string) - Required - Your API key for authentication. ### Request Example ```json { "period": "month" } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **period** (string) - The period for which the statistics were retrieved. - **total_transactions** (integer) - The total number of transactions. - **total_amount** (integer) - The total amount of transactions. - **total_paid** (integer) - The total amount paid. - **breakdown** (object) - A breakdown of transactions by payment method. #### Response Example ```json { "success": true, "period": "month", "total_transactions": 150, "total_amount": 7500000, "total_paid": 120, "breakdown": {"qris": 80, "gopay_qris": 30, "ovo": 10} } ``` ``` -------------------------------- ### Webhook Callback Payload Example Source: https://www.bayar.gg/api-docs This JSON payload is sent to your specified `callback_url` when a payment is successfully paid. It contains detailed information about the transaction. ```json { "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" } ``` -------------------------------- ### GET /api/list-payments.php Source: https://www.bayar.gg/api-docs Retrieves a list of payments with filtering, searching, and pagination capabilities. Requires an API key for authentication. ```APIDOC ## GET /api/list-payments.php ### Description Mendapatkan daftar pembayaran dengan filter, search, dan pagination. ### Method GET ### Endpoint https://www.bayar.gg/api/list-payments.php ### Parameters #### Query Parameters - **search** (string) - Optional - Cari berdasarkan invoice, deskripsi, nama/email/HP pelanggan. - **status** (string) - Optional - Filter by status: pending, paid, expired, cancelled. - **payment_method** (string) - Optional - Filter by method: qris, qris_user, gopay_qris, ovo. - **paid_via** (string) - Optional - Filter pembayaran sukses by method: qris, qris_user, gopay_qris, ovo. - **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). ``` -------------------------------- ### Webhook Signature Verification Source: https://www.bayar.gg/api-docs This section provides a PHP code example for verifying incoming webhook signatures to ensure the authenticity of callback requests. ```APIDOC ## POST /webhooks ### Description Verifies the signature of an incoming webhook callback to ensure its authenticity. This is crucial for securing your integration and preventing unauthorized data processing. ### Method POST ### Endpoint `/webhooks` (Assumed endpoint for receiving callbacks) ### Parameters #### Headers - **X-Webhook-Signature** (string) - Required - The signature provided by the sender. - **X-Webhook-Timestamp** (string) - Required - The timestamp of the request. #### Request Body - **invoice_id** (string) - Required - The ID of the invoice. - **status** (string) - Required - The current status of the payment. - **final_amount** (string) - Required - The final amount of the payment. ### Request Example ```json { "invoice_id": "inv_12345", "status": "paid", "final_amount": "100.00" } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the callback was processed successfully. #### Response Example ```json { "success": true } ``` #### Error Response (401) - **error** (string) - Indicates an invalid signature. #### Response Example ```json { "error": "Invalid signature" } ``` ### Notes - The signature is generated using `hash_hmac('sha256', $payload['invoice_id'] . '|' . $payload['status'] . '|' . $payload['final_amount'] . '|' . $timestamp, 'YOUR_WEBHOOK_SECRET');`. - Replace `'YOUR_WEBHOOK_SECRET'` with your actual Webhook Secret Key found in **Settings → Webhook**. ``` -------------------------------- ### GET /api/check-payment.php Source: https://www.bayar.gg/api-docs Checks the status of a payment using its Invoice ID. Requires an API key for authentication. ```APIDOC ## GET /api/check-payment.php ### Description Mengecek status pembayaran berdasarkan Invoice ID. ### Method GET ### Endpoint https://www.bayar.gg/api/check-payment.php ### Parameters #### Query Parameters - **invoice** (string) - Required - Invoice ID pembayaran ### Request Example ``` https://www.bayar.gg/api/check-payment.php?invoice=PAY-admin-1234567890-ABC123 ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. - **invoice_id** (string) - The unique ID for the invoice. - **status** (string) - The current status of the payment (e.g., "paid"). - **amount** (number) - The original amount. - **final_amount** (number) - The final amount including any fees. - **payment_method** (string) - The payment method used. - **paid_at** (string) - The timestamp when the payment was made. - **paid_reff_num** (string) - The payment reference number. - **expires_at** (string) - The timestamp when the payment expires. #### Response Example ```json { "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-contents.php Source: https://www.bayar.gg/api-docs Retrieves a list of hidden digital contents. Supports filtering by active status. Requires an API key. ```APIDOC ## GET /api/list-contents.php ### Description Retrieves a list of hidden digital contents. Supports filtering by active status. Requires an API key. ### Method GET ### Endpoint /api/list-contents.php ### Query Parameters - **active_only** (boolean) - Optional - Filters the results to include only active content. Defaults to true. ### Headers - **X-API-Key** (string) - Required - Your API key for authentication. ### Request Example ```json { "active_only": true } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **data** (array) - An array of content objects. - **id** (integer) - The unique identifier of the content. - **title** (string) - The title of the content. - **type** (string) - The type of the content. - **active** (boolean) - Indicates if the content is active. #### Response Example ```json { "success": true, "data": [ {"id": 1, "title": "License Key", "type": "text", "active": true} ] } ``` ``` -------------------------------- ### List Product Images Source: https://www.bayar.gg/api-docs Retrieves a list of uploaded product images. ```bash curl -X GET "https://www.bayar.gg/api/list-images.php?active_only=true" \ -H "X-API-Key: YOUR_API_KEY_HERE" ``` ```php $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); ``` ```javascript 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(); ``` ```python 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() ``` -------------------------------- ### Create Payment with GoPay Merchant QRIS Source: https://www.bayar.gg/api-docs Use this cURL command to create a payment using the GoPay Merchant QRIS method. Ensure your GoPay Merchant token is valid and the QRIS image is uploaded. Note that GoPay Merchant tokens have a limited validity period. ```bash 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" }' ``` -------------------------------- ### POST /api/create-payment.php Source: https://www.bayar.gg/api-docs Creates a new payment with options for digital products, product images, and redirect URLs. ```APIDOC ## POST /api/create-payment.php Creates a new payment with options for digital products, product images, and redirect URLs. ### Description This endpoint allows you to create a new payment transaction. You can specify details such as the amount, description, customer information, callback URL, redirect URL, and digital product details. It also supports various payment methods including QRIS, GoPay QRIS, and OVO, with an option to enable QRIS Converter for dynamic QRIS generation. ### Method POST ### Endpoint `/api/create-payment.php` ### Parameters #### Request Body - **amount** (number) - Required - The payment amount (minimum Rp 1,000, maximum Rp 500,000 for QRIS Admin). - **description** (string) - Optional - Description of the payment. - **customer_name** (string) - Optional - Name of the customer. - **customer_email** (string) - Optional - Email of the customer. - **customer_phone** (string) - Optional - Phone number of the customer. - **callback_url** (string) - Optional - Webhook URL for payment success notifications. - **redirect_url** (string) - Optional - URL to redirect the user after successful payment. - **file_id** (number) - Optional - ID of the digital file to be provided after payment. - **content_id** (number) - Optional - ID of the hidden content to be unlocked after payment. - **product_image_id** (number) - Optional - ID of the product image to be displayed on the payment page. - **payment_method** (string) - Optional - Payment method: `qris`, `qris_user`, `gopay_qris`, or `ovo` (default: `qris`). - **use_qris_converter** (boolean) - Optional - Enable QRIS Converter to create dynamic QRIS with embedded nominal (default: `false`). **Payment Method Details:** - `qris`: QRIS (default, max Rp 500,000). - `qris_user`: BRI QRIS (requires active subscription and BRI configuration, no limit). - `gopay_qris`: GoPay QRIS (requires active subscription and GoPay Merchant account connected via OTP, no limit). - `ovo`: OVO (requires active subscription and OVO account connected). **QRIS Converter:** Set `use_qris_converter: true` to automatically generate dynamic QRIS with the nominal embedded. The QRIS string is fetched from the connected account based on the `payment_method`. No manual `qris_string` is needed. Nominal conversion is done automatically on the payment page. **QRIS Admin Nominal Limit:** For the `qris` payment method, the maximum nominal is Rp 500,000. For larger nominals, use `qris_user` or `gopay_qris` (GoPay Merchant QRIS, connect via OTP, no limit). **Note:** Use the `/api/get-payment-methods` endpoint to check availability and `user_status.has_active_subscription`. ### Request Example ```json { "amount": 10000, "description": "Pembelian Pulsa", "customer_name": "Budi", "customer_email": "budi@example.com", "callback_url": "https://example.com/webhook", "redirect_url": "https://example.com/success", "payment_method": "gopay_qris", "use_qris_converter": true } ``` ### Response #### Success Response (200) - **transaction_id** (string) - Unique identifier for the transaction. - **payment_url** (string) - URL to the payment page. - **qris_string** (string) - QRIS string (if `use_qris_converter` is false or not applicable). - **qris_converter** (boolean) - Indicates if QRIS converter was used. #### Response Example ```json { "transaction_id": "txn_12345abcde", "payment_url": "https://www.bayar.gg/pay/txn_12345abcde", "qris_string": "iVBORw0KGgoAAAANSUhEUgAAANwAAADcCAYAAACD/hQPAAAABHN...", "qris_converter": true } ``` ``` -------------------------------- ### POST /api/create-payment.php with GoPay Merchant QRIS Source: https://www.bayar.gg/api-docs This endpoint allows you to create payments using GoPay Merchant QRIS, directing funds straight to your GoPay Merchant account. ```APIDOC ## POST /api/create-payment.php with GoPay Merchant QRIS ### Description Initiates a payment using the GoPay Merchant QRIS method. This allows you to receive payments directly into your GoPay Merchant account without any withdrawal process. Unlike standard QRIS, this method does not have the Rp 500,000 nominal limit. ### Method POST ### Endpoint https://www.bayar.gg/api/create-payment.php ### Parameters #### Headers - **X-API-Key** (string) - Required - Your API key for authentication. - **Content-Type** (string) - Required - Must be set to `application/json`. #### Request Body - **amount** (integer) - Required - The payment amount in the smallest currency unit (e.g., cents for USD, Rupiah for IDR). - **description** (string) - Optional - A description for the payment. - **payment_method** (string) - Required - Must be set to `gopay_qris` for GoPay Merchant QRIS. ### Request Example ```json { "amount": 50000, "description": "Pembayaran Produk A", "payment_method": "gopay_qris" } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the payment creation was successful. - **payment** (object) - Contains details about the created payment. - **invoice_id** (string) - Unique identifier for the payment. - **amount** (integer) - The original payment amount. - **unique_code** (integer) - A unique code associated with the payment (may be used for final amount calculation). - **final_amount** (integer) - The total amount to be paid, including any additional fees or codes. - **payment_method** (string) - The method used for the payment. - **status** (string) - The current status of the payment (e.g., `pending`). - **expires_at** (string) - The date and time when the payment expires. - **payment_url** (string) - The URL where the user can complete the payment. #### Response Example ```json { "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" } ``` ### Important Notes - Ensure you have captured a valid token from the GoPay Merchant App using an HTTP Inspector and pasted the JSON token + device info on the connection page. - Upload your GoPay Merchant QRIS image before creating payments. - GoPay Merchant tokens have a limited validity period; ensure your token is current. - Funds are directly deposited into your GoPay Merchant account, bypassing the withdrawal process. ``` -------------------------------- ### Create Payment with BRI Merchant QRIS Source: https://www.bayar.gg/api-docs Use this cURL command to create a payment using the BRI Merchant QRIS method. Ensure your BRI API credentials are valid and the QRIS image is uploaded. ```bash 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" }' ``` -------------------------------- ### Create Payment Source: https://www.bayar.gg/api-docs Use this endpoint to create a new payment. Requires amount, description, and payment method. An API key is necessary for authentication. ```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": 50000, "description": "Pembayaran Produk A", "payment_method": "gopay_qris" }' ``` ```PHP $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_method' => 'gopay_qris' ]) ] ]) ); $data = json_decode($response, true); ``` ```Node.js 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_method: 'gopay_qris' }) }); const data = await res.json(); ``` ```Python 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_method': 'gopay_qris' } ) data = response.json() ``` -------------------------------- ### Webhook Settings Source: https://www.bayar.gg/api-docs Information on configuring webhook settings, including the default callback URL, webhook secret key, and callback logs. ```APIDOC ## Webhook Configuration ### Description Configure your webhook settings to manage how Bayar.gg sends notifications about payment events. ### Settings - **Default Callback URL** (string): The default URL that Bayar.gg will use to send payment notifications if no `callback_url` is provided during payment creation. - **Webhook Secret Key** (string): A unique secret key (`whsec_xxx`) for each user used to verify the signature of incoming callbacks. This key can be regenerated at any time. - **Callback Logs** (object): A log of the last 20 callbacks received, including their HTTP response status. This is useful for debugging. ### Important Note Signatures are verified using your **Webhook Secret Key**, not your API Key. You can find and manage your Webhook Secret Key in the **Settings → Webhook** section. ``` -------------------------------- ### Convert Static QRIS to Dynamic QRIS with Nominal (Python) Source: https://www.bayar.gg/api-docs Use this endpoint to convert a static QRIS to a dynamic QRIS with a specified nominal. Supports text or image input for QRIS. ```python 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() ``` -------------------------------- ### Convert Static QRIS to Dynamic QRIS with Nominal (PHP) Source: https://www.bayar.gg/api-docs Use this endpoint to convert a static QRIS to a dynamic QRIS with a specified nominal. Supports text or image input for QRIS. ```php $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); ``` -------------------------------- ### Enable QRIS Converter Source: https://www.bayar.gg/api-docs Set `use_qris_converter` to `true` in the request body to enable dynamic QRIS generation with embedded nominals. The QRIS string is automatically fetched based on the selected `payment_method`. ```json { "amount": 10000, "use_qris_converter": true, "payment_method": "gopay_qris" } ``` -------------------------------- ### Convert Static QRIS to Dynamic QRIS with Nominal (cURL) Source: https://www.bayar.gg/api-docs Use this endpoint to convert a static QRIS to a dynamic QRIS with a specified nominal. Supports text or image input for QRIS. ```bash 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 }' ``` -------------------------------- ### POST /api/qris-convert.php Source: https://www.bayar.gg/api-docs Converts static QRIS to dynamic QRIS with an embedded nominal. Supports input via QRIS string, base64 image, or image URL. ```APIDOC ## POST /api/qris-convert.php ### Description Converts static QRIS to dynamic QRIS with an embedded nominal. Supports input via QRIS string, base64 image, or image URL. ### Method POST ### Endpoint /api/qris-convert.php ### Parameters #### Request Body - **nominal** (number) - Required - Nominal yang akan ditanam di QRIS (dalam Rupiah) - **qris** (string) - Optional - String QRIS yang akan dikonversi - **image** (string) - Optional - Base64 encoded gambar QR code - **image_url** (string) - Optional - URL gambar QR code ### Request Example { "qris": "00020101021126...", "nominal": 50000 } ### Response #### Success Response (200) - **success** (boolean) - Status of the operation - **qris** (string) - The converted dynamic QRIS string - **qr_image_url** (string) - URL to the generated QR code image - **merchant_name** (string) - Name of the merchant - **amount** (number) - The embedded nominal amount #### Response Example { "success": true, "qris": "00020101021226...", "qr_image_url": "https://www.bayar.gg/qris-info/api/qr.php?data=...", "merchant_name": "GOPAY MERCHANT", "amount": 50000 } ``` -------------------------------- ### Convert Static QRIS to Dynamic QRIS with Nominal (Node.js) Source: https://www.bayar.gg/api-docs Use this endpoint to convert a static QRIS to a dynamic QRIS with a specified nominal. Supports text or image input for QRIS. ```javascript 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(); ``` -------------------------------- ### POST /api/create-payment.php with BRI Merchant QRIS Source: https://www.bayar.gg/api-docs This endpoint is used to create a payment using the BRI Merchant QRIS method. Funds are directly deposited into your BRI account. ```APIDOC ## POST /api/create-payment.php with BRI Merchant QRIS ### Description Initiates a payment using the BRI Merchant QRIS method. This method ensures that funds are directly transferred to your linked BRI bank account without requiring a withdrawal process. ### Method POST ### Endpoint https://www.bayar.gg/api/create-payment.php ### Parameters #### Headers - **X-API-Key** (string) - Required - Your API key for authentication. - **Content-Type** (string) - Required - Must be set to `application/json`. #### Request Body - **amount** (integer) - Required - The payment amount in the smallest currency unit (e.g., cents for USD, Rupiah for IDR). - **description** (string) - Optional - A description for the payment. - **payment_method** (string) - Required - Must be set to `qris_user` for BRI Merchant QRIS. ### Request Example ```json { "amount": 50000, "description": "Pembayaran Produk A", "payment_method": "qris_user" } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the payment creation was successful. - **payment** (object) - Contains details about the created payment. - **invoice_id** (string) - Unique identifier for the payment. - **amount** (integer) - The original payment amount. - **unique_code** (integer) - A unique code associated with the payment (may be used for final amount calculation). - **final_amount** (integer) - The total amount to be paid, including any additional fees or codes. - **payment_method** (string) - The method used for the payment. - **status** (string) - The current status of the payment (e.g., `pending`). - **expires_at** (string) - The date and time when the payment expires. - **payment_url** (string) - The URL where the user can complete the payment. #### Response Example ```json { "success": true, "payment": { "invoice_id": "PAY-admin-1234567890-ABC123", "amount": 50000, "unique_code": 347, "final_amount": 50347, "payment_method": "qris_user", "status": "pending", "expires_at": "2026-02-15 12:30:00" }, "payment_url": "https://www.bayar.gg/pay?invoice=PAY-admin-1234567890-ABC123" } ``` ### Important Notes - Ensure your BRI API credentials (Host, Username, Password, MID, TID) are correctly configured in the dashboard. - Upload your merchant QRIS image before attempting to create payments. - Funds are directly deposited into your bank account, bypassing the withdrawal process. ``` -------------------------------- ### Payment Statuses Source: https://www.bayar.gg/api-docs Overview of the different payment statuses available in the Bayar.gg system. ```APIDOC ## Payment Statuses ### Description Understand the various statuses a payment can have within the Bayar.gg system. ### Statuses - **pending**: The payment is awaiting confirmation. - **paid**: The payment has been successfully completed. - **expired**: The payment has passed its due date and is no longer valid. - **cancelled**: The payment has been explicitly canceled. ``` -------------------------------- ### API Key Authentication Query Parameter Source: https://www.bayar.gg/api-docs Alternatively, authenticate your API requests by appending your API Key as a query parameter 'apiKey'. Replace 'YOUR_API_KEY_HERE' with your actual API key. ```http ?apiKey=YOUR_API_KEY_HERE ```