{"conventions":["HTTP status is 200 for business outcomes too (e.g. NOT_FOUND, CAPTCHA_FAILED) — branch on the RETURN_CODE field, not the HTTP status.","Non-200 HTTP status only for malformed requests (400), auth failures (401), or wrong method (405).","Authentication (API-key mode): send 'X-API-Key: \u003ckey\u003e' or 'Authorization: Bearer \u003ckey\u003e' on /verify*; missing/invalid/revoked → 401. Create + manage keys at /admin. When no database is configured the API is open.","Append ?debug=1 (or ?verbose=1) to a verify call to also receive the CAPTCHA and META sections.","All amounts are THB and must be \u003e 0."],"description":"Verifies Thai SCB bank-transfer slips against the official upstream checkslip.scb.co.th. Solves the upstream captcha in-process with an embedded CNN (no external solver). POST a slip's QR payload string (/verify) or a slip image (/verify/image) together with the amount you expect; read RETURN_CODE/STATUS and SLIP_DATA from the JSON response.","endpoints":[{"body":{"amount":"number (required, \u003e 0) — the expected transfer amount in THB.","qr":"string (required) — the raw QR/PromptPay payload read off the slip; the bank and transaction ref are parsed from it."},"content_type":"application/json","example":"curl -X POST http://HOST/verify -H 'content-type: application/json' -d '{\"qr\":\"00380006...AABBCC\",\"amount\":100.00}'","method":"POST","path":"/verify","query":{"debug":"optional — 1/true/yes/on to include CAPTCHA + META sections (alias: verbose)"},"summary":"Verify a slip by its QR payload string."},{"content_type":"multipart/form-data","example":"curl -X POST http://HOST/verify/image -F file=@slip.jpg -F amount=100.00","form":{"amount":"number (required, \u003e 0) — expected transfer amount in THB.","file":"file (required) — slip image (PNG/JPEG) containing a scannable QR code."},"method":"POST","path":"/verify/image","query":{"debug":"optional — 1/true/yes/on to include CAPTCHA + META sections (alias: verbose)"},"summary":"Verify a slip by uploading a slip image; the QR is decoded from it (max 8 MiB)."},{"method":"GET","path":"/health","summary":"Liveness probe. Returns {status:ok, n_chars, charset_len}."},{"method":"GET","path":"/","summary":"Web app for browsers (Accept: text/html), or this JSON index for API clients."},{"method":"GET","path":"/openapi.json","summary":"Full OpenAPI 3.1 specification."},{"method":"GET","path":"/admin","summary":"Usage analytics + API-key management dashboard (admin-token gated; requires a database)."}],"openapi":"/openapi.json","response_envelope":{"fields":{"BANK":"string — sending-bank code parsed from the QR.","CAPTCHA":"object — only with ?debug=1.","MESSAGE":"string — human-readable detail / error.","META":"object — model + config echo; only with ?debug=1.","RAW_FIELDS":"object — raw upstream label-\u003evalue pairs (bilingual TH/EN) for anything SLIP_DATA doesn't model.","RETURN_CODE":"string — 4-digit outcome code (see return_codes).","SLIP_DATA":"object — populated on FOUND: VERIFICATION, REF_ID, TXN_INFO{CURRENCY,TXN_DATE,TXN_AMT,DISP_AMT}, SENDER_INFO/RECEIVER_INFO{ACCT_NAME,ACCT_NUM,BANK_NAME}, REFERENCES[].","SOLVER":"object — captcha solve detail (answer, mean/min confidence, weakest_char, attempts, source, per_char[]).","STATUS":"string — enum name matching RETURN_CODE.","TIMING":"object — per-stage latency in ms (total_ms, captcha_load_ms, cnn_solve_ms, verify_ms, fetch_result_ms, prefetched; on /verify/image also qr_decode_ms + total_with_decode_ms).","TRAN":"string — transaction reference parsed from the QR."},"note":"All /verify* responses share this envelope."},"return_codes":{"0000":"FOUND — slip verified, SLIP_DATA returned.","0001":"NOT_FOUND — slip not found upstream.","0002":"INVALID_PARAMS — upstream rejected the params.","7777":"INVALID_QR — QR payload / image couldn't be parsed.","8888":"CAPTCHA_FAILED — captcha rejected after all retries.","8890":"LOW_CONFIDENCE — every solve was below the confidence gate.","9998":"UPSTREAM_ERROR — network / Imperva block / SCB error.","9999":"SYSTEM_ERROR — internal error."},"service":"scb-slip-checker","version":"1.0.0"}
