# QRIS Tools



Build a QRIS payload from merchant details, and decode one back — with the checksum verified both ways.



## QRIS Decoder

Decode a QRIS payload into merchant, city, currency, and amount — and verify its checksum before any money moves.

- Method: `GET`
- Path: `/v1/qris/decode`

**Parameters**

| Name | Type | | Description |
|---|---|---|---|
| `payload` | string | required | The raw string a QRIS code encodes. |

**Example request**

```bash
curl https://api.diraz.ae/v1/qris/decode \
  -H "Authorization: Bearer drz_live_…"
```

**Example response**

```json
{
  "data": {
    "valid": true,
    "crc_valid": true,
    "type": "dynamic",
    "merchant_name": "TOKO SEHAT",
    "merchant_city": "JAKARTA",
    "postal_code": "12345",
    "country": "ID",
    "currency": "IDR",
    "amount": 25000,
    "merchant_category": "5812",
    "national_merchant_id": "ID1020012345678",
    "fields": [],
    "issues": []
  },
  "meta": {
    "request_id": "req_7Q2fK4mZ"
  }
}
```

## QRIS Generator

Build a QRIS payload from merchant name, city, and optional amount — checksum included, ready for a QR encoder to render.

- Method: `GET`
- Path: `/v1/qris/generate`

**Parameters**

| Name | Type | | Description |
|---|---|---|---|
| `merchant_name` | string | required | Up to 25 characters, upper-cased per the spec. |
| `merchant_city` | string | required | Up to 15 characters, upper-cased per the spec. |
| `amount` | number | optional | Rupiah. Present builds a one-payment dynamic QR; absent a reusable static one. |
| `merchant_category_code` | string | optional | Four-digit MCC. `0000` when unknown. |
| `national_merchant_id` | string | optional | The merchant's NMID, where it has one. |
| `postal_code` | string | optional | Five digits. |

**Example request**

```bash
curl https://api.diraz.ae/v1/qris/generate \
  -H "Authorization: Bearer drz_live_…"
```

**Example response**

```json
{
  "data": {
    "payload": "00020101021126098ID.CO.QRIS.WWW5204581253033605405250.005802ID5909TOKO SEHAT6007JAKARTA6304A1B2C3D4",
    "crc": "A1B2C3D4",
    "type": "dynamic"
  },
  "meta": {
    "request_id": "req_7Q2fK4mZ"
  }
}
```