POST

/api/qris/create

Buat QRIS & Transaksi

Endpoint ini digunakan untuk memicu pembuatan string QRIS dinamis, menambahkan kode unik acak untuk otomatisasi verifikasi mutasi bank, dan menyimpan log draf transaksi berstatus Pending.

HTTP Request Headers

X-API-KEYWajib

Secret API Key toko Anda (contoh: QP-Key-xxx)

Content-Typeapplication/json

Request Body Parameters (JSON)

JSON Payloadapplication/json
{
  "amount": 25000,           // (number, wajib) Nominal dasar transaksi (harus > 0)
  "external_id": "INV-001"   // (string, wajib) ID Referensi / Nomor Invoice toko Anda
}

Respons Berhasil (HTTP 200 OK)

200 OKJSON Response
{
  "success": true,
  "data": {
    "transaction_id": "INV-001",
    "external_id": "INV-001",
    "qr_url": "http://localhost:9002/api/qris/image?tid=INV-001&mid=MERCHANT_UID",
    "base_amount": 25000,
    "unique_code": 43,
    "total_amount": 25043,
    "fee_amount": 175,
    "net_amount": 24868,
    "mdr_rate": "0.7%",
    "expiry_at": "2026-08-08T03:15:00.000Z",
    "status": "Pending"
  }
}

Contoh Kode Panggilan

curl -X POST "http://localhost:9002/api/qris/create" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: QP-Key-YOUR_SECRET_KEY" \
  -d '{
    "amount": 25000,
    "external_id": "INV-20260808-001"
  }'