{
  "info": {
    "name": "Slip's QR Code Verification API",
    "description": "Verifies QR codes printed on Thai bank transfer slips.\n\nSet the two collection variables before sending a request:\n\n- `baseUrl` — the base URL issued to you with your API key\n- `apiKey` — your API key, sent as the `x-api-key` header\n\nEach successful verification consumes one credit from your balance. Failed verifications are free.\n\nNote: a failure inside the external verification network returns HTTP 200 with `status: \"error\"` in the body, so branch on `status` rather than on the HTTP status code alone.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://api.example.com",
      "type": "string",
      "description": "Base URL issued with your API key"
    },
    {
      "key": "apiKey",
      "value": "your_actual_api_key",
      "type": "string",
      "description": "Your API key, sent as the x-api-key header"
    }
  ],
  "item": [
    {
      "name": "Verify slip QR code",
      "request": {
        "method": "POST",
        "header": [
          { "key": "Content-Type", "value": "application/json" },
          { "key": "x-api-key", "value": "{{apiKey}}" }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"qrcode\": \"0002010102115302TH5416Bank_Slip_QR_Data6204ABCD62070503***631041F4\"\n}",
          "options": { "raw": { "language": "json" } }
        },
        "url": {
          "raw": "{{baseUrl}}/api/v1/verify",
          "host": ["{{baseUrl}}"],
          "path": ["api", "v1", "verify"]
        },
        "description": "Submits the raw QR string read from a bank slip and returns the parsed transaction."
      },
      "response": [
        {
          "name": "200 — Verified",
          "originalRequest": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" },
              { "key": "x-api-key", "value": "{{apiKey}}" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"qrcode\": \"0002010102115302TH5416Bank_Slip_QR_Data6204ABCD62070503***631041F4\"\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/verify",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "verify"]
            }
          },
          "status": "OK",
          "code": 200,
          "_postman_previewlanguage": "json",
          "header": [{ "key": "Content-Type", "value": "application/json" }],
          "cookie": [],
          "body": "{\n  \"status\": \"success\",\n  \"data\": {\n    \"amount\": 100.38,\n    \"dateTime\": \"2025-10-05T22:09:59+07:00\",\n    \"timestamp\": 1759676999,\n    \"transactionId\": \"015278220959BPP13419\",\n    \"senderBankAccountNumber\": \"xxxxx1234x\",\n    \"senderName\": \"นาย สมชาย ใจดี\",\n    \"senderNameEN\": \"MR. Somchai Jaidee\",\n    \"senderBank\": \"KBANK\",\n    \"senderBankCode\": \"004\",\n    \"receiverBankAccountNumber\": \"xxxxxxxxx5678\",\n    \"receiverName\": \"บริษัท ร้านค้าตัวอย่าง จำกัด\",\n    \"receiverNameEN\": \"SAMPLE STORE COMPANY LTD\",\n    \"receiverBank\": \"KTB\",\n    \"receiverBankCode\": \"006\",\n    \"receiverPromptpay\": \"xxxxxxxxx5678\",\n    \"receiverProxyType\": \"NATID\",\n    \"rawData\": {\n      \"amount\": \"100.38\",\n      \"transTime\": \"22:09:59\",\n      \"transDate\": \"20251005\",\n      \"transRef\": \"015278220959BPP13419\",\n      \"countryCode\": \"TH\",\n      \"sendingBank\": \"004\",\n      \"receivingBank\": \"006\"\n    }\n  },\n  \"message\": \"Bank slip QR code verified successfully\",\n  \"qrcode\": \"0041000600000101030040220015278220959BPP134195102TH9104B31B\"\n}"
        },
        {
          "name": "401 — Missing API key (1020)",
          "originalRequest": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"qrcode\": \"your_qr_code_data\"\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/verify",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "verify"]
            }
          },
          "status": "Unauthorized",
          "code": 401,
          "_postman_previewlanguage": "json",
          "header": [{ "key": "Content-Type", "value": "application/json" }],
          "cookie": [],
          "body": "{\n  \"status\": \"error\",\n  \"code\": 1020,\n  \"message\": \"api key is missing\"\n}"
        },
        {
          "name": "401 — Invalid API key (1021)",
          "originalRequest": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" },
              { "key": "x-api-key", "value": "not_a_real_key" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"qrcode\": \"your_qr_code_data\"\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/verify",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "verify"]
            }
          },
          "status": "Unauthorized",
          "code": 401,
          "_postman_previewlanguage": "json",
          "header": [{ "key": "Content-Type", "value": "application/json" }],
          "cookie": [],
          "body": "{\n  \"status\": \"error\",\n  \"code\": 1021,\n  \"message\": \"invalid api key\"\n}"
        },
        {
          "name": "400 — User not found (1022)",
          "originalRequest": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" },
              { "key": "x-api-key", "value": "{{apiKey}}" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"qrcode\": \"your_qr_code_data\"\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/verify",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "verify"]
            }
          },
          "status": "Bad Request",
          "code": 400,
          "_postman_previewlanguage": "json",
          "header": [{ "key": "Content-Type", "value": "application/json" }],
          "cookie": [],
          "body": "{\n  \"status\": \"error\",\n  \"code\": 1022,\n  \"message\": \"user not found\"\n}"
        },
        {
          "name": "400 — Insufficient balance (1023)",
          "originalRequest": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" },
              { "key": "x-api-key", "value": "{{apiKey}}" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"qrcode\": \"your_qr_code_data\"\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/verify",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "verify"]
            }
          },
          "status": "Bad Request",
          "code": 400,
          "_postman_previewlanguage": "json",
          "header": [{ "key": "Content-Type", "value": "application/json" }],
          "cookie": [],
          "body": "{\n  \"status\": \"error\",\n  \"code\": 1023,\n  \"message\": \"insufficient fund\"\n}"
        },
        {
          "name": "200 — Verification service error",
          "originalRequest": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" },
              { "key": "x-api-key", "value": "{{apiKey}}" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"qrcode\": \"your_qr_code_data\"\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/verify",
              "host": ["{{baseUrl}}"],
              "path": ["api", "v1", "verify"]
            }
          },
          "status": "OK",
          "code": 200,
          "_postman_previewlanguage": "json",
          "header": [{ "key": "Content-Type", "value": "application/json" }],
          "cookie": [],
          "body": "{\n  \"status\": \"error\",\n  \"message\": \"verification service timed out\"\n}"
        }
      ]
    }
  ]
}
