{
  "openapi": "3.0.3",
  "info": {
    "title": "SlipMatrix Merchant API",
    "version": "2026-10-10",
    "description": "Public merchant endpoints. Asynchronous verification: HTTP 201 only acknowledges submission. Confirm amount, receiver, currency and transfer date before fulfilling an order. Webhook contract is available in components.schemas.Webhook; payload is not enveloped.",
    "contact": {
      "name": "ByteMatrix Co., Ltd.",
      "email": "contact@bytematrix.co.th",
      "url": "https://www.bytematrix.co.th"
    }
  },
  "servers": [
    {
      "url": "https://api.slipmatrix.com/api",
      "description": "Production — คำขอตรวจสลิปอาจใช้เครดิตจริง"
    }
  ],
  "externalDocs": {
    "description": "คู่มือภาษาไทยและ Signed Webhook",
    "url": "https://slipmatrix.com/developers"
  },
  "security": [
    {
      "AppId": [],
      "ApiKey": []
    }
  ],
  "tags": [
    {
      "name": "Verification"
    },
    {
      "name": "Batch"
    },
    {
      "name": "Results"
    }
  ],
  "paths": {
    "/verify": {
      "post": {
        "operationId": "verifySlip",
        "tags": [
          "Verification"
        ],
        "summary": "ส่งเลขอ้างอิงสลิป",
        "description": "ส่ง transRef และรหัสธนาคารผู้โอนจากสลิปจริง",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "รับเข้าคิว ไม่ใช่การยืนยันชำระเงิน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Accepted"
                }
              }
            }
          },
          "400": {
            "description": "ข้อมูลไม่ถูกต้อง สลิปซ้ำ หรือเครดิตไม่พอ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Credentials ไม่ถูกต้อง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "รอ Retry-After ก่อนลองใหม่",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "คิวไม่พร้อม หากมี transactionId ให้ติดตามรายการเดิม",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listTransactions",
        "tags": [
          "Results"
        ],
        "summary": "ดูประวัติรายการ",
        "description": "อ่านรายการที่ body.data.data; กรองวันที่สร้างรายการ createdAt ไม่ใช่เวลาโอน; วันที่ YYYY-MM-DD ใช้เขตเวลา Bangkok",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "เลขหน้า เริ่มที่ 1",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "จำนวนต่อหน้า ใช้จำนวนเต็มบวก",
            "schema": {
              "type": "integer",
              "default": 20
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "สถานะที่ต้องการ",
            "schema": {
              "type": "string",
              "description": "สถานะรายการ",
              "enum": [
                "PENDING",
                "PROCESSING",
                "VERIFIED",
                "FAILED",
                "DUPLICATE",
                "INVALID",
                "INSUFFICIENT_CREDIT"
              ]
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "description": "YYYY-MM-DD หรือ ISO 8601 พร้อมเขตเวลา",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "YYYY-MM-DD หรือ ISO 8601 พร้อมเขตเวลา",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "อ่านรายการที่ body.data.data; กรองวันที่สร้างรายการ createdAt ไม่ใช่เวลาโอน; วันที่ YYYY-MM-DD ใช้เขตเวลา Bangkok",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HistoryResponse"
                }
              }
            }
          },
          "401": {
            "description": "Credentials ไม่ถูกต้อง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "ลดความถี่คำขอ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/verify/qr": {
      "post": {
        "operationId": "verifyQr",
        "tags": [
          "Verification"
        ],
        "summary": "ส่งข้อความ QR",
        "description": "ใช้ QR ของสลิปเต็มอย่างน้อย 50 ตัวอักษร ไม่ใช่ QR รับเงิน",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QrRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "รับเข้าคิว ไม่ใช่การยืนยันชำระเงิน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Accepted"
                }
              }
            }
          },
          "400": {
            "description": "ข้อมูลไม่ถูกต้อง สลิปซ้ำ หรือเครดิตไม่พอ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Credentials ไม่ถูกต้อง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "รอ Retry-After ก่อนลองใหม่",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "คิวไม่พร้อม หากมี transactionId ให้ติดตามรายการเดิม",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/verify/image": {
      "post": {
        "operationId": "verifyImage",
        "tags": [
          "Verification"
        ],
        "summary": "ส่งภาพ Base64",
        "description": "JSON body รวมไม่เกิน 10 MiB ภาพ JPEG/PNG/WEBP แนะนำ multipart เพื่อลดขนาดคำขอ",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImageRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "รับเข้าคิว ไม่ใช่การยืนยันชำระเงิน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Accepted"
                }
              }
            }
          },
          "400": {
            "description": "ข้อมูลไม่ถูกต้อง สลิปซ้ำ หรือเครดิตไม่พอ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Credentials ไม่ถูกต้อง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "รอ Retry-After ก่อนลองใหม่",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "คิวไม่พร้อม หากมี transactionId ให้ติดตามรายการเดิม",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/verify/image/upload": {
      "post": {
        "operationId": "verifyFile",
        "tags": [
          "Verification"
        ],
        "summary": "อัปโหลดภาพสลิป",
        "description": "ส่งไฟล์ใน field file; JPEG/PNG/WEBP ไม่เกิน 5 MiB",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/FileRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "รับเข้าคิว ไม่ใช่การยืนยันชำระเงิน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Accepted"
                }
              }
            }
          },
          "400": {
            "description": "ข้อมูลไม่ถูกต้อง สลิปซ้ำ หรือเครดิตไม่พอ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Credentials ไม่ถูกต้อง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "รอ Retry-After ก่อนลองใหม่",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "คิวไม่พร้อม หากมี transactionId ให้ติดตามรายการเดิม",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/verify/batch": {
      "post": {
        "operationId": "verifyBatch",
        "tags": [
          "Batch"
        ],
        "summary": "ส่งหลายเลขอ้างอิง",
        "description": "1–50 รายการ; รับได้บางส่วน; referenceId ใช้จับคู่ผล ไม่ใช่ idempotency key",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "รับ batch แล้ว ต้องอ่าน results ทุกแถวและติดตาม transactionId แยกกัน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchResult"
                }
              }
            }
          },
          "400": {
            "description": "ข้อมูลไม่ถูกต้อง สลิปซ้ำ หรือเครดิตไม่พอ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Credentials ไม่ถูกต้อง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "รอ Retry-After ก่อนลองใหม่",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "คิวไม่พร้อม หากมี transactionId ให้ติดตามรายการเดิม",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/verify/batch/images": {
      "post": {
        "operationId": "verifyBatchImages",
        "tags": [
          "Batch"
        ],
        "summary": "ส่งหลายภาพ Base64",
        "description": "1–20 ภาพ; JSON body รวมไม่เกิน 10 MiB; ตรวจผลแต่ละรายการ",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchImageRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "รับ batch แล้ว ต้องอ่าน results ทุกแถวและติดตาม transactionId แยกกัน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchResult"
                }
              }
            }
          },
          "400": {
            "description": "ข้อมูลไม่ถูกต้อง สลิปซ้ำ หรือเครดิตไม่พอ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Credentials ไม่ถูกต้อง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "รอ Retry-After ก่อนลองใหม่",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "คิวไม่พร้อม หากมี transactionId ให้ติดตามรายการเดิม",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/verify/batch/images/upload": {
      "post": {
        "operationId": "verifyBatchFiles",
        "tags": [
          "Batch"
        ],
        "summary": "อัปโหลดหลายภาพ",
        "description": "ส่ง field files ซ้ำ 1–20 ไฟล์ แต่ละไฟล์ไม่เกิน 5 MiB; referenceIds คั่น comma เรียงตามไฟล์",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/BatchFileRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "รับ batch แล้ว ต้องอ่าน results ทุกแถวและติดตาม transactionId แยกกัน",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchResult"
                }
              }
            }
          },
          "400": {
            "description": "ข้อมูลไม่ถูกต้อง สลิปซ้ำ หรือเครดิตไม่พอ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Credentials ไม่ถูกต้อง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "รอ Retry-After ก่อนลองใหม่",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "คิวไม่พร้อม หากมี transactionId ให้ติดตามรายการเดิม",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/verify/{transactionId}": {
      "get": {
        "operationId": "getTransaction",
        "tags": [
          "Results"
        ],
        "summary": "ติดตามผลตรวจ",
        "description": "อ่าน body.data; HTTP 200 พร้อม data: null หากไม่พบหรือไม่มีสิทธิ์อ่านรายการ",
        "parameters": [
          {
            "name": "transactionId",
            "in": "path",
            "required": true,
            "description": "เลขรายการจากคำขอแรก",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "อ่าน body.data; HTTP 200 พร้อม data: null หากไม่พบหรือไม่มีสิทธิ์อ่านรายการ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusResponse"
                }
              }
            }
          },
          "401": {
            "description": "Credentials ไม่ถูกต้อง",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "ลดความถี่คำขอ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/verify/banks": {
      "get": {
        "operationId": "listBanks",
        "tags": [
          "Results"
        ],
        "summary": "ดูรหัสธนาคาร",
        "description": "ไม่ต้องส่ง Credentials; อ่านรายการที่ body.data.data เป็นข้อมูลรหัสธนาคาร ไม่ใช่คำรับประกันการตรวจทุกสลิป",
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "ไม่ต้องส่ง Credentials; อ่านรายการที่ body.data.data เป็นข้อมูลรหัสธนาคาร ไม่ใช่คำรับประกันการตรวจทุกสลิป",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BanksResponse"
                }
              }
            }
          },
          "429": {
            "description": "ลดความถี่คำขอ",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "AppId": {
        "type": "apiKey",
        "in": "header",
        "name": "x-app-id"
      },
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    },
    "schemas": {
      "VerifyRequest": {
        "type": "object",
        "properties": {
          "transRef": {
            "type": "string",
            "description": "เลขอ้างอิงจากสลิปจริง อย่างน้อย 10 ตัวอักษร",
            "minLength": 10
          },
          "sendingBank": {
            "type": "string",
            "description": "รหัสธนาคารผู้โอน เก็บเป็นข้อความ 3 หลัก เช่น 014",
            "example": "014"
          },
          "qrData": {
            "type": "string",
            "description": "ข้อความ QR จากสลิป (ถ้ามี)"
          }
        },
        "required": [
          "transRef",
          "sendingBank"
        ],
        "additionalProperties": false
      },
      "QrRequest": {
        "type": "object",
        "properties": {
          "qrData": {
            "type": "string",
            "description": "ข้อความ QR เต็มจากสลิปจริง ไม่ใช่ QR สำหรับรับเงิน",
            "minLength": 50
          }
        },
        "required": [
          "qrData"
        ],
        "additionalProperties": false
      },
      "ImageRequest": {
        "type": "object",
        "properties": {
          "imageBase64": {
            "type": "string",
            "description": "ภาพ JPEG, PNG หรือ WEBP แบบ Base64 หรือ Data URI; JSON body ทั้งคำขอไม่เกิน 10 MiB"
          }
        },
        "required": [
          "imageBase64"
        ],
        "additionalProperties": false
      },
      "FileRequest": {
        "type": "object",
        "properties": {
          "file": {
            "type": "string",
            "description": "ไฟล์ JPEG, PNG หรือ WEBP ไม่เกิน 5 MiB (5,242,880 bytes)",
            "format": "binary"
          }
        },
        "required": [
          "file"
        ]
      },
      "BatchItem": {
        "type": "object",
        "properties": {
          "transRef": {
            "type": "string",
            "description": "เลขอ้างอิงจากสลิปจริง อย่างน้อย 10 ตัวอักษร",
            "minLength": 10
          },
          "sendingBank": {
            "type": "string",
            "description": "รหัสธนาคารผู้โอน เก็บเป็นข้อความ 3 หลัก เช่น 014",
            "example": "014"
          },
          "qrData": {
            "type": "string",
            "description": "ข้อความ QR จากสลิป (ถ้ามี)"
          },
          "referenceId": {
            "type": "string",
            "description": "เลขอ้างอิงของคุณ ส่งกลับในผลลัพธ์; ไม่ใช่ idempotency key"
          }
        },
        "required": [
          "transRef",
          "sendingBank"
        ],
        "additionalProperties": false
      },
      "BatchRequest": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/BatchItem"
            },
            "description": "สลิป 1–50 รายการ"
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false
      },
      "BatchImageItem": {
        "type": "object",
        "properties": {
          "imageBase64": {
            "type": "string",
            "description": "ภาพ JPEG, PNG หรือ WEBP แบบ Base64 หรือ Data URI; JSON body ทั้งคำขอไม่เกิน 10 MiB"
          },
          "referenceId": {
            "type": "string",
            "description": "เลขอ้างอิงของคุณ (ไม่บังคับ)"
          }
        },
        "required": [
          "imageBase64"
        ],
        "additionalProperties": false
      },
      "BatchImageRequest": {
        "type": "object",
        "properties": {
          "images": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/BatchImageItem"
            },
            "description": "ภาพแบบ Base64 1–20 ภาพ; รวม JSON ไม่เกิน 10 MiB"
          }
        },
        "required": [
          "images"
        ],
        "additionalProperties": false
      },
      "BatchFileRequest": {
        "type": "object",
        "properties": {
          "files": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "type": "string",
              "format": "binary"
            },
            "description": "ส่ง field files ซ้ำ 1–20 ไฟล์; แต่ละไฟล์ JPEG/PNG/WEBP ไม่เกิน 5 MiB"
          },
          "referenceIds": {
            "type": "string",
            "description": "รายการอ้างอิงคั่นด้วย comma เรียงตามไฟล์ เช่น order-001,order-002"
          }
        },
        "required": [
          "files"
        ]
      },
      "Accepted": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "transactionId": {
                "type": "string",
                "description": "เลขรายการสำหรับติดตามผล"
              },
              "status": {
                "type": "string",
                "description": "รับเข้าคิวหรือกำลังตรวจสอบ",
                "enum": [
                  "PENDING",
                  "PROCESSING"
                ]
              },
              "message": {
                "type": "string",
                "description": "ข้อความประกอบ"
              },
              "qrData": {
                "type": "string",
                "description": "QR ที่อ่านได้จากภาพ (ถ้ามี)"
              }
            },
            "required": [
              "transactionId",
              "status",
              "message"
            ]
          },
          "timestamp": {
            "type": "string",
            "description": "เวลาตอบกลับ ISO 8601 (Asia/Bangkok)",
            "format": "date-time"
          }
        },
        "required": [
          "success",
          "data",
          "timestamp"
        ]
      },
      "Result": {
        "type": "object",
        "properties": {
          "transactionId": {
            "type": "string",
            "description": "เลขรายการ"
          },
          "status": {
            "type": "string",
            "description": "สถานะรายการ",
            "enum": [
              "PENDING",
              "PROCESSING",
              "VERIFIED",
              "FAILED",
              "DUPLICATE",
              "INVALID",
              "INSUFFICIENT_CREDIT"
            ]
          },
          "statusText": {
            "type": "string",
            "description": "ข้อความสถานะ"
          },
          "transRef": {
            "type": "string",
            "description": "เลขอ้างอิงสลิป"
          },
          "amount": {
            "type": "string",
            "description": "ยอดเงินทศนิยมแบบ string เช่น 100.00"
          },
          "paidLocalAmount": {
            "type": "string",
            "description": "ยอดชำระในสกุลเงินท้องถิ่น"
          },
          "paidLocalCurrency": {
            "type": "string",
            "description": "รหัสสกุลเงินแบบตัวเลข เช่น 764"
          },
          "currencyName": {
            "type": "string",
            "description": "ชื่อสกุลเงิน เช่น THB"
          },
          "transferDate": {
            "type": "string",
            "description": "วันเวลาโอน ISO 8601 พร้อมเขตเวลา",
            "format": "date-time"
          },
          "countryCode": {
            "type": "string",
            "description": "รหัสประเทศ"
          },
          "errorMessage": {
            "type": "string",
            "description": "รายละเอียดเมื่อไม่ผ่าน"
          },
          "senderName": {
            "type": "string",
            "description": "ข้อมูลผู้โอน; อาจไม่ส่งกลับหรือถูกปิดบัง"
          },
          "senderDisplayName": {
            "type": "string",
            "description": "ข้อมูลผู้โอน; อาจไม่ส่งกลับหรือถูกปิดบัง"
          },
          "senderAccount": {
            "type": "string",
            "description": "ข้อมูลผู้โอน; อาจไม่ส่งกลับหรือถูกปิดบัง"
          },
          "senderAccountType": {
            "type": "string",
            "description": "ข้อมูลผู้โอน; อาจไม่ส่งกลับหรือถูกปิดบัง"
          },
          "senderProxy": {
            "description": "ข้อมูล proxy จากธนาคาร (รูปแบบอาจต่างกัน)",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "object"
              }
            ]
          },
          "receiverName": {
            "type": "string",
            "description": "ข้อมูลผู้รับ; อาจไม่ส่งกลับหรือถูกปิดบัง"
          },
          "receiverDisplayName": {
            "type": "string",
            "description": "ข้อมูลผู้รับ; อาจไม่ส่งกลับหรือถูกปิดบัง"
          },
          "receiverAccount": {
            "type": "string",
            "description": "ข้อมูลผู้รับ; อาจไม่ส่งกลับหรือถูกปิดบัง"
          },
          "receiverAccountType": {
            "type": "string",
            "description": "ข้อมูลผู้รับ; อาจไม่ส่งกลับหรือถูกปิดบัง"
          },
          "receiverProxy": {
            "description": "ข้อมูล proxy จากธนาคาร (รูปแบบอาจต่างกัน)",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "object"
              }
            ]
          },
          "senderNameMasked": {
            "type": "string",
            "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
          },
          "senderAccountMasked": {
            "type": "string",
            "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
          },
          "sendingBank": {
            "type": "string",
            "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
          },
          "sendingBankName": {
            "type": "string",
            "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
          },
          "receivingBank": {
            "type": "string",
            "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
          },
          "receivingBankName": {
            "type": "string",
            "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
          },
          "ref1": {
            "type": "string",
            "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
          },
          "ref2": {
            "type": "string",
            "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
          },
          "ref3": {
            "type": "string",
            "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
          }
        },
        "required": [
          "transactionId",
          "status",
          "statusText",
          "transRef"
        ]
      },
      "BatchResult": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "results": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "index": {
                      "type": "integer",
                      "description": "ลำดับเริ่มที่ 0"
                    },
                    "referenceId": {
                      "type": "string",
                      "description": "อ้างอิงจากคำขอ"
                    },
                    "transactionId": {
                      "type": "string",
                      "description": "เลขรายการ ถ้ามี"
                    },
                    "transRef": {
                      "type": "string",
                      "description": "เลขอ้างอิงสลิป ถ้ามี"
                    },
                    "status": {
                      "type": "string",
                      "description": "ผลรับคำขอของแต่ละรายการ ไม่ใช่ผลตรวจสุดท้าย",
                      "enum": [
                        "PENDING",
                        "DUPLICATE",
                        "INSUFFICIENT_CREDIT",
                        "INVALID_QR",
                        "ERROR"
                      ]
                    },
                    "message": {
                      "type": "string",
                      "description": "รายละเอียด"
                    },
                    "qrData": {
                      "type": "string",
                      "description": "QR ที่อ่านได้ ถ้ามี"
                    }
                  },
                  "required": [
                    "index",
                    "status",
                    "message"
                  ]
                }
              },
              "submitted": {
                "type": "integer"
              },
              "errors": {
                "type": "integer"
              }
            },
            "required": [
              "results",
              "submitted",
              "errors"
            ]
          },
          "timestamp": {
            "type": "string",
            "description": "เวลาตอบกลับ ISO 8601 (Asia/Bangkok)",
            "format": "date-time"
          }
        },
        "required": [
          "success",
          "data",
          "timestamp"
        ]
      },
      "Bank": {
        "type": "object",
        "properties": {
          "bankCode": {
            "type": "string",
            "description": "รหัสธนาคาร"
          },
          "bankAbbrevEn": {
            "type": "string",
            "description": "ชื่อย่อ"
          },
          "bankNameTh": {
            "type": "string",
            "description": "ชื่อภาษาไทย"
          }
        },
        "required": [
          "bankCode",
          "bankAbbrevEn",
          "bankNameTh"
        ]
      },
      "Error": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "statusCode": {
            "type": "integer"
          },
          "message": {
            "description": "อาจเป็นข้อความ รายการข้อความ หรือ object",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "object"
              }
            ]
          },
          "code": {
            "type": "string",
            "description": "รหัสข้อผิดพลาด ถ้ามี"
          },
          "transactionId": {
            "type": "string",
            "description": "เลขรายการของคุณ ถ้ามี ให้ติดตามก่อนส่งซ้ำ"
          },
          "timestamp": {
            "type": "string",
            "description": "เวลาตอบกลับ",
            "format": "date-time"
          }
        },
        "required": [
          "success",
          "statusCode",
          "message",
          "timestamp"
        ]
      },
      "StatusResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "transactionId": {
                "type": "string",
                "description": "เลขรายการ"
              },
              "status": {
                "type": "string",
                "description": "สถานะรายการ",
                "enum": [
                  "PENDING",
                  "PROCESSING",
                  "VERIFIED",
                  "FAILED",
                  "DUPLICATE",
                  "INVALID",
                  "INSUFFICIENT_CREDIT"
                ]
              },
              "statusText": {
                "type": "string",
                "description": "ข้อความสถานะ"
              },
              "transRef": {
                "type": "string",
                "description": "เลขอ้างอิงสลิป"
              },
              "amount": {
                "type": "string",
                "description": "ยอดเงินทศนิยมแบบ string เช่น 100.00"
              },
              "paidLocalAmount": {
                "type": "string",
                "description": "ยอดชำระในสกุลเงินท้องถิ่น"
              },
              "paidLocalCurrency": {
                "type": "string",
                "description": "รหัสสกุลเงินแบบตัวเลข เช่น 764"
              },
              "currencyName": {
                "type": "string",
                "description": "ชื่อสกุลเงิน เช่น THB"
              },
              "transferDate": {
                "type": "string",
                "description": "วันเวลาโอน ISO 8601 พร้อมเขตเวลา",
                "format": "date-time"
              },
              "countryCode": {
                "type": "string",
                "description": "รหัสประเทศ"
              },
              "errorMessage": {
                "type": "string",
                "description": "รายละเอียดเมื่อไม่ผ่าน"
              },
              "senderName": {
                "type": "string",
                "description": "ข้อมูลผู้โอน; อาจไม่ส่งกลับหรือถูกปิดบัง"
              },
              "senderDisplayName": {
                "type": "string",
                "description": "ข้อมูลผู้โอน; อาจไม่ส่งกลับหรือถูกปิดบัง"
              },
              "senderAccount": {
                "type": "string",
                "description": "ข้อมูลผู้โอน; อาจไม่ส่งกลับหรือถูกปิดบัง"
              },
              "senderAccountType": {
                "type": "string",
                "description": "ข้อมูลผู้โอน; อาจไม่ส่งกลับหรือถูกปิดบัง"
              },
              "senderProxy": {
                "description": "ข้อมูล proxy จากธนาคาร (รูปแบบอาจต่างกัน)",
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "object"
                  }
                ]
              },
              "receiverName": {
                "type": "string",
                "description": "ข้อมูลผู้รับ; อาจไม่ส่งกลับหรือถูกปิดบัง"
              },
              "receiverDisplayName": {
                "type": "string",
                "description": "ข้อมูลผู้รับ; อาจไม่ส่งกลับหรือถูกปิดบัง"
              },
              "receiverAccount": {
                "type": "string",
                "description": "ข้อมูลผู้รับ; อาจไม่ส่งกลับหรือถูกปิดบัง"
              },
              "receiverAccountType": {
                "type": "string",
                "description": "ข้อมูลผู้รับ; อาจไม่ส่งกลับหรือถูกปิดบัง"
              },
              "receiverProxy": {
                "description": "ข้อมูล proxy จากธนาคาร (รูปแบบอาจต่างกัน)",
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "object"
                  }
                ]
              },
              "senderNameMasked": {
                "type": "string",
                "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
              },
              "senderAccountMasked": {
                "type": "string",
                "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
              },
              "sendingBank": {
                "type": "string",
                "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
              },
              "sendingBankName": {
                "type": "string",
                "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
              },
              "receivingBank": {
                "type": "string",
                "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
              },
              "receivingBankName": {
                "type": "string",
                "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
              },
              "ref1": {
                "type": "string",
                "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
              },
              "ref2": {
                "type": "string",
                "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
              },
              "ref3": {
                "type": "string",
                "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
              }
            },
            "required": [
              "transactionId",
              "status",
              "statusText",
              "transRef"
            ],
            "nullable": true,
            "description": "null หากไม่พบรายการในบัญชีของคุณ (ยังตอบ HTTP 200)"
          },
          "timestamp": {
            "type": "string",
            "description": "เวลาตอบกลับ ISO 8601 (Asia/Bangkok)",
            "format": "date-time"
          }
        },
        "required": [
          "success",
          "data",
          "timestamp"
        ]
      },
      "HistoryResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "description": "สถานะรายการ",
                      "enum": [
                        "PENDING",
                        "PROCESSING",
                        "VERIFIED",
                        "FAILED",
                        "DUPLICATE",
                        "INVALID",
                        "INSUFFICIENT_CREDIT"
                      ]
                    },
                    "statusText": {
                      "type": "string",
                      "description": "ข้อความสถานะ"
                    },
                    "transRef": {
                      "type": "string",
                      "description": "เลขอ้างอิงสลิป"
                    },
                    "paidLocalAmount": {
                      "type": "string",
                      "description": "ยอดชำระในสกุลเงินท้องถิ่น"
                    },
                    "paidLocalCurrency": {
                      "type": "string",
                      "description": "รหัสสกุลเงินแบบตัวเลข เช่น 764"
                    },
                    "currencyName": {
                      "type": "string",
                      "description": "ชื่อสกุลเงิน เช่น THB"
                    },
                    "transferDate": {
                      "type": "string",
                      "description": "วันเวลาโอน ISO 8601 พร้อมเขตเวลา",
                      "format": "date-time",
                      "nullable": true
                    },
                    "countryCode": {
                      "type": "string",
                      "description": "รหัสประเทศ"
                    },
                    "senderName": {
                      "type": "string",
                      "description": "ข้อมูลผู้โอน; อาจไม่ส่งกลับหรือถูกปิดบัง",
                      "nullable": true
                    },
                    "senderDisplayName": {
                      "type": "string",
                      "description": "ข้อมูลผู้โอน; อาจไม่ส่งกลับหรือถูกปิดบัง"
                    },
                    "senderAccount": {
                      "type": "string",
                      "description": "ข้อมูลผู้โอน; อาจไม่ส่งกลับหรือถูกปิดบัง",
                      "nullable": true
                    },
                    "senderAccountType": {
                      "type": "string",
                      "description": "ข้อมูลผู้โอน; อาจไม่ส่งกลับหรือถูกปิดบัง"
                    },
                    "senderProxy": {
                      "description": "ข้อมูล proxy จากธนาคาร (รูปแบบอาจต่างกัน)",
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "object"
                        }
                      ]
                    },
                    "receiverName": {
                      "type": "string",
                      "description": "ข้อมูลผู้รับ; อาจไม่ส่งกลับหรือถูกปิดบัง",
                      "nullable": true
                    },
                    "receiverDisplayName": {
                      "type": "string",
                      "description": "ข้อมูลผู้รับ; อาจไม่ส่งกลับหรือถูกปิดบัง"
                    },
                    "receiverAccount": {
                      "type": "string",
                      "description": "ข้อมูลผู้รับ; อาจไม่ส่งกลับหรือถูกปิดบัง",
                      "nullable": true
                    },
                    "receiverAccountType": {
                      "type": "string",
                      "description": "ข้อมูลผู้รับ; อาจไม่ส่งกลับหรือถูกปิดบัง"
                    },
                    "receiverProxy": {
                      "description": "ข้อมูล proxy จากธนาคาร (รูปแบบอาจต่างกัน)",
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "object"
                        }
                      ]
                    },
                    "senderNameMasked": {
                      "type": "string",
                      "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี",
                      "nullable": true
                    },
                    "senderAccountMasked": {
                      "type": "string",
                      "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี",
                      "nullable": true
                    },
                    "sendingBank": {
                      "type": "string",
                      "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
                    },
                    "sendingBankName": {
                      "type": "string",
                      "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
                    },
                    "receivingBank": {
                      "type": "string",
                      "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
                    },
                    "receivingBankName": {
                      "type": "string",
                      "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
                    },
                    "ref1": {
                      "type": "string",
                      "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
                    },
                    "ref2": {
                      "type": "string",
                      "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
                    },
                    "ref3": {
                      "type": "string",
                      "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
                    },
                    "id": {
                      "type": "string",
                      "description": "เลขรายการ ใช้แทน transactionId ในประวัติ"
                    },
                    "verifiedAmount": {
                      "type": "string",
                      "description": "ยอดที่ตรวจสอบแล้ว อาจเป็น null",
                      "nullable": true
                    },
                    "requestSource": {
                      "type": "string",
                      "description": "แหล่งคำขอ",
                      "enum": [
                        "API",
                        "LINE_WEBHOOK",
                        "TELEGRAM_WEBHOOK"
                      ]
                    },
                    "creditDeducted": {
                      "type": "boolean"
                    },
                    "webhookSent": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string",
                      "description": "เวลาสร้างรายการ",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "id",
                    "transRef",
                    "status",
                    "statusText",
                    "requestSource",
                    "creditDeducted",
                    "webhookSent",
                    "createdAt"
                  ]
                }
              },
              "total": {
                "type": "integer"
              },
              "page": {
                "type": "integer"
              },
              "limit": {
                "type": "integer"
              }
            },
            "required": [
              "data",
              "total",
              "page",
              "limit"
            ]
          },
          "timestamp": {
            "type": "string",
            "description": "เวลาตอบกลับ ISO 8601 (Asia/Bangkok)",
            "format": "date-time"
          }
        },
        "required": [
          "success",
          "data",
          "timestamp"
        ]
      },
      "BanksResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean",
                "enum": [
                  true
                ]
              },
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Bank"
                }
              }
            },
            "required": [
              "success",
              "data"
            ]
          },
          "timestamp": {
            "type": "string",
            "description": "เวลาตอบกลับ ISO 8601 (Asia/Bangkok)",
            "format": "date-time"
          }
        },
        "required": [
          "success",
          "data",
          "timestamp"
        ]
      },
      "Webhook": {
        "type": "object",
        "properties": {
          "transactionId": {
            "type": "string",
            "description": "เลขรายการ"
          },
          "status": {
            "type": "string",
            "description": "สถานะรายการ",
            "enum": [
              "PENDING",
              "PROCESSING",
              "VERIFIED",
              "FAILED",
              "DUPLICATE",
              "INVALID",
              "INSUFFICIENT_CREDIT"
            ]
          },
          "statusText": {
            "type": "string",
            "description": "ข้อความสถานะ"
          },
          "transRef": {
            "type": "string",
            "description": "เลขอ้างอิงสลิป"
          },
          "amount": {
            "type": "string",
            "description": "ยอดเงินทศนิยมแบบ string เช่น 100.00"
          },
          "paidLocalAmount": {
            "type": "string",
            "description": "ยอดชำระในสกุลเงินท้องถิ่น"
          },
          "paidLocalCurrency": {
            "type": "string",
            "description": "รหัสสกุลเงินแบบตัวเลข เช่น 764"
          },
          "currencyName": {
            "type": "string",
            "description": "ชื่อสกุลเงิน เช่น THB"
          },
          "transferDate": {
            "type": "string",
            "description": "วันเวลาโอน ISO 8601 พร้อมเขตเวลา",
            "format": "date-time"
          },
          "countryCode": {
            "type": "string",
            "description": "รหัสประเทศ"
          },
          "errorMessage": {
            "type": "string",
            "description": "รายละเอียดเมื่อไม่ผ่าน"
          },
          "senderName": {
            "type": "string",
            "description": "ข้อมูลผู้โอน; อาจไม่ส่งกลับหรือถูกปิดบัง"
          },
          "senderDisplayName": {
            "type": "string",
            "description": "ข้อมูลผู้โอน; อาจไม่ส่งกลับหรือถูกปิดบัง"
          },
          "senderAccount": {
            "type": "string",
            "description": "ข้อมูลผู้โอน; อาจไม่ส่งกลับหรือถูกปิดบัง"
          },
          "senderAccountType": {
            "type": "string",
            "description": "ข้อมูลผู้โอน; อาจไม่ส่งกลับหรือถูกปิดบัง"
          },
          "senderProxy": {
            "description": "ข้อมูล proxy จากธนาคาร (รูปแบบอาจต่างกัน)",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "object"
              }
            ]
          },
          "receiverName": {
            "type": "string",
            "description": "ข้อมูลผู้รับ; อาจไม่ส่งกลับหรือถูกปิดบัง"
          },
          "receiverDisplayName": {
            "type": "string",
            "description": "ข้อมูลผู้รับ; อาจไม่ส่งกลับหรือถูกปิดบัง"
          },
          "receiverAccount": {
            "type": "string",
            "description": "ข้อมูลผู้รับ; อาจไม่ส่งกลับหรือถูกปิดบัง"
          },
          "receiverAccountType": {
            "type": "string",
            "description": "ข้อมูลผู้รับ; อาจไม่ส่งกลับหรือถูกปิดบัง"
          },
          "receiverProxy": {
            "description": "ข้อมูล proxy จากธนาคาร (รูปแบบอาจต่างกัน)",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "object"
              }
            ]
          },
          "senderNameMasked": {
            "type": "string",
            "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
          },
          "senderAccountMasked": {
            "type": "string",
            "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
          },
          "sendingBank": {
            "type": "string",
            "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
          },
          "sendingBankName": {
            "type": "string",
            "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
          },
          "receivingBank": {
            "type": "string",
            "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
          },
          "receivingBankName": {
            "type": "string",
            "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
          },
          "ref1": {
            "type": "string",
            "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
          },
          "ref2": {
            "type": "string",
            "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
          },
          "ref3": {
            "type": "string",
            "description": "ข้อมูลเพิ่มเติมจากธนาคาร ถ้ามี"
          },
          "event": {
            "type": "string",
            "description": "เหตุการณ์",
            "enum": [
              "slip.verified",
              "slip.failed",
              "slip.duplicate"
            ]
          },
          "verifiedAt": {
            "type": "string",
            "description": "เวลาที่เตรียมผลส่ง Webhook ไม่ใช่เวลาโอน",
            "format": "date-time"
          }
        },
        "required": [
          "event",
          "transactionId",
          "transRef",
          "status",
          "statusText",
          "verifiedAt"
        ]
      }
    }
  }
}
