API Documentation

Dokumentasi API

Integrasikan pembayaran QRIS dengan mudah menggunakan REST API QRISPAY.

Pendahuluan

API QRISPAY memungkinkan Anda untuk menerima pembayaran QRIS secara otomatis melalui website atau aplikasi. API kami dirancang dengan standar RESTful yang mudah diintegrasikan.

Catatan: Semua request API harus menggunakan HTTPS di lingkungan production.

Autentikasi

Setiap request API harus menyertakan API Key melalui header Authorization dengan format Bearer Token.

Authorization: Bearer agp_your_api_key_here

Dapatkan API Key: Login ke dashboard → Pengaturan → API Key

Endpoints

POST /v1/payment

Membuat transaksi pembayaran QRIS baru.

Request Body:

{
  "amount": 10000,
  "order_id": "INV-001",       // optional
  "customer_name": "Budi",       // optional
  "customer_email": "budi@email.com", // optional
  "customer_phone": "08123456789"    // optional
}

Response:

{
  "success": true,
  "data": {
    "transaction_id": "TRX20260101001",
    "order_id": "INV-001",
    "amount": 10000,
    "fee": 70,
    "net": 9930,
    "status": "pending",
    "checkout_url": "https://qrispay.com/pay.php?token=xxx",
    "expiry_time": "2026-01-01 15:30:00"
  }
}
GET /v1/status/{transaction_id}

Mengecek status transaksi.

Response:

{
  "success": true,
  "data": {
    "transaction_id": "TRX20260101001",
    "order_id": "INV-001",
    "amount": 10000,
    "fee": 70,
    "net": 9930,
    "status": "paid",
    "paid_time": "2026-01-01 15:35:00"
  }
}
GET /v1/balance

Mengecek saldo merchant.

Response:

{
  "success": true,
  "data": {
    "balance": 1500000,
    "currency": "IDR",
    "minimum_withdraw": 20000
  }
}
POST /v1/withdraw

Request penarikan saldo ke rekening bank.

Request Body:

{
  "amount": 500000,
  "bank_name": "BCA",
  "bank_number": "1234567890",
  "bank_account": "PT Merchant"
}

Response:

{
  "success": true,
  "data": {
    "withdrawal_id": "WDR20260101001",
    "amount": 500000,
    "fee": 4500,
    "net": 495500,
    "status": "pending"
  }
}
PUT /v1/webhook

Mengatur URL webhook untuk notifikasi transaksi.

Request Body:

{
  "webhook_url": "https://domain.com/callback"
}

Response:

{
  "success": true,
  "data": {
    "webhook_url": "https://domain.com/callback",
    "webhook_secret": "whsec_xxx"
  }
}

Webhook Signature: QRISPAY akan mengirim signature di header X-Signature. Verifikasi dengan HMAC-SHA256 menggunakan webhook_secret.

Contoh Kode

PHP - cURL

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://qrispay.site/api/v1/payment.php");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Authorization: Bearer agp_your_api_key",
    "Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(["amount" => 10000]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);

JavaScript - Fetch API

fetch('https://qrispay.site/api/v1/payment.php', {
    method: 'POST',
    headers: {
        'Authorization': 'Bearer agp_your_api_key',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({ amount: 10000 })
})
.then(res => res.json())
.then(console.log);

Python - Requests

import requests

url = "https://qrispay.site/api/v1/payment.php"
headers = {
    "Authorization": "Bearer agp_your_api_key",
    "Content-Type": "application/json"
}
data = {"amount": 10000}

response = requests.post(url, json=data, headers=headers)
print(response.json())

cURL

curl -X POST https://qrispay.site/api/v1/payment.php \
  -H "Authorization: Bearer agp_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"amount": 10000}'

Kode Error

401 Unauthorized - API Key tidak valid atau tidak disertakan
400 Bad Request - Parameter yang dikirim tidak valid
404 Not Found - Endpoint atau resource tidak ditemukan
405 Method Not Allowed - Method HTTP tidak sesuai
500 Internal Server Error - Terjadi kesalahan pada server

Status Transaksi: pending - Menunggu pembayaran, paid - Pembayaran berhasil, expired - Kadaluarsa, cancel - Dibatalkan

Coba API Sekarang

Dapatkan API Key Anda dari dashboard merchant dan mulai integrasi sekarang.