TUNGKAO ឯកសារ API
ចុចប៊ូតុង ហើយជ្រើស “Save as PDF”

TUNGKAO API

ពិនិត្យវិក្កយបត្រធនាគារ

API v1 · ធ្វើបច្ចុប្បន្នភាពចុងក្រោយ: ម៉ោងប្រទេសថៃ (UTC+07:00)

https://tungkao.com · https://api.tungkao.com/docs

ត្រូវបង្ហាញ “Powered by TUNGKAO” ភ្ជាប់ទៅ https://tungkao.com នៅលើទំព័រដែលប្រើសេវា

🧾
API · slip_verify

ពិនិត្យវិក្កយបត្រធនាគារ

ពិនិត្យថាវិក្កយបត្រពិត ចំនួនត្រូវ ផ្ទេរមកអ្នក និងមិនទាន់ប្រើ — សម្រាប់ហាងដែលអតិថិជនភ្ជាប់វិក្កយបត្រ

🕒 ធ្វើបច្ចុប្បន្នភាពចុងក្រោយ: ម៉ោងប្រទេសថៃ (UTC+07:00) · ✅ កូដចាស់នៅដំណើរការ មិនចាំបាច់កែ

🤖 ឱ្យ AI សរសេរកូដភ្ជាប់

ចម្លងតំណនេះឱ្យ AI អាន ឬចុចប៊ូតុង ប្រព័ន្ធនឹងចម្លងពាក្យបញ្ជា ហើយបើក AI

https://api.tungkao.com/docs/api/slip_verify.md?lang=km
https://api.tungkao.com/changelog/slip_verify.json

តំណនេះផ្ដល់បច្ចុប្បន្នភាពរបស់ API នេះជា JSON (មិនត្រូវការ key បើកពីគ្រប់ដែន)។ បង្ហាញក្នុងទំព័រគ្រប់គ្រងជាប្រអប់ “ប្រកាសបច្ចុប្បន្នភាព” ហើយដាក់ “ថ្មី” ពេល last_updated ប្ដូរ

ChatGPT ↗Claude ↗Gemini ↗Grok ↗

ចម្លង + បើកក្នុង: ចុចប៊ូតុង AI ប្រព័ន្ធនឹងចម្លងពាក្យបញ្ជា បើប្រអប់ជជែកទទេ គ្រាន់តែបិទភ្ជាប់

🔑 key ដែលត្រូវប្រើ

បង្កើត key slip_verify នៅផតថលអាជីវករ (API key) ហើយផ្ញើ header នេះគ្រប់សំណើ — key សេវាផ្សេងមិនដំណើរការនៅទីនេះ

Authorization: Bearer $TUNGKAO_KEY

📋 ជំហាន

  1. អតិថិជនបង្ហោះវិក្កយបត្រ គេហទំព័រអានអត្ថបទ QR (ចាប់ផ្ដើម 0041…)
  2. ផ្ញើ qr_payload ចំនួនរំពឹង និងគណនីទទួលទៅ API
  3. ទទួលការបញ្ជាទិញតែពេល status = VALID

📡 ការហៅ API + គំរូកូដ

POST/v1/slip/verify
curl -X POST https://api.tungkao.com/v1/slip/verify \
  -H "Authorization: Bearer $TUNGKAO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"qr_payload":"0041000600000101030040220014…","expected_amount":"500.00","receivers":[{"bank":"KBANK","account_number":"1234567890"}]}'

📖 សង្ខេប៖ ប្រើ key ជាមួយគេហទំព័រច្រើន លទ្ធផលយ៉ាងដូចម្ដេច

ករណីការកំណត់ key (ទំព័រ API Keys)លទ្ធផល
គេហទំព័រ ២ (aaa.com, bbb.com) ទទួលប្រាក់ចូលគណនីតែមួយkey ទាំងពីរ៖ ក្រុម A (ឬ គណនីទាំងមូល)វិក្កយបត្រដែលឆ្លងនៅ aaa.com នឹងទទួល DUPLICATE នៅ bbb.com — ប្រើបានតែគេហទំព័រមួយ ✅
គេហទំព័រ ២ គណនីតែមួយ ប៉ុន្តែ key ដាច់ដោយឡែក (លំនាំដើម)key ទាំងពីរ៖ តែ key នេះវិក្កយបត្រមួយឆ្លងទាំងពីរគេហទំព័រ ⚠️ អតិថិជនអាចបញ្ចូលពីរដង — សូមភ្ជាប់ key
គេហទំព័រ ២ មានគណនីទទួលប្រាក់ខុសគ្នាតែ key នេះ (លំនាំដើម)វិក្កយបត្ររបស់គេហទំព័រមួយ នៅគេហទំព័រមួយទៀតទទួល RECEIVER_MISMATCH រួចហើយ ✅
គេហទំព័រ ២ នៅគណនី tungkao ខុសគ្នា (ម្ចាស់ខុសគ្នា) ប៉ុន្តែគណនីទទួលប្រាក់ដូចគ្នាមិនអាចភ្ជាប់ key ឆ្លងគណនី tungkao បានទេវិក្កយបត្រមួយឆ្លងទាំងពីរ ⚠️ — ទិញ key ទាំងពីរពីគណនី tungkao តែមួយ ហើយភ្ជាប់
គេហទំព័រមួយប្រើ key ២ (ឧ. គេហទំព័រ + កម្មវិធី)key ទាំងពីរ៖ ក្រុមដូចគ្នាវិក្កយបត្រប្រើបានម្ដង មិនថាផ្ញើពីគេហទំព័រ ឬកម្មវិធី ✅

DUPLICATE ត្រូវបានរកឃើញភ្លាមពីលេខយោងក្នុង QR។ កំណត់នៅកាត “ការពារវិក្កយបត្រស្ទួនរវាង key” ក្នុងទំព័រ API Keys (key ថ្មីលំនាំដើម៖ តែ key នេះ)

📚 ឧទាហរណ៍ការប្រើ

ឧទាហរណ៍ 1

Customer tops up with a matching slip (passes)

ស្ថានការណ៍: A customer transfers 500 THB to your account and uploads the slip on your top-up page

សំណើ
POST /v1/slip/verify
{
  "image_base64": "<base64 of the slip image>",
  "expected_amount": "500.00"
}
ឧទាហរណ៍ចម្លើយ
{
  "success": true,
  "status": "VALID",
  "data": {
    "trans_ref": "2025111612345678",
    "amount": "500.00",
    "currency": "THB"
  },
  "billing": {
    "credits_charged": 250
  }
}

➡️ VALID → credit the customer now; the slip is marked as used

ឧទាហរណ៍ 2

Send the QR text instead of the image (faster)

ស្ថានការណ៍: Your app reads the QR on the slip itself and sends only the QR text

សំណើ
POST /v1/slip/verify
{
  "qr_payload": "0041000600000101030040220014242082547BPM04988…",
  "expected_amount": "500.00"
}

➡️ Same result as sending the image, smaller and faster. If you have the image, send it: some backup providers verify from the image

ឧទាហរណ៍ 3

The customer sends the same slip again

ស្ថានការណ៍: The customer attaches the same 500 THB slip again to top up twice

សំណើ
POST /v1/slip/verify
{
  "image_base64": "<base64 of the slip image>",
  "expected_amount": "500.00"
}
ឧទាហរណ៍ចម្លើយ
{
  "success": false,
  "status": "DUPLICATE",
  "message": "This slip has already been used"
}

➡️ DUPLICATE → do not credit; tell the customer the slip was already used

ឧទាហរណ៍ 4

Wrong amount or wrong account

ស្ថានការណ៍: The customer paid 300 THB for a 500 THB order, or paid another account

សំណើ
POST /v1/slip/verify
{
  "image_base64": "<base64 of the slip image>",
  "expected_amount": "500.00",
  "receivers": [
    {
      "bank": "KBANK",
      "account_number": "123-4-56789-0"
    }
  ]
}
ឧទាហរណ៍ចម្លើយ
{
  "success": false,
  "status": "AMOUNT_MISMATCH"
}

➡️ AMOUNT_MISMATCH = wrong amount · RECEIVER_MISMATCH = other account. The slip is not marked as used, so the customer can retry with the right one

ឧទាហរណ៍ 5

Slip is too old

ស្ថានការណ៍: You only accept slips paid within the last 30 minutes

សំណើ
POST /v1/slip/verify
{
  "image_base64": "<base64 of the slip image>",
  "expected_amount": "500.00",
  "max_age_minutes": 30
}
ឧទាហរណ៍ចម្លើយ
{
  "success": false,
  "status": "DATE_MISMATCH"
}

➡️ DATE_MISMATCH when the slip is older than allowed

ឧទាហរណ៍ 6

Two sites, one receiving account

ស្ថានការណ៍: aaa.com and bbb.com use different keys but receive into the same account

➡️ Put both keys in one group on the “Duplicate-slip protection between keys” card → a slip that passed on aaa.com returns DUPLICATE on bbb.com

ឧទាហរណ៍ 7

Every verifier is down

ស្ថានការណ៍: All upstream verifiers fail at once (rare; backups are tried first)

ឧទាហរណ៍ចម្លើយ
{
  "success": false,
  "status": "SERVICE_UNAVAILABLE"
}

➡️ HTTP 503 and nothing is charged. Ask the customer to retry later, or queue it for manual review

💡 បន្ថែម

📜 ប្រវត្តិបច្ចុប្បន្នភាព API នេះ

  1. បន្ថែម ម៉ោងប្រទេសថៃ (UTC+07:00)
    Duplicate-slip protection between keys is now configurable: this key only / group A–E / whole account — for several sites that receive into the same account
  2. បន្ថែម ម៉ោងប្រទេសថៃ (UTC+07:00)
    API update announcements by webhook: new api.update event (opt in per key on the key card; off by default)
  3. បន្ថែម ម៉ោងប្រទេសថៃ (UTC+07:00)
    error.user_message: ready-to-show text for end users on outages, no credits or key problems (white-label keys omit tungkao.com)
  4. បន្ថែម ម៉ោងប្រទេសថៃ (UTC+07:00)
    GET /status៖ ស្ថានភាព API តាមសេវា (មិនត្រូវការ key)
  5. បន្ថែម ម៉ោងប្រទេសថៃ (UTC+07:00)
    កុងតាក់បើក/បិទ key និងម៉ោងប្ដូរ + គេហទំព័រ 1 key 1 សម្រាប់សេវានីមួយៗ
  6. កែលម្អ ម៉ោងប្រទេសថៃ (UTC+07:00)
    ចាក់សោ API v1 ជាអចិន្ត្រៃយ៍ (បន្ថែមតែប៉ុណ្ណោះ) + header X-Tungkao-Api-Version + ជូនដំណឹងមុន 12 ខែ
  7. ឯកសារ ម៉ោងប្រទេសថៃ (UTC+07:00)
    ទំព័រឯកសារតាម API និងតំណ AI (10 ភាសា)
  8. សុវត្ថិភាព ម៉ោងប្រទេសថៃ (UTC+07:00)
    ផ្ទៀងផ្ទាត់ domain តាម API key (key 1 = គេហទំព័រ 1) — key ចាស់នៅដំណើរការ
  9. បន្ថែម ម៉ោងប្រទេសថៃ (UTC+07:00)
    ចុះហត្ថលេខា HMAC ជាជម្រើស — មិនបើកក៏ដូចដើម
  10. បន្ថែម ម៉ោងប្រទេសថៃ (UTC+07:00)
    រយៈពេល API key ការជូនដំណឹង និងការបន្ត — key ដដែល
  11. បន្ថែម ម៉ោងប្រទេសថៃ (UTC+07:00)
    key របៀប test (សាកល្បង ឥតគិតថ្លៃ) គ្រប់សេវា
  12. ថ្មី ម៉ោងប្រទេសថៃ (UTC+07:00)
    បើក API v1 ពិនិត្យវិក្កយបត្រ (ប្ដូរអ្នកផ្ដល់ 3 ដោយស្វ័យប្រវត្តិ)

✅ កូដចាស់នៅដំណើរការ មិនចាំបាច់កែ

🛡️ ការសន្យាស្ថិរភាព៖ ភ្ជាប់ម្ដង ប្រើបានជានិច្ច

🚦 ស្ថានភាពប្រព័ន្ធ (GET /status)

ពិនិត្យថា API ធម្មតាឬទេ គ្រប់ពេល — មិនត្រូវការ key

GET https://api.tungkao.com/status

curl https://api.tungkao.com/status
{
  "success": true,
  "data": {
    "status": "ok",
    "services": [
      { "id": "slip_verify", "status": "ok", "routes": ["ok", "ok", "busy"] },
      { "id": "slip_deposit", "status": "ok", "routes": ["ok", "ok", "busy"] },
      { "id": "login", "status": "ok" },
      { "id": "telegram", "status": "ok" },
      { "id": "discord", "status": "ok" },
      { "id": "email", "status": "busy" },
      { "id": "crypto", "status": "ok" },
      { "id": "core", "status": "ok" }
    ],
    "paused": [],
    "updated_at": "2026-11-14T12:00:00.000Z"
  }
}

🏷️ លក្ខខណ្ឌដាក់ក្រេឌីត TUNGKAO

Powered by TUNGKAO