Payment API

Professional payment processing & QR code generation API for seamless transactions

99.9%Uptime
<200msResponse Time
24/7Support

API Overview

Welcome to the Payment API documentation. Our API provides robust payment processing capabilities with QR code generation and real-time transaction verification.

QR Generation

Generate secure payment QR codes with custom amounts and merchant information.

Secure Verification

Real-time payment verification with MD5 hashing and transaction tracking.

High Performance

Fast response times with 99.9% uptime and enterprise-grade reliability.

Base URL
https://simple-pay.bruhstore.online

Authentication

Most endpoints are public, but usage is monitored. The /khqr/create endpoint requires the receiving bakongid to be activated by an administrator via the Admin Panel.

Important

To use the QR generation endpoint, your bakongid must be activated. If the ID is not active or has expired, the API will reject the request with a 403 Forbidden status.

API Endpoints

GET/khqr/create

Generate a new KHQR payment code for processing transactions.

Query Parameters

ParameterTypeRequiredDescription
amountstringRequiredPayment amount in USD (e.g., "5.00").
bakongidstringRequiredRecipient's active Bakong account ID (e.g., user@bank).
merchantnamestringRequiredMerchant display name for the transaction.

Example Request

cURL
curl "https://simple-pay.bruhstore.online/khqr/create?amount=5.00&bakongid=your_active_id&merchantname=MyStore"

Response

JSON Response (200 OK)
{
  "status": true,
  "message": "success",
  "qr": "https://simple-pay.bruhstore.online/khqr/qr/AbC123xY",
  "md5": "e6c857f9bcf1d8e4158fe50c68099f3e",
  "tran": "AbC123xY"
}

Try It Out

GET/khqr/check_by_md5

Verify payment status using MD5 hash and Bakong ID.

Query Parameters

ParameterTypeRequiredDescription
md5stringRequiredMD5 hash from the QR generation response.
bakongidstringRequiredRecipient's Bakong account ID used for the transaction.

Example Request

cURL
curl "https://simple-pay.bruhstore.online/khqr/check_by_md5?md5=...&bakongid=..."

Response

JSON Response (200 OK)
{
  "bakongid": "konpov123@aclb",
  "apiResult": {
    "responseCode": 0,
    "responseMessage": "Success",
    "errorCode": null,
    "data": {
      "id": 1079,
      "md5": "93e04fad5a2d1862ad1d83dfb9459da7",
      "hash": "...",
      "fromAccountId": "simplepay@aclb",
      "toAccountId": "konpov123@aclb",
      "currency": "USD",
      "amount": 0.01,
      "description": "good luck",
      "createdDateMs": 1759406249000,
      "acknowledgedDateMs": 1759406251000,
      "status": "SUCCESS",
      "updatedAt": "2025-10-02T11:57:28.376Z",
      "createdAt": "2025-10-02T11:57:28.376Z"
    }
  }
}

Try It Out

POST/khqr/check/[tran_id]

Check payment status using internal transaction ID.

Parameters

ParameterTypeRequiredDescription
tran_id (in URL)stringRequiredThe tran ID from the QR generation response.

Example Request

cURL
curl -X POST "https://simple-pay.bruhstore.online/khqr/check/AbC123xY"

Response

JSON Response (200 OK)
{
  "bakongid": "konpov123@aclb",
  "apiResult": {
    "responseCode": 0,
    "responseMessage": "Success",
    "errorCode": null,
    "data": {
      "id": 1079,
      "md5": "93e04fad5a2d1862ad1d83dfb9459da7",
      "hash": "...",
      "fromAccountId": "simplepay@aclb",
      "toAccountId": "konpov123@aclb",
      "currency": "USD",
      "amount": 0.01,
      "description": "good luck",
      "createdDateMs": 1759406249000,
      "acknowledgedDateMs": 1759406251000,
      "status": "SUCCESS",
      "updatedAt": "2025-10-02T11:57:28.376Z",
      "createdAt": "2025-10-02T11:57:28.376Z"
    }
  }
}

Try It Out

Error Handling

The API uses standard HTTP status codes to indicate the success or failure of a request. A 2xx range indicates success, a 4xx range indicates a client-side error, and a 5xx range indicates a server-side error.

Common Error Codes

Status CodeMeaningPossible Reason
400Bad RequestA required parameter was missing or invalid.
403ForbiddenThe provided bakongid is not active or has expired.
404Not FoundThe requested resource (e.g., a transaction ID) does not exist.
500Internal Server ErrorAn unexpected error occurred on the server. This could be due to an issue with the QR generation library or the database.

Code Examples

Here are some examples of how to integrate with our API in different languages.

Node.js

Create QR Payment

const fetch = require('node-fetch');

const API_BASE = 'https://simple-pay.bruhstore.online';

async function createPaymentQR(amount, bakongId, merchantName) {
  const params = new URLSearchParams({
    amount: amount,
    bakongid: bakongId,
    merchantname: merchantName
  });

  try {
    const response = await fetch(`${API_BASE}/khqr/create?${params}`);
    const data = await response.json();

    if (!response.ok || !data.status) {
      throw new Error(data.message || 'Failed to create QR code.');
    }

    console.log('Successfully created QR:', data);
    // Returns { status, message, qr, md5, tran }
    return data;
  } catch (error) {
    console.error('Error:', error.message);
  }
}

// Usage
createPaymentQR('1.50', 'your_active_id@bank', 'My Awesome Cafe');
Check Payment Status

const fetch = require('node-fetch');

const API_BASE = 'https://simple-pay.bruhstore.online';

async function checkPaymentStatus(md5, bakongId) {
    const params = new URLSearchParams({ md5, bakongid: bakongId });
    try {
        const response = await fetch(`${API_BASE}/khqr/check_by_md5?${params}`);
        const data = await response.json();
        
        if (!response.ok) {
            throw new Error(data.error || 'Failed to check status.');
        }

        const paymentStatus = data?.apiResult?.data?.status;
        console.log('Payment Status:', paymentStatus || 'Pending/Not Found'); // e.g., "SUCCESS"
        
        if (paymentStatus === 'SUCCESS') {
            console.log('Transaction details:', data.apiResult.data);
        }
        
        return data;

    } catch (error) {
        console.error('Error checking payment:', error.message);
    }
}

// Usage (using md5 and bakongId from the create step)
// checkPaymentStatus('e6c857f9bcf1d8e4158fe50c68099f3e', 'your_active_id@bank');

Python

Create QR Payment

import requests

API_BASE = 'https://simple-pay.bruhstore.online'

def create_payment_qr(amount, bakong_id, merchant_name):
    params = {
        'amount': amount,
        'bakongid': bakong_id,
        'merchantname': merchant_name
    }
    try:
        response = requests.get(f"{API_BASE}/khqr/create", params=params)
        response.raise_for_status()

        data = response.json()
        if not data.get('status'):
            raise Exception(data.get('message', 'Failed to create QR code.'))

        print(f"Successfully created QR: {data}")
        # Returns dict with status, message, qr, md5, tran
        return data

    except requests.exceptions.RequestException as e:
        print(f"An error occurred: {e}")
    except Exception as e:
        print(f"An error occurred: {e}")


# Usage
# create_payment_qr('1.50', 'your_active_id@bank', 'My Awesome Cafe')
Check Payment Status

import requests

API_BASE = 'https://simple-pay.bruhstore.online'

def check_payment_status(md5, bakong_id):
    params = {
        'md5': md5,
        'bakongid': bakong_id
    }
    try:
        response = requests.get(f"{API_BASE}/khqr/check_by_md5", params=params)
        response.raise_for_status()  # Raises an HTTPError for bad responses

        data = response.json()
        
        # Safely access nested status
        payment_status = data.get('apiResult', {}).get('data', {}).get('status')
        
        print(f"Payment status: {payment_status or 'Pending/Not Found'}")
        
        if payment_status == 'SUCCESS':
            print(f"Transaction details: {data['apiResult']['data']}")

        return data

    except requests.exceptions.RequestException as e:
        print(f"An error occurred: {e}")

# Usage
# Replace with md5 and bakongid from your create response
# check_payment_status('e6c857f9bcf1d8e4158fe50c68099f3e', 'your_active_id@bank')

SDKs & Libraries

We are working on official SDKs to make integration even easier. Currently, you can use any standard HTTP client or library for your language.

NPM (Node.js)

An official Node.js wrapper is coming soon. For now, we recommend using node-fetch.

Installation
npm install node-fetch

Postman Collection

Jumpstart your integration by using our Postman collection. It includes all available endpoints with pre-configured examples. Click the button below to import it directly into your Postman application.