TUNGKAO API docs
Press the button and choose “Save as PDF” as the destination

TUNGKAO API

Slip deposits

API v1 · Last updated: Thailand time (UTC+07:00)

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

You must show a visible “Powered by TUNGKAO” (or “Secured by TUNGKAO” for login/payments) credit linking to https://tungkao.com on pages that use the service, as required by the terms

🏦
API · slip_deposit

Slip deposits

Top-ups for your users: verifies the slip, records the deposit for that user and notifies your site by webhook.

🕒 Last updated: Thailand time (UTC+07:00) · ✅ Your existing code keeps working

🤖 Let an AI write the integration

Copy this link for an AI to read (the whole API as Markdown), or press a button: the prompt is copied and the AI opens — paste it and tell it your language/framework

https://api.tungkao.com/docs/api/slip_deposit.md?lang=en
https://api.tungkao.com/changelog/slip_deposit.json

This link returns this API's updates as JSON (no key, any origin). Have your admin page show it as an “Update announcements” box and flag “New” when last_updated changes

Copy + open in: pressing an AI button copies the prompt automatically — if the chat box is empty, just paste

🔑 Key to use

Create a slip_deposit key in the merchant portal (API keys) and send this header with every request — keys of other services won't work here

Authorization: Bearer $TUNGKAO_KEY

📋 How it works

  1. Set receiving accounts and a webhook URL on the key in the portal.
  2. Send the slip with customer_ref (your user id).
  3. On the deposit.succeeded webhook (verify the signature) credit the user.

📡 API calls + code examples

POST/v1/deposits/slip
curl -X POST https://api.tungkao.com/v1/deposits/slip \
  -H "Authorization: Bearer $TUNGKAO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"qr_payload":"0041000600000101030040220014…","customer_ref":"member-1001","expected_amount":"300.00"}'
GET/v1/deposits/dep_xxx
curl -X GET https://api.tungkao.com/v1/deposits/dep_xxx \
  -H "Authorization: Bearer $TUNGKAO_KEY"

Verify the webhook signature

Every webhook carries X-Tungkao-Signature: t=…,v1=…. Verify it before trusting the data (the webhook secret is shown when you set the URL).

import crypto from "node:crypto";
// use the raw body only — never re-JSON.stringify it
function verify(rawBody, header, secret) {
  const m = /^t=(\d+),v1=([0-9a-f]{64})$/.exec(header || "");
  if (!m || Math.abs(Date.now() / 1000 - Number(m[1])) > 300) return false;
  const want = crypto.createHmac("sha256", secret).update(`${m[1]}.${rawBody}`).digest("hex");
  return crypto.timingSafeEqual(Buffer.from(want), Buffer.from(m[2]));
}

📚 Usage examples

Example 1

Credit a member's deposit

Situation: Member member-1001 deposits 300 THB and attaches the slip

Request
POST /v1/deposits/slip
{
  "image_base64": "<base64 of the slip image>",
  "customer_ref": "member-1001",
  "expected_amount": "300.00"
}
Sample response
{
  "success": true,
  "status": "VALID",
  "data": {
    "deposit_id": "dep_8f2c…",
    "customer_ref": "member-1001",
    "amount": "300.00"
  }
}

➡️ Store deposit_id with the order and credit the member

Example 2

Attach your own data to the deposit

Situation: You want to know which promotion the deposit came from

Request
POST /v1/deposits/slip
{
  "image_base64": "<base64 of the slip image>",
  "customer_ref": "member-1001",
  "metadata": {
    "promo": "NEWYEAR",
    "channel": "app"
  }
}

➡️ metadata comes back in the webhook and when you fetch the deposit

Example 3

Receive the result by webhook

Situation: With a webhook URL on the key, the result is pushed to your site

➡️ Verify the webhook signature before crediting and use deposit_id to avoid double credit

Example 4

Check a deposit later

Situation: Your site missed the webhook or wants to re-check

Request
GET /v1/deposits/dep_8f2c…
Sample response
{
  "success": true,
  "data": {
    "deposit_id": "dep_8f2c…",
    "status": "succeeded"
  }
}

➡️ succeeded = credit · failed = rejected · pending = wait

Example 5

Member resubmits the same slip

Situation: A member tries to deposit again with the same slip

Sample response
{
  "success": false,
  "status": "DUPLICATE"
}

➡️ DUPLICATE; no new deposit is created

📜 Update history of this API

  1. Added Thailand time (UTC+07:00)
    API update announcements by webhook: new api.update event (opt in per key on the key card; off by default)
  2. Added Thailand time (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)
  3. Added Thailand time (UTC+07:00)
    GET /status: per-service API status 🟢 normal / 🟠 high traffic / 🔴 minor delays (no key needed)
  4. Added Thailand time (UTC+07:00)
    Key on/off switch with status-change time + one key per service per website
  5. Improved Thailand time (UTC+07:00)
    API v1 frozen (additive only) + X-Tungkao-Api-Version header + 12-month deprecation notices
  6. Docs Thailand time (UTC+07:00)
    Per-API docs pages with AI links (ChatGPT / Claude / Gemini / Grok) in 10 languages
  7. Security Thailand time (UTC+07:00)
    Domain verification per API key (1 key = 1 site) — existing keys keep working
  8. Added Thailand time (UTC+07:00)
    Optional HMAC request signing — nothing changes unless you turn it on
  9. Added Thailand time (UTC+07:00)
    API key lifetimes, expiry warnings and renewal — the key string never changes
  10. Added Thailand time (UTC+07:00)
    Test-mode keys (simulated, free) for every service
  11. New Thailand time (UTC+07:00)
    Launched slip deposits with webhooks

✅ Your existing code keeps working

🛡️ Stability promise: integrate once, keep working

🚦 System status (GET /status)

Check any time whether the API is healthy — no key needed

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 attribution requirement

Powered by TUNGKAO