GetPlaz

Dokumentasi API Public

Panduan integrasi lengkap dengan contoh kode dan format respon JSON.

Mode: PRODUCTION/SANDBOX

1 Otentikasi

Setiap request ke API GetPlaz membutuhkan API Key. Anda bisa mendapatkan API Key di Menu Dashboard setelah mendaftar.

YOUR_API_KEY

2 Payment Channels

GET

Dapatkan daftar metode pembayaran yang aktif dan tersedia untuk projek Anda.

https://getplaz.com/api.php?action=payment_channels&apikey={APIKEY}
Contoh Kode PHP
Download
<?php
$apiKey = 'YOUR_API_KEY';
$url = 'https://getplaz.com/api.php?action=payment_channels&apikey=' . $apiKey;

$res = file_get_contents($url);
$data = json_decode($res, true);

if ($data['status']) {
    foreach ($data['data'] as $group) {
        echo "Kategori: " . $group['category'] . "\n";
        foreach ($group['items'] as $item) {
            echo "- [" . $item['code'] . "] " . $item['name'] . "\n";
        }
    }
}
?>

Contoh Respon JSON

{
  "status": true,
  "message": "List Payment Channels",
  "data": [
    {
      "category": "QRIS",
      "items": [
        { "code": "QRIS", "name": "QRIS (All E-Wallet)" }
      ]
    },
    {
      "category": "E-WALLET",
      "items": [
        { "code": "GOPAY", "name": "GoPay" },
        { "code": "DANA", "name": "Dana" }
      ]
    }
  ]
}

3 Create Transaction (Advanced)

GET

Endpoint untuk membuat transaksi pembayaran baru via semua metode (QRIS, VA, E-Wallet, Retail).

✅ Idempotent: Jika request dengan reff_id yang sama dikirim ulang (refresh/retry), sistem akan mengembalikan data transaksi yang sudah ada beserta status terkini. Tidak akan terjadi duplikasi.

https://getplaz.com/api.php?action=create_order&apikey={APIKEY}&nominal={NOMINAL}&reff_id={REFF_ID}&metode={METODE}

Parameter

Parameter Wajib Keterangan
apikeyAPI Key dari Dashboard
nominalNominal (min. 1000)
reff_idID Unik dari sistem Anda (contoh: INV-001). Akan menjadi ID transaksi.
metodeDefault: QRIS. Lihat daftar metode di bawah.
customer_nameNama customer (Opsional)
customer_emailEmail customer (Opsional)
customer_phoneNomor HP customer (Opsional, untuk WhatsApp Notif)

Kode Metode Pembayaran

Kategori Kode (metode)
QRISQRIS, QRIS_CUSTOM, QRISREALTIME
E-WalletGOPAY, DANA, SHOPEEPAY, LINKAJA, OVO
Virtual AccountBRIVA, BCAVA, MANDIRIVA, BNIVA, BSIVA, CIMBVA, DANAMONVA, PERMATAVA
RetailALFAMART, INDOMARET
Contoh Kode PHP
<?php
$apiKey = 'YOUR_API_KEY';
$nominal = 10000;
$reff_id = 'INV-' . time(); // ID unik dari sistem Anda
$metode = 'QRIS'; // QRIS, GOPAY, DANA, BRIVA, dll.

$url = 'https://getplaz.com/api.php?action=create_order&apikey=' . $apiKey . '&nominal=' . $nominal . '&reff_id=' . $reff_id . '&metode=' . $metode;

$res = file_get_contents($url);
$data = json_decode($res, true);

if ($data['status']) {
    // Redirect user ke halaman pembayaran
    header("Location: " . $data['data']['pay_url']);
    exit;
} else {
    echo "Error: " . $data['message'];
}

// CATATAN: Jika URL yang sama dipanggil lagi (refresh/retry),
// sistem akan mengembalikan data transaksi yang sama
// beserta status terkini (Unpaid/Success/Expired).
?>

Respon: Order Baru / Cek Status

{
  "status": true,
  "data": {
    "trx_id": "INV-170000001",
    "status": "Unpaid",
    "nominal": 10000,
    "ref_id": "INV-170000001",
    "pay_url": "https://getplaz.com/index.php?page=pay&slug=INV-170000001",
    "qr_link": "https://..." // (jika QRIS)
    "nomor_va": "88880001" // (jika VA)
    "checkout_url": "https://..." // (jika E-Wallet)
  }
}

Status yang Mungkin

Unpaid — Belum dibayar
SUCCESS — Pembayaran berhasil
EXPIRED — Waktu habis
CANCELLED — Dibatalkan

4 Check Status

GET

Endpoint untuk mengecek status transaksi.

https://getplaz.com/api.php?action=checkstatus&apikey={APIKEY}&trxid={TRX_ID}
Contoh Kode PHP
Download
<?php
$apiKey = 'YOUR_API_KEY';
$trxId = 'GP-CONTOH'; 
$url = 'https://getplaz.com/api.php?action=checkstatus&apikey=' . $apiKey . '&trxid=' . $trxId;

$res = file_get_contents($url);
$data = json_decode($res, true);
print_r($data);
?>

Jika Sukses / Pending

{
  "status": true,
  "data": {
    "status": "SUCCESS",
    "trx_id": "GP-...",
    "amount": 10000,
    "payment_url": "...",
    "qr_image": "..."
  }
}

Jika Expired

{
  "status": true,
  "data": {
    "status": "EXPIRED",
    "qris_image": "https://.../expired.png"
  }
}

5 Webhook (Callback)

POST

Notifikasi otomatis ke server Anda saat pembayaran BERHASIL atau EXPIRED.

Wajib: Verifikasi header X-GetPlaz-Signature menggunakan Secret Anda.

Contoh Handler PHP
Download
<?php
$secret = 'YOUR_WEBHOOK_SECRET'; 
$json = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_GETPLAZ_SIGNATURE'] ?? '';

// Verifikasi
if (!hash_equals(hash_hmac('sha256', $json, $secret), $signature)) {
    http_response_code(403); exit;
}

$data = json_decode($json, true);
// Logic Anda...
http_response_code(200);
?>

Payload Sukses (POST)

{
  "trxid": "GP-ABC...",
  "amount": 10123,
  "status": "SUCCESS", 
  "paid_at": "2026-01-01 12:05:00"
}

Payload Expired (POST)

{
  "trxid": "GP-ABC...",
  "amount": 10123,
  "status": "EXPIRED", 
  "paid_at": null
}

6 Fitur Tambahan

Cek Profil & Saldo

GET

Endpoint untuk melihat informasi akun merchant dan saldo terkini.

https://getplaz.com/api.php?action=check_profile&apikey={APIKEY}
Contoh Kode PHP
<?php
$apiKey = 'YOUR_API_KEY';
$url = 'https://getplaz.com/api.php?action=check_profile&api_key=' . $apiKey;

$res = file_get_contents($url);
$data = json_decode($res, true);

if ($data['status']) {
    echo "Saldo: " . $data['data']['current_balance'];
}
?>

Response JSON

{
  "status": true,
  "message": "Profile data retrieved successfully",
  "data": {
    "project_name": "Toko Online Saya",
    "merchant_username": "user123",
    "merchant_email": "admin@store.com",
    "current_balance": 1500000,
    "is_active": true
  }
}

Request Withdrawal

POST

Endpoint untuk melakukan penarikan dana otomatis.

https://getplaz.com/api.php?action=request_withdrawal
Contoh Kode PHP (cURL)
<?php
$url = 'https://getplaz.com/api.php?action=request_withdrawal';
$data = [
    'api_key' => 'YOUR_API_KEY',
    'amount' => 50000,
    'bank_code' => 'BCA',
    'account_number' => '1234567890',
    'account_name' => 'JOHN DOE'
];

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);

$result = json_decode($response, true);
print_r($result);
?>

Response JSON

{
  "status": true,
  "message": "Withdrawal request submitted successfully",
  "data": {
    "amount_requested": 50000,
    "admin_fee": 5000,
    "amount_received": 45000,
    "bank": "BCA",
    "account": "1234567890",
    "status": "PENDING"
  }
}

List Metode Penarikan

GET

Dapatkan daftar lengkap Bank dan E-Wallet yang didukung sistem.

Penting: Nilai code dari respon ini (Misal: "BCA") WAJIB digunakan sebagai parameter bank_code saat melakukan Request Withdrawal.

https://getplaz.com/api.php?action=get_withdrawal_methods&apikey={APIKEY}
Contoh Kode PHP (Tampilkan List)
<?php
$apiKey = 'YOUR_API_KEY';
$url = 'https://getplaz.com/api.php?action=get_withdrawal_methods&apikey=' . $apiKey;

// Inisialisasi cURL
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

$result = json_decode($response, true);

if ($result['status']) {
    echo "Metode Pembayaran Tersedia:\n";
    foreach ($result['data'] as $method) {
        // Output: [BCA] Bank Central Asia (BANK)
        echo "[" . $method['code'] . "] " . $method['name'] . " (" . $method['type'] . ")\n";
    }
} else {
    echo "Gagal: " . $result['message'];
}
?>

Penjelasan Data

  • code Kode unik bank (Misal: BCA, DANA). Gunakan ini untuk parameter request withdraw.
  • name Nama lengkap bank/e-wallet (Display Name).
  • type Jenis metode: BANK atau EWALLET.

Response JSON

{
  "status": true,
  "message": "Available withdrawal methods retrieved",
  "total": 3,
  "data": [
    {
      "code": "BCA",
      "name": "Bank Central Asia",
      "type": "BANK",
      "is_active": true
    },
    {
      "code": "DANA",
      "name": "DANA Indonesia",
      "type": "EWALLET",
      "is_active": true
    },
    ...
  ]
}

Cancel Transaction

POST

Membatalkan transaksi yang masih berstatus PENDING.

https://getplaz.com/api.php?action=cancel_transaction
Contoh Kode PHP (cURL)
<?php
$url = 'https://getplaz.com/api.php?action=cancel_transaction';
$data = [
    'api_key' => 'YOUR_API_KEY',
    'trx_id' => 'GP-TRX12345' // Ganti dengan ID Transaksi Anda
];

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);

$result = json_decode($response, true);
print_r($result);
?>

Response JSON

{
  "status": true,
  "message": "Transaction cancelled successfully",
  "data": {
    "trx_id": "GP-TRX12345",
    "status": "CANCELLED",
    "cancelled_at": "2026-01-18 10:00:00"
  }
}

7 Simple API (Legacy)

GET

Endpoint ini didesain khusus untuk integrasi cepat (Simple QRIS) seperti versi terdahulu (Qiospay/Vercel).

Note: Endpoint ini hanya mendukung QRIS. Untuk metode lain (E-Wallet/VA), gunakan endpoint Create Transaction (Advanced) di atas.

Versi sederhana untuk membuat QRIS instan tanpa parameter kompleks. Untuk integrasi penuh, gunakan endpoint Create Transaction di atas.

https://getplaz.com/api.php?action=createpayment&apikey={APIKEY}&amount={NOMINAL}&customer_name={NAMA}
Contoh Kode PHP
Download
<?php
$apiKey = 'YOUR_API_KEY';
$amount = 10000;
// $name = 'Pelanggan 1'; // Opsional (Boleh tidak diisi)

$url = 'https://getplaz.com/api.php?action=createpayment&apikey=' . $apiKey . '&amount=' . $amount;
// &customer_name=' . urlencode($name); // Tambahkan jika ingin kirim nama

$res = file_get_contents($url);
$data = json_decode($res, true);

if ($data['status']) {
    print_r($data['data']);
}
?>

Contoh Respon JSON (Sukses)

{
  "status": true,
  "data": {
    "trx_id": "GP-ABC12345",
    "amount": 10123,
    "payment_url": "https://domain.com/pay/...",
    "qr_image": "https://domain.com/assets/...",
    "expired_at": "2026-01-01 12:00:00",
    "environment": "sandbox"
  }
}