v2.0

Payment Gateway Bot

API documentation for QRIS deposit, withdrawal, and account management.

Authentication

All API endpoints require an apikey parameter. The API key is automatically generated when a user first interacts with the Telegram bot using /start.

Format: ?apikey=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Important: Never share your API key. Generate a new one via the Telegram bot if compromised.

Check Balance

GET /api/saldo?apikey=YOUR_API_KEY Returns the current balance of your account.

Parameters

ParameterTypeRequiredDescription
apikeyStringYesYour API key

Success Response

{
  "status": "success",
  "data": {
    "user_id": "123456789",
    "saldo": 500000
  }
}

Error Response

{
  "status": "error",
  "message": "API key tidak valid"
}

Deposit (QRIS)

GET /api/deposit?apikey=YOUR_API_KEY&amount=100000 Creates a QRIS payment code. Balance is automatically credited after payment is detected.

Parameters

ParameterTypeRequiredDescription
apikeyStringYesYour API key
amountIntegerYesDeposit amount (min. 1,000)

Success Response

{
  "status": "success",
  "data": {
    "transaction_id": "TRX-Deposit-XXXXXXXX",
    "amount": 100000,
    "fee": 25,
    "total_amount": 100025,
    "qris_url": "https://myqris.vercel.app/qr/xxxxx.png",
    "expired_at": "2025-01-15T10:30:00.000Z",
    "expired_minutes": 10
  }
}
Notes:
amount — requested deposit amount
fee — random fee (range 1-50)
total_amount — amount + fee (the amount to be paid)
qris_url — QR image URL for scanning
• Amounts ≥ 500,000 will incur an additional 0.7% surcharge

Check Payment Status

GET /api/status/payment?apikey=YOUR_API_KEY&transaction_id=TRX-XXX Checks whether a deposit has been paid.

Parameters

ParameterTypeRequiredDescription apikeyStringYesYour API key transaction_idStringYesTransaction ID from /api/deposit

Responses

// Not paid yet
{ "paid": false, "status": "success" }

// Paid
{ "paid": true, "status": "success" }

// Expired
{ "paid": false, "status": "success", "message": "Transaksi expired" }

Transaction History

GET /api/trx?apikey=YOUR_API_KEY Returns the last 10 transactions.

Success Response

{
  "status": "success",
  "data": {
    "user_id": "123456789",
    "saldo": 400000,
    "total_transactions": 5,
    "transactions": [
      {
        "id": 1,
        "date": "2025-01-15 10:00:00",
        "amount": 100025,
        "type": "CR",
        "description": "QRIS Deposit",
        "base_amount": 100000,
        "fee": 25,
        "transaction_id": "TRX-XXX",
        "balance": 500000,
        "status": "completed"
      }
    ]
  }
}

Type: CR = Credit (deposit), DB = Debit (withdrawal)

Withdraw

GET /api/wd?apikey=YOUR_API_KEY&wallet=dana&nomor=081234567890&nominal=50000 Withdraw balance to an e-wallet (DANA, OVO, GOPAY, SHOPEE).

Parameters

ParameterTypeRequiredDescription
apikeyStringYesYour API key
walletStringYesdana / ovo / gopay / shopee
nomorStringYesDestination e-wallet number (10-15 digits)

Success Response

{
  "success": true,
  "message": "Penarikan berhasil",
  "data": {
    "transaction_id": "WD-XXXXXXXX",
    "nomor": "081234567890",
    "wallet": "DANA",
    "amount": 50000,
    "fee": 1000,
    "diterima": 49000,
    "saldo_sebelum": 500000,
    "saldo_sekarang": 450000,
    "waktu": "2025-01-15 10:00:00"
  }
}
Note: Default withdrawal fee is 1,000. Minimum withdrawal is 15,000. Maximum withdrawal is limited by available system balance.

User Info

GET /api/user_info?apikey=YOUR_API_KEY Returns complete account information.

Success Response

{
  "status": "success",
  "data": {
    "user_id": "123456789",
    "saldo": 500000,
    "api_key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "is_admin": false
  }
}

Webhook Notifications

When a deposit is successful, the system will automatically send a POST request to the webhook URL you provided in the deposit request.

Payload Sent to Your Server

Method: POST  |  Content-Type: application/json
{
  "event": "payment.success",
  "timestamp": "2025-01-15T10:00:00.000Z",
  "data": {
    "transaction_id": "TRX-Deposit-XXXXXXXX",
    "amount": 100025,
    "base_amount": 100000,
    "fee": 25,
    "status": "completed",
    "customer_name": "John Doe",
    "customer_email": "john@example.com",
    "customer_phone": "081234567890"
  }
}

How to Use

Add the webhook parameter when creating a deposit:

GET /api/deposit?apikey=YOUR_API_KEY&amount=100000&webhook=https://your-server.com/callback

Your server must respond with HTTP 200 to acknowledge receipt.

Admin API

Restricted to admin IDs configured in ADMIN_IDS environment variable.

Add User Balance

GET /api/admin/addsaldo?apikey=ADMIN_KEY&user_id=TARGET_ID&amount=100000 Add balance to a specific user.

Deduct User Balance

GET /api/admin/minsaldo?apikey=ADMIN_KEY&user_id=TARGET_ID&amount=50000 Deduct balance from a specific user.

Surplus/Deficit Report

GET /api/surplus_deficit?apikey=ADMIN_KEY Shows the difference between system balance and total user balances.

Global Balance

GET /api/global_saldo?apikey=ADMIN_KEY Shows the main and QRIS balances from the provider.

Error Codes

HTTP StatusDescription
200Request successful
400Invalid or missing parameters
401Invalid API key or not authorized
403QRIS is currently disabled
404Endpoint not found
500Internal server error

Error Response Format

{
  "status": "error",
  "message": "Description of the error"
}