{
  "name": "promptpay_qr",
  "slug": "promptpay-qr",
  "description": {
    "th": "สร้างข้อมูล QR พร้อมเพย์สำหรับรับเงินจากเบอร์มือถือ เลขบัตรประชาชน/เลขผู้เสียภาษี 13 หลัก หรือ e-wallet 15 หลัก ระบุจำนวนเงินได้ ได้ payload และลิงก์เปิดหน้าเว็บที่แสดง QR ให้สแกน",
    "en": "Builds a PromptPay QR payload to receive money to a Thai mobile number, 13-digit national/tax ID or 15-digit e-wallet ID, optionally with a fixed amount. Returns the payload and a link to a page that shows the scannable QR."
  },
  "inputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "target": {
        "description": "PromptPay ID: Thai mobile (06/08/09, e.g. 0812345678 or +66 81 234 5678), 13-digit national/tax ID with a valid checksum, or 15-digit e-wallet ID.",
        "type": "string",
        "minLength": 1,
        "maxLength": 32
      },
      "amount": {
        "description": "Optional fixed amount in baht, at most 2 decimals, 0.01 to 99,999,999.99.",
        "anyOf": [
          {
            "type": "number",
            "minimum": 0.01,
            "maximum": 99999999.99
          },
          {
            "type": "string",
            "pattern": "^\\s*(฿\\s*)?(\\d+|\\d{1,3}(,\\d{3})+)(\\.\\d{1,2})?\\s*$"
          }
        ]
      }
    },
    "required": [
      "target"
    ],
    "additionalProperties": false
  }
}
