⬇️ PDF ဒေါင်းလုဒ် ခလုတ်နှိပ်ပြီး “Save as PDF” ကိုရွေးပါ
TUNGKAO API Complete API reference
API v1 · နောက်ဆုံးအပ်ဒိတ်: ၂၀၂၆ နို ၂၁ ၁၆:၃၀ ထိုင်းစံတော်ချိန် (UTC+07:00)
https://tungkao.com · https://api.tungkao.com/docs
ဝန်ဆောင်မှုသုံးသော စာမျက်နှာတွင် https://tungkao.com သို့ လင့်ခ်ပါသော “Powered by TUNGKAO” ကို ပြရမည်
TUNGKAO နှင့် ချိတ်ဆက်ရန် service အားလုံးအတွက် API ပုံစံတစ်ခုတည်း — Base URL: https://api.tungkao.com
🕒 ချန်နယ်အလိုက် နောက်ဆုံး API အပ်ဒိတ် စနစ်တစ်ခုလုံး နောက်ဆုံးအပ်ဒိတ်: ၂၀၂၆ နို ၂၁ ၁၆:၃၀ ထိုင်းစံတော်ချိန် (UTC+07:00) — 📘 The TrueMoney Wallet docs page is now fully translated into all 10 languages (steps, examples, case table, notes)
✅ ကုဒ်ဟောင်း ဆက်သုံးနိုင် · /changelog.json (စက်ဖတ်နိုင်သော)
📋 Copy all updates for your AI Paste it into the AI that maintains your site's code (ChatGPT / Claude / Gemini); it checks and changes only what is needed
🧾 ဘဏ်စလစ်စစ်ဆေးခြင်း ၂၀၂၆ နို ၁၇ ၁၀:၃၀ ထိုင်းစံတော်ချိန် (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 TrueMoney Wallet စလစ်စစ် ၂၀၂၆ နို ၂၁ ၁၆:၃၀ ထိုင်းစံတော်ချိန် (UTC+07:00) 📘 The TrueMoney Wallet docs page is now fully translated into all 10 languages (steps, examples, case table, notes) 🏦 စလစ်ဖြင့်ငွေသွင်းခြင်း ၂၀၂၆ နို ၁၂ ၀၀:၁၉ ထိုင်းစံတော်ချိန် (UTC+07:00) စလစ်ဖြင့်ငွေသွင်း + webhook စတင် ₿ Crypto ငွေပေးချေမှု ၂၀၂၆ နို ၁၂ ၂၂:၃၃ ထိုင်းစံတော်ချိန် (UTC+07:00) Ethereum, Polygon, Arbitrum, Base, Optimism, Avalanche ကွန်ရက်နှင့် USDC ထည့် Telegram အသိပေးချက် ၂၀၂၆ နို ၁၅ ၁၀:၄၅ ထိုင်းစံတော်ချိန် (UTC+07:00) Telegram / Discord notifications: step-by-step setup guide on the key card and in the docs (Telegram connect link, add a Discord channel webhook) Discord အသိပေးချက် ၂၀၂၆ နို ၁၅ ၁၀:၄၅ ထိုင်းစံတော်ချိန် (UTC+07:00) Telegram / Discord notifications: step-by-step setup guide on the key card and in the docs (Telegram connect link, add a Discord channel webhook) 📧 အီးမေးလ်ပို့ + OTP + SMTP ၂၀၂၆ နို ၁၄ ၀၉:၁၂ ထိုင်းစံတော်ချိန် (UTC+07:00) အီးမေးလ်ဝန်ဆောင်မှု စတင်: API + SMTP + OTP Google ဖြင့် ဝင်ရောက် ၂၀၂၆ နို ၂၀ ၁၉:၃၀ ထိုင်းစံတော်ချိန် (UTC+07:00) 🖼️ Show your own logo on the sign-in page, per key (50×50, auto-cropped and resized). Billed monthly: buy 1–11 months or 1 / 2 / 3 years. Hiding the credit now offers the same periods. LINE ဖြင့် ဝင်ရောက် ၂၀၂၆ နို ၂၀ ၁၉:၃၀ ထိုင်းစံတော်ချိန် (UTC+07:00) 🖼️ Show your own logo on the sign-in page, per key (50×50, auto-cropped and resized). Billed monthly: buy 1–11 months or 1 / 2 / 3 years. Hiding the credit now offers the same periods. Facebook ဖြင့် ဝင်ရောက် ၂၀၂၆ နို ၂၀ ၁၉:၃၀ ထိုင်းစံတော်ချိန် (UTC+07:00) 🖼️ Show your own logo on the sign-in page, per key (50×50, auto-cropped and resized). Billed monthly: buy 1–11 months or 1 / 2 / 3 years. Hiding the credit now offers the same periods. TikTok ဖြင့် ဝင်ရောက် ၂၀၂၆ နို ၂၀ ၁၉:၃၀ ထိုင်းစံတော်ချိန် (UTC+07:00) 🖼️ Show your own logo on the sign-in page, per key (50×50, auto-cropped and resized). Billed monthly: buy 1–11 months or 1 / 2 / 3 years. Hiding the credit now offers the same periods. Discord ဖြင့် ဝင်ရောက် ၂၀၂၆ နို ၂၀ ၁၉:၃၀ ထိုင်းစံတော်ချိန် (UTC+07:00) 🖼️ Show your own logo on the sign-in page, per key (50×50, auto-cropped and resized). Billed monthly: buy 1–11 months or 1 / 2 / 3 years. Hiding the credit now offers the same periods. Telegram ဖြင့် ဝင်ရောက် ၂၀၂၆ နို ၂၀ ၁၉:၃၀ ထိုင်းစံတော်ချိန် (UTC+07:00) 🖼️ Show your own logo on the sign-in page, per key (50×50, auto-cropped and resized). Billed monthly: buy 1–11 months or 1 / 2 / 3 years. Hiding the credit now offers the same periods. X (Twitter) ဖြင့် ဝင်ရောက် ၂၀၂၆ နို ၂၀ ၁၉:၃၀ ထိုင်းစံတော်ချိန် (UTC+07:00) 🖼️ Show your own logo on the sign-in page, per key (50×50, auto-cropped and resized). Billed monthly: buy 1–11 months or 1 / 2 / 3 years. Hiding the credit now offers the same periods. Microsoft ဖြင့် ဝင်ရောက် ၂၀၂၆ နို ၁၇ ၁၁:၀၀ ထိုင်းစံတော်ချိန် (UTC+07:00) Sign-in: choose whether user IDs are combined or separate between keys (whole account / group A–E / separate). New keys default to combined; keys that already have sign-ins stay in their group GitHub ဖြင့် ဝင်ရောက် ၂၀၂၆ နို ၁၇ ၁၁:၀၀ ထိုင်းစံတော်ချိန် (UTC+07:00) Sign-in: choose whether user IDs are combined or separate between keys (whole account / group A–E / separate). New keys default to combined; keys that already have sign-ins stay in their group Apple ဖြင့် ဝင်ရောက် ၂၀၂၆ နို ၁၇ ၁၁:၀၀ ထိုင်းစံတော်ချိန် (UTC+07:00) Sign-in: choose whether user IDs are combined or separate between keys (whole account / group A–E / separate). New keys default to combined; keys that already have sign-ins stay in their group Steam ဖြင့် ဝင်ရောက် ၂၀၂၆ နို ၁၇ ၁၁:၀၀ ထိုင်းစံတော်ချိန် (UTC+07:00) Sign-in: choose whether user IDs are combined or separate between keys (whole account / group A–E / separate). New keys default to combined; keys that already have sign-ins stay in their group Twitch ဖြင့် ဝင်ရောက် ၂၀၂၆ နို ၂၀ ၁၉:၃၀ ထိုင်းစံတော်ချိန် (UTC+07:00) 🖼️ Show your own logo on the sign-in page, per key (50×50, auto-cropped and resized). Billed monthly: buy 1–11 months or 1 / 2 / 3 years. Hiding the credit now offers the same periods. LinkedIn ဖြင့် ဝင်ရောက် ၂၀၂၆ နို ၂၀ ၁၉:၃၀ ထိုင်းစံတော်ချိန် (UTC+07:00) 🖼️ Show your own logo on the sign-in page, per key (50×50, auto-cropped and resized). Billed monthly: buy 1–11 months or 1 / 2 / 3 years. Hiding the credit now offers the same periods. Kakao ဖြင့် ဝင်ရောက် ၂၀၂၆ နို ၂၀ ၁၉:၃၀ ထိုင်းစံတော်ချိန် (UTC+07:00) 🖼️ Show your own logo on the sign-in page, per key (50×50, auto-cropped and resized). Billed monthly: buy 1–11 months or 1 / 2 / 3 years. Hiding the credit now offers the same periods. NAVER ဖြင့် ဝင်ရောက် ၂၀၂၆ နို ၂၀ ၁၉:၃၀ ထိုင်းစံတော်ချိန် (UTC+07:00) 🖼️ Show your own logo on the sign-in page, per key (50×50, auto-cropped and resized). Billed monthly: buy 1–11 months or 1 / 2 / 3 years. Hiding the credit now offers the same periods. Zalo ဖြင့် ဝင်ရောက် ၂၀၂၆ နို ၂၀ ၁၉:၃၀ ထိုင်းစံတော်ချိန် (UTC+07:00) 🖼️ Show your own logo on the sign-in page, per key (50×50, auto-cropped and resized). Billed monthly: buy 1–11 months or 1 / 2 / 3 years. Hiding the credit now offers the same periods. Spotify ဖြင့် ဝင်ရောက် ၂၀၂၆ နို ၂၀ ၁၉:၃၀ ထိုင်းစံတော်ချိန် (UTC+07:00) 🖼️ Show your own logo on the sign-in page, per key (50×50, auto-cropped and resized). Billed monthly: buy 1–11 months or 1 / 2 / 3 years. Hiding the credit now offers the same periods. Reddit ဖြင့် ဝင်ရောက် ၂၀၂၆ နို ၂၀ ၁၉:၃၀ ထိုင်းစံတော်ချိန် (UTC+07:00) 🖼️ Show your own logo on the sign-in page, per key (50×50, auto-cropped and resized). Billed monthly: buy 1–11 months or 1 / 2 / 3 years. Hiding the credit now offers the same periods. GitLab ဖြင့် ဝင်ရောက် ၂၀၂၆ နို ၁၇ ၁၁:၀၀ ထိုင်းစံတော်ချိန် (UTC+07:00) Sign-in: choose whether user IDs are combined or separate between keys (whole account / group A–E / separate). New keys default to combined; keys that already have sign-ins stay in their group Roblox ဖြင့် ဝင်ရောက် ၂၀၂၆ နို ၂၀ ၁၉:၃၀ ထိုင်းစံတော်ချိန် (UTC+07:00) 🖼️ Show your own logo on the sign-in page, per key (50×50, auto-cropped and resized). Billed monthly: buy 1–11 months or 1 / 2 / 3 years. Hiding the credit now offers the same periods. Epic Games ဖြင့် ဝင်ရောက် ၂၀၂၆ နို ၁၇ ၁၁:၀၀ ထိုင်းစံတော်ချိန် (UTC+07:00) Sign-in: choose whether user IDs are combined or separate between keys (whole account / group A–E / separate). New keys default to combined; keys that already have sign-ins stay in their group Yahoo ဖြင့် ဝင်ရောက် ၂၀၂၆ နို ၁၇ ၁၁:၀၀ ထိုင်းစံတော်ချိန် (UTC+07:00) Sign-in: choose whether user IDs are combined or separate between keys (whole account / group A–E / separate). New keys default to combined; keys that already have sign-ins stay in their group Slack ဖြင့် ဝင်ရောက် ၂၀၂၆ နို ၁၇ ၁၁:၀၀ ထိုင်းစံတော်ချိန် (UTC+07:00) Sign-in: choose whether user IDs are combined or separate between keys (whole account / group A–E / separate). New keys default to combined; keys that already have sign-ins stay in their group Amazon ဖြင့် ဝင်ရောက် ၂၀၂၆ နို ၁၇ ၁၁:၀၀ ထိုင်းစံတော်ချိန် (UTC+07:00) Sign-in: choose whether user IDs are combined or separate between keys (whole account / group A–E / separate). New keys default to combined; keys that already have sign-ins stay in their group
service အားလုံး အတူတူပင်: ကုန်သည်ပေါ်တယ်တွင် API key ဖန်တီး (service တစ်ခုလျှင် key တစ်ခု) ပြီး request တိုင်း၏ Authorization header တွင်ပို့ပါ
အလုပ်လုပ်ပုံ app.tungkao.com တွင် Gmail ဖြင့်ဝင်ပြီး ခရက်ဒစ်ဖြည့်ပါ (1 ဘတ် = 100 ခရက်ဒစ်) API key → service ကတ်ရွေး → key သက်တမ်းရွေး → ဖန်တီး → key ကူး (တစ်ကြိမ်သာပြ) key ကို server တွင်သိမ်းပါ (TUNGKAO_KEY ပတ်ဝန်းကျင်ကိန်းရှင်)၊ ဝဘ်စာမျက်နှာ သို့ မိုဘိုင်းအက်ပ်တွင် ဘယ်တော့မှမထည့်ပါနှင့် test key (tk_test_…) ဖြင့်စပါ — ခရက်ဒစ်မကောက် — ပြီးမှ live သို့ပြောင်းပါ
GET /v1/account — key စမ်းရန်: ကျန်ခရက်ဒစ်
curl Node.js PHP Python
ကူးရန်
curl -X GET https://api.tungkao.com/v1/account \
-H "Authorization: Bearer $TUNGKAO_KEY"// Node.js 18+ (nothing to install)
const res = await fetch("https://api.tungkao.com/v1/account", {
method: "GET",
headers: { Authorization: `Bearer ${process.env.TUNGKAO_KEY}` },
});
const data = await res.json();
console.log(data);<?php
$ch = curl_init("https://api.tungkao.com/v1/account");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("TUNGKAO_KEY")],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);import os, requests # pip install requests
r = requests.get(
"https://api.tungkao.com/v1/account",
headers={"Authorization": f"Bearer {os.environ['TUNGKAO_KEY']}"},
timeout=30,
)
print(r.json())
Request လက်မှတ် (ဖွင့်ထားလျှင်) Node.js PHP Python
ကူးရန်
import crypto from "node:crypto";
async function tungkao(method, path, body) {
const raw = body ? JSON.stringify(body) : "";
const ts = Math.floor(Date.now() / 1000).toString();
const hash = crypto.createHash("sha256").update(raw).digest("hex");
const sig = crypto.createHmac("sha256", process.env.TUNGKAO_SIGNING_SECRET).update(`${ts}.${method}.${path}.${hash}`).digest("hex");
const r = await fetch("https://api.tungkao.com" + path, { method, body: raw || undefined, headers: {
Authorization: `Bearer ${process.env.TUNGKAO_KEY}`, "Content-Type": "application/json",
"X-Tungkao-Timestamp": ts, "X-Tungkao-Signature": sig } });
return r.json();
}
console.log(await tungkao("GET", "/v1/account"));<?php
function tungkao(string $method, string $path, ?array $body = null) {
$raw = $body ? json_encode($body) : "";
$ts = (string) time();
$sig = hash_hmac("sha256", "$ts.$method.$path." . hash("sha256", $raw), getenv("TUNGKAO_SIGNING_SECRET"));
$ch = curl_init("https://api.tungkao.com" . $path);
curl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => $method, CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => $raw ?: null,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("TUNGKAO_KEY"), "Content-Type: application/json", "X-Tungkao-Timestamp: $ts", "X-Tungkao-Signature: $sig"]]);
return json_decode(curl_exec($ch), true);
}
print_r(tungkao("GET", "/v1/account"));import hashlib, hmac, json, os, time, requests
def tungkao(method, path, body=None):
raw = json.dumps(body, separators=(",", ":")) if body else ""
ts = str(int(time.time()))
msg = f"{ts}.{method}.{path}.{hashlib.sha256(raw.encode()).hexdigest()}"
sig = hmac.new(os.environ["TUNGKAO_SIGNING_SECRET"].encode(), msg.encode(), hashlib.sha256).hexdigest()
return requests.request(method, "https://api.tungkao.com" + path, data=raw or None, timeout=30, headers={
"Authorization": f"Bearer {os.environ['TUNGKAO_KEY']}", "Content-Type": "application/json",
"X-Tungkao-Timestamp": ts, "X-Tungkao-Signature": sig}).json()
print(tungkao("GET", "/v1/account"))
တုံ့ပြန်မှုတိုင်း success နှင့် request_id ပါ JSON ဖြစ်သည်။ အမှားတွင် error.code (ဥပမာ KEY_EXPIRED, INSUFFICIENT_CREDITS) ပါ — /errors ကြည့်ပါ error.user_message is the text to show your own end users (“The system cannot connect to the tungkao.com API. Please contact the administrator.”). It comes with errors an end user cannot fix: HTTP 5xx, SERVICE_PAUSED, INSUFFICIENT_CREDITS and key problems, in the Accept-Language language. Keys with white-label enabled get a message without the tungkao.com name. If the API cannot be reached at all (timeout/network down), show the same text from your own code. key သည် ရွေးထားသည့်အတိုင်း (1–24 လ သို့ သက်တမ်းမကုန်) ကုန်ဆုံးသည်။ 30/7/1 ရက်အလိုတွင် api_key.expiring webhook ဖြင့်သတိပေးသည်။ ပေါ်တယ်တွင်တိုးနိုင်ပြီး key စာသားမပြောင်း Domain အတည်ပြု: live key တစ်ခုစီသည် website တစ်ခုနှင့်ချိတ်သည်။ API key → 'Domain အတည်ပြု' → domain ထည့်၍ tungkao-verify-….html ကို https://သင့်domain/ တွင်တင် (သို့ DNS TXT _tungkao-verify.သင့်domain ထည့်) ပြီး အတည်ပြုနှိပ်ပါ။ မအတည်ပြုသော key သည် DOMAIN_NOT_VERIFIED ရ၊ အတည်ပြုပြီး domain မပြောင်းနိုင်၊ အခြားအကောင့်မသုံးနိုင် Secret ပေါက်ကြားလား? 'ချက်ချင်းပြောင်း' နှိပ်ပါ — အကန့်အသတ်မရှိ၊ key ဟောင်း ချက်ချင်းရပ်။ key သည် ၎င်း၏ service တွင်သာ အလုပ်လုပ်သည် (မဟုတ်လျှင် WRONG_PRODUCT) အဆင့်မြင့် (ရွေးချယ်): key တွင် 'Request လက်မှတ်' ဖွင့်၍ tksign_… ရယူ၊ ထို့နောက် request တိုင်း X-Tungkao-Timestamp နှင့် X-Tungkao-Signature = HMAC-SHA256(secret, ts.METHOD.path.sha256(body)) လိုသည်။ key သက်သက်ပေါက်ကြားလျှင် အသုံးမဝင် 🧪 Test mode (tk_test_… keys) is free and limited to 2 calls per service per day (non-GET requests only; resets at midnight Bangkok time). Beyond that you get HTTP 429 RATE_LIMITED with a message — use a live key for unlimited calls. စာ၏ဘာသာစကားရွေးရန် Accept-Language (th, en, lo, my, zh-CN, ko, ja, vi, km, id) ပို့ပါ
စလစ်အစစ်ဖြစ်မဖြစ်၊ ပမာဏကိုက်မကိုက်၊ သင့်ထံလွှဲမလွှဲ၊ မသုံးရသေးကြောင်း စစ်သည် — ဖောက်သည်များ စလစ်တွဲပို့သောဆိုင်များအတွက်
အလုပ်လုပ်ပုံ ဖောက်သည်က စလစ်တင်၊ သင့်ဆိုက်က QR စာသား (0041… ဖြင့်စ) ကိုဖတ်သည် qr_payload၊ မျှော်မှန်းပမာဏနှင့် လက်ခံအကောင့်ကို API သို့ပို့ပါ status = VALID ဖြစ်မှသာ အော်ဒါလက်ခံပါ
POST /v1/slip/verify
curl Node.js PHP Python
ကူးရန်
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"}]}'// Node.js 18+ (nothing to install)
const res = await fetch("https://api.tungkao.com/v1/slip/verify", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.TUNGKAO_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"qr_payload": "0041000600000101030040220014…",
"expected_amount": "500.00",
"receivers": [
{
"bank": "KBANK",
"account_number": "1234567890"
}
]
}),
});
const data = await res.json();
console.log(data);<?php
$ch = curl_init("https://api.tungkao.com/v1/slip/verify");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("TUNGKAO_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
"qr_payload" => "0041000600000101030040220014…",
"expected_amount" => "500.00",
"receivers" => [
[
"bank" => "KBANK",
"account_number" => "1234567890"
]
]
]),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);import os, requests # pip install requests
r = requests.post(
"https://api.tungkao.com/v1/slip/verify",
headers={"Authorization": f"Bearer {os.environ['TUNGKAO_KEY']}"},
json={
"qr_payload": "0041000600000101030040220014…",
"expected_amount": "500.00",
"receivers": [
{
"bank": "KBANK",
"account_number": "1234567890"
}
]
},
timeout=30,
)
print(r.json())
📖 အကျဉ်း: key ကို ဆိုက်အများတွင် သုံးလျှင် ရလဒ် ကိစ္စ key သတ်မှတ်ချက် (API Keys စာမျက်နှာ) ရလဒ် ဆိုက် ၂ ခု (aaa.com, bbb.com) သည် အကောင့်တစ်ခုတည်းသို့ ငွေလက်ခံသည် key နှစ်ခုလုံး: Group A (သို့မဟုတ် အကောင့်တစ်ခုလုံး) aaa.com တွင် အောင်ပြီးသော စလစ်ကို bbb.com သို့ ပို့လျှင် DUPLICATE — ဆိုက်တစ်ခုတွင်သာ သုံးနိုင် ✅ ဆိုက် ၂ ခု အကောင့်တူ သို့သော် key ခွဲထား (မူလ) key နှစ်ခုလုံး: ဤ key သာ စလစ်တစ်ခု ဆိုက်နှစ်ခုလုံးတွင် အောင် ⚠️ ဖောက်သည် နှစ်ကြိမ်ဖြည့်နိုင် — key များကို ချိတ်ပါ ဆိုက် ၂ ခု ငွေလက်ခံအကောင့် မတူ ဤ key သာ (မူလ) ဆိုက်တစ်ခု၏ စလစ်ကို အခြားဆိုက်တွင် ပို့လျှင် RECEIVER_MISMATCH ရပြီးသား ✅ ဆိုက် ၂ ခု tungkao အကောင့် မတူ (ပိုင်ရှင်မတူ) သို့သော် ငွေလက်ခံအကောင့် တူ tungkao အကောင့်ကြား key ချိတ်၍ မရ စလစ်တစ်ခု နှစ်ခုလုံးတွင် အောင် ⚠️ — key နှစ်ခုကို tungkao အကောင့်တစ်ခုတည်းမှ ဝယ်ပြီး ချိတ်ပါ ဆိုက်တစ်ခု key ၂ ခုသုံး (ဥပမာ ဝဘ်ဆိုက် + အက်ပ်) key နှစ်ခုလုံး: group တူ ဝဘ်ဆိုက် သို့မဟုတ် အက်ပ်မှ ပို့ပို့ စလစ်ကို တစ်ကြိမ်သာ သုံးနိုင် ✅
DUPLICATE ကို QR ရှိ ရည်ညွှန်းနံပါတ်ဖြင့် ချက်ချင်းစစ်သည်။ API Keys စာမျက်နှာရှိ “key များကြား စလစ်ထပ်သုံးမှု ကာကွယ်ခြင်း” ကတ်တွင် သတ်မှတ်ပါ (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
Idempotency-Key header (ဥပမာ အော်ဒါနံပါတ်) ပို့ပါ — ထပ်ပို့လည်း နှစ်ခါမကောက်ပါ စလစ်တစ်ခုသည် key တစ်ခုလျှင် တစ်ကြိမ်သာ VALID (ဒုတိယအကြိမ် DUPLICATE) Several sites receiving into the same account? Put their keys in the same group under “Duplicate-slip protection between keys” on the API Keys page. A slip that passed on one key then returns DUPLICATE on every key in the group (default: this key only).
TrueMoney Wallet ငွေလွှဲစလစ် အစစ်ဖြစ်ကြောင်း၊ ပမာဏမှန်ကြောင်း၊ သင့် e-wallet နံပါတ်သို့ ရောက်ပြီး မသုံးရသေးကြောင်း စစ်ဆေးသည်
အလုပ်လုပ်ပုံ ငွေလက်ခံ wallet ကို တစ်ကြိမ်သတ်မှတ်ပါ (PUT /v1/truewallet/profile သို့မဟုတ် portal ရှိ key ကတ်တွင်): ဖုန်းနံပါတ် သို့မဟုတ် e-Wallet ID၊ ထိုင်း/အင်္ဂလိပ် အမည်နှင့် ငွေလက်ခံ QR ပုံ ဖောက်သည် ငွေပေးရန် QR ပုံ (qr_image_url) ကိုပြပြီး စလစ်ပုံ တင်ခိုင်းပါ စလစ်ပုံ (image_base64) နှင့် မျှော်မှန်းပမာဏကို API သို့ ပို့ပါ။ နံပါတ်နှင့် အမည်ကို သိမ်းထားသည့် profile မှ ယူသည် (သို့မဟုတ် wallet_number / ewallet_id ကို တောင်းဆိုချက်တွင် ပို့ပါ) status = VALID ဖြစ်မှသာ အော်ဒါလက်ခံပါ
PUT /v1/truewallet/profile
curl Node.js PHP Python
ကူးရန်
curl -X PUT https://api.tungkao.com/v1/truewallet/profile \
-H "Authorization: Bearer $TUNGKAO_KEY" \
-H "Content-Type: application/json" \
-d '{"wallet_number":"0812345678","ewallet_id":"140000812345678","name_en":"Somchai Jaidee","qr_image_base64":"<base64 QR image>"}'// Node.js 18+ (nothing to install)
const res = await fetch("https://api.tungkao.com/v1/truewallet/profile", {
method: "PUT",
headers: { Authorization: `Bearer ${process.env.TUNGKAO_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"wallet_number": "0812345678",
"ewallet_id": "140000812345678",
"name_en": "Somchai Jaidee",
"qr_image_base64": "<base64 QR image>"
}),
});
const data = await res.json();
console.log(data);<?php
$ch = curl_init("https://api.tungkao.com/v1/truewallet/profile");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("TUNGKAO_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
"wallet_number" => "0812345678",
"ewallet_id" => "140000812345678",
"name_en" => "Somchai Jaidee",
"qr_image_base64" => "<base64 QR image>"
]),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);import os, requests # pip install requests
r = requests.put(
"https://api.tungkao.com/v1/truewallet/profile",
headers={"Authorization": f"Bearer {os.environ['TUNGKAO_KEY']}"},
json={
"wallet_number": "0812345678",
"ewallet_id": "140000812345678",
"name_en": "Somchai Jaidee",
"qr_image_base64": "<base64 QR image>"
},
timeout=30,
)
print(r.json())GET /v1/truewallet/profile
curl Node.js PHP Python
ကူးရန်
curl -X GET https://api.tungkao.com/v1/truewallet/profile \
-H "Authorization: Bearer $TUNGKAO_KEY"// Node.js 18+ (nothing to install)
const res = await fetch("https://api.tungkao.com/v1/truewallet/profile", {
method: "GET",
headers: { Authorization: `Bearer ${process.env.TUNGKAO_KEY}` },
});
const data = await res.json();
console.log(data);<?php
$ch = curl_init("https://api.tungkao.com/v1/truewallet/profile");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("TUNGKAO_KEY")],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);import os, requests # pip install requests
r = requests.get(
"https://api.tungkao.com/v1/truewallet/profile",
headers={"Authorization": f"Bearer {os.environ['TUNGKAO_KEY']}"},
timeout=30,
)
print(r.json())POST /v1/truewallet/verify
curl Node.js PHP Python
ကူးရန်
curl -X POST https://api.tungkao.com/v1/truewallet/verify \
-H "Authorization: Bearer $TUNGKAO_KEY" \
-H "Content-Type: application/json" \
-d '{"image_base64":"<base64 slip image>","expected_amount":"500.00"}'// Node.js 18+ (nothing to install)
const res = await fetch("https://api.tungkao.com/v1/truewallet/verify", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.TUNGKAO_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"image_base64": "<base64 slip image>",
"expected_amount": "500.00"
}),
});
const data = await res.json();
console.log(data);<?php
$ch = curl_init("https://api.tungkao.com/v1/truewallet/verify");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("TUNGKAO_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
"image_base64" => "<base64 slip image>",
"expected_amount" => "500.00"
]),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);import os, requests # pip install requests
r = requests.post(
"https://api.tungkao.com/v1/truewallet/verify",
headers={"Authorization": f"Bearer {os.environ['TUNGKAO_KEY']}"},
json={
"image_base64": "<base64 slip image>",
"expected_amount": "500.00"
},
timeout=30,
)
print(r.json())
📖 အကျဉ်း: key ကို ဆိုက်အများတွင် သုံးလျှင် ရလဒ် ကိစ္စ key သတ်မှတ်ချက် (API Keys စာမျက်နှာ) ရလဒ် ဆိုက် ၂ ခု (aaa.com, bbb.com) သည် အကောင့်တစ်ခုတည်းသို့ ငွေလက်ခံသည် key နှစ်ခုလုံး: Group A (သို့မဟုတ် အကောင့်တစ်ခုလုံး) aaa.com တွင် အောင်ပြီးသော စလစ်ကို bbb.com သို့ ပို့လျှင် DUPLICATE — ဆိုက်တစ်ခုတွင်သာ သုံးနိုင် ✅ ဆိုက် ၂ ခု အကောင့်တူ သို့သော် key ခွဲထား (မူလ) key နှစ်ခုလုံး: ဤ key သာ စလစ်တစ်ခု ဆိုက်နှစ်ခုလုံးတွင် အောင် ⚠️ ဖောက်သည် နှစ်ကြိမ်ဖြည့်နိုင် — key များကို ချိတ်ပါ ဆိုက် ၂ ခု ငွေလက်ခံအကောင့် မတူ ဤ key သာ (မူလ) ဆိုက်တစ်ခု၏ စလစ်ကို အခြားဆိုက်တွင် ပို့လျှင် RECEIVER_MISMATCH ရပြီးသား ✅ ဆိုက် ၂ ခု tungkao အကောင့် မတူ (ပိုင်ရှင်မတူ) သို့သော် ငွေလက်ခံအကောင့် တူ tungkao အကောင့်ကြား key ချိတ်၍ မရ စလစ်တစ်ခု နှစ်ခုလုံးတွင် အောင် ⚠️ — key နှစ်ခုကို tungkao အကောင့်တစ်ခုတည်းမှ ဝယ်ပြီး ချိတ်ပါ ဆိုက်တစ်ခု key ၂ ခုသုံး (ဥပမာ ဝဘ်ဆိုက် + အက်ပ်) key နှစ်ခုလုံး: group တူ ဝဘ်ဆိုက် သို့မဟုတ် အက်ပ်မှ ပို့ပို့ စလစ်ကို တစ်ကြိမ်သာ သုံးနိုင် ✅
DUPLICATE ကို QR ရှိ ရည်ညွှန်းနံပါတ်ဖြင့် ချက်ချင်းစစ်သည်။ API Keys စာမျက်နှာရှိ “key များကြား စလစ်ထပ်သုံးမှု ကာကွယ်ခြင်း” ကတ်တွင် သတ်မှတ်ပါ (key အသစ် မူလ: ဤ key သာ)
📚 အသုံးပြုပုံ ဥပမာများ ဥပမာ 1
ငွေလက်ခံ wallet ကို တစ်ကြိမ်သတ်မှတ်ပါ
အခြေအနေ: ဆိုင်သည် TrueMoney 081-234-5678 (Somchai) သို့ ငွေလက်ခံပြီး ငွေလက်ခံ QR ရှိသည်
တောင်းဆိုချက်
PUT /v1/truewallet/profile
{
"receive_by": "wallet_number",
"wallet_number": "0812345678",
"name_en": "Somchai Jaidee",
"qr_image_base64": "<base64 of the QR image>"
}နမူနာ တုံ့ပြန်ချက်
{
"success": true,
"data": {
"receive_by": "wallet_number",
"wallet_number": "0812345678",
"qr_image_url": "https://api.tungkao.com/v1/truewallet/qr/…"
}
}
➡️ ငွေပေးစာမျက်နှာတွင် qr_image_url ကိုပြ၍ ဖောက်သည် စကင်ဖတ်ရန်
ဥပမာ 2
သိမ်းထားသော wallet ဖြင့် စစ်ဆေးခြင်း
အခြေအနေ: ဖောက်သည်က သင့် TrueMoney wallet သို့ 300 ဘတ် လွှဲပြီး စလစ်တွဲသည်
တောင်းဆိုချက်
POST /v1/truewallet/verify
{
"image_base64": "<base64 of the slip image>",
"expected_amount": "300.00"
}နမူနာ တုံ့ပြန်ချက်
{
"success": true,
"status": "VALID",
"data": {
"amount": "300.00",
"currency": "THB"
}
}
➡️ နံပါတ် ထပ်ပို့ရန်မလို — key တွင် သိမ်းထားသော wallet ကို သုံးသည်
ဥပမာ 3
e-Wallet ID ဖြင့်သာ ငွေလက်ခံခြင်း
အခြေအနေ: ဖောက်သည်က ဂဏန်း ၁၅ လုံး e-Wallet ID ဖြင့် လွှဲသည်၊ သင့်ဖုန်းနံပါတ် မပေးရ
တောင်းဆိုချက်
PUT /v1/truewallet/profile
{
"receive_by": "ewallet_id",
"ewallet_id": "140000812345678"
}
➡️ ဖုန်းနံပါတ်သို့ လွှဲသော စလစ်များ RECEIVER_MISMATCH ရ၊ e-Wallet ID ကိုသာ လက်ခံ
ဥပမာ 4
လက်ခံသူကို တောင်းဆိုချက်တွင် ပို့ခြင်း (wallet အများ)
အခြေအနေ: ဆိုင်ခွဲအလိုက် wallet အများကို လှည့်သုံးသည်
တောင်းဆိုချက်
POST /v1/truewallet/verify
{
"image_base64": "<base64 of the slip image>",
"expected_amount": "300.00",
"wallet_numbers": [
"0812345678",
"0898765432"
],
"wallet_name_en": "Somchai Jaidee"
}
➡️ စာရင်းထဲရှိ wallet တစ်ခုခုသို့ လွှဲပြီး အမည်ကိုက်လျှင် အောင်
ဥပမာ 5
အဓိက provider ပျက်၊ အရန် ဆက်လုပ်
အခြေအနေ: ဖောက်သည် ပို့နေစဉ် အဓိကစစ်ဆေးသူ ပျက်သည်
တောင်းဆိုချက်
POST /v1/truewallet/verify
{
"image_base64": "<base64 of the slip image>",
"expected_amount": "300.00"
}
➡️ အရန်က တောင်းဆိုချက်တစ်ခုတည်းအတွင်း စစ်ပေးသည်။ image_base64 ပို့ပါ: အရန်က ပုံမှ စစ်သည်
ဥပမာ 6
ထပ်သုံး သို့မဟုတ် ပမာဏ မှား
အခြေအနေ: ဖောက်သည်က စလစ်ထပ်ပို့ သို့မဟုတ် ငွေလျော့လွှဲ
နမူနာ တုံ့ပြန်ချက်
{
"success": false,
"status": "DUPLICATE"
}
➡️ DUPLICATE = သုံးပြီးသား · AMOUNT_MISMATCH = ပမာဏမှား။ နှစ်မျိုးလုံး credit မဖြည့်ပါနှင့်
လက်ခံသူကို နည်းတစ်ခုခု သို့မဟုတ် နှစ်ခုလုံးဖြင့် သတ်မှတ်: wallet_number (ဂဏန်း ၁၀ လုံး ဖုန်း) သို့မဟုတ် ewallet_id (ဂဏန်း ၁၅ လုံး e-Wallet ID)။ တစ်ခုခုကိုက်လျှင် အောင် receive_by ဖြင့် လက်ခံပုံ ရွေးပါ: wallet_number (နံပါတ်သာ)၊ ewallet_id (e-Wallet ID သာ) သို့မဟုတ် any (မူလ၊ တစ်ခုခု)။ ရွေးထားသော identifier ဖြင့် စစ်သည် လက်ခံသူအမည်: name_th, name_en သို့မဟုတ် နှစ်ခုလုံး (စစ်ဆေးတောင်းဆိုချက်တွင် wallet_name_th / wallet_name_en)။ သတ်မှတ်ထားလျှင် တစ်ခုခုနှင့် ကိုက်ရမည်၊ မသတ်မှတ်လျှင် အမည်မစစ် ငွေလက်ခံ QR ပုံ: QR ဖတ်နိုင်သော JPG/PNG 1 MB အထိ။ ငွေပေးစာမျက်နှာအတွက် qr_image_url ရမည်၊ ပုံအသစ်တင်လျှင် လင့်ခ်အသစ် wallet_number သည် ငွေလက်ခံ wallet ၏ ဂဏန်း ၁၀ လုံး ဖုန်းနံပါတ်။ wallet_numbers ဖြင့် အများပို့ (အများဆုံး ၁၀) သို့မဟုတ် portal ရှိ key တွင် သိမ်းပါ တုံ့ပြန်ချက်နှင့် status များ /v1/slip/verify နှင့် အတူတူ။ စလစ်တစ်ခု key တစ်ခုလျှင် VALID တစ်ကြိမ်သာ (ဒုတိယအကြိမ် DUPLICATE) Idempotency-Key header (ဥပမာ အော်ဒါနံပါတ်) ပို့ပါ — ထပ်ပို့လည်း နှစ်ခါမကောက်ပါ
အသုံးပြုသူများအတွက် ငွေဖြည့်: စလစ်စစ်၊ ထိုသူ၏ငွေသွင်းမှတ်တမ်းတင်ပြီး webhook ဖြင့် သင့်ဆိုက်ကိုအကြောင်းကြား
အလုပ်လုပ်ပုံ ပေါ်တယ်ရှိ key တွင် လက်ခံအကောင့်နှင့် webhook URL သတ်မှတ်ပါ customer_ref (သင့်အသုံးပြုသူ ID) နှင့်အတူ စလစ်ပို့ပါ deposit.succeeded webhook ရလျှင် (လက်မှတ်စစ်ပြီး) အသုံးပြုသူကို ငွေထည့်ပါ
POST /v1/deposits/slip
curl Node.js PHP Python
ကူးရန်
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"}'// Node.js 18+ (nothing to install)
const res = await fetch("https://api.tungkao.com/v1/deposits/slip", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.TUNGKAO_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"qr_payload": "0041000600000101030040220014…",
"customer_ref": "member-1001",
"expected_amount": "300.00"
}),
});
const data = await res.json();
console.log(data);<?php
$ch = curl_init("https://api.tungkao.com/v1/deposits/slip");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("TUNGKAO_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
"qr_payload" => "0041000600000101030040220014…",
"customer_ref" => "member-1001",
"expected_amount" => "300.00"
]),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);import os, requests # pip install requests
r = requests.post(
"https://api.tungkao.com/v1/deposits/slip",
headers={"Authorization": f"Bearer {os.environ['TUNGKAO_KEY']}"},
json={
"qr_payload": "0041000600000101030040220014…",
"customer_ref": "member-1001",
"expected_amount": "300.00"
},
timeout=30,
)
print(r.json())GET /v1/deposits/dep_xxx
curl Node.js PHP Python
ကူးရန်
curl -X GET https://api.tungkao.com/v1/deposits/dep_xxx \
-H "Authorization: Bearer $TUNGKAO_KEY"// Node.js 18+ (nothing to install)
const res = await fetch("https://api.tungkao.com/v1/deposits/dep_xxx", {
method: "GET",
headers: { Authorization: `Bearer ${process.env.TUNGKAO_KEY}` },
});
const data = await res.json();
console.log(data);<?php
$ch = curl_init("https://api.tungkao.com/v1/deposits/dep_xxx");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("TUNGKAO_KEY")],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);import os, requests # pip install requests
r = requests.get(
"https://api.tungkao.com/v1/deposits/dep_xxx",
headers={"Authorization": f"Bearer {os.environ['TUNGKAO_KEY']}"},
timeout=30,
)
print(r.json())
Webhook လက်မှတ်စစ်ခြင်း webhook တိုင်းတွင် X-Tungkao-Signature: t=…,v1=… ပါသည်။ ဒေတာကိုမယုံမီ စစ်ပါ (URL သတ်မှတ်ချိန်တွင် webhook secret ပြသည်)
Node.js PHP Python
ကူးရန်
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]));
}<?php
function verify(string $raw, string $header, string $secret): bool {
if (!preg_match('/^t=(\d+),v1=([0-9a-f]{64})$/', $header, $m) || abs(time() - (int)$m[1]) > 300) return false;
return hash_equals(hash_hmac("sha256", $m[1] . "." . $raw, $secret), $m[2]);
}
$ok = verify(file_get_contents("php://input"), $_SERVER["HTTP_X_TUNGKAO_SIGNATURE"] ?? "", getenv("TUNGKAO_WEBHOOK_SECRET"));import hmac, hashlib, re, time
def verify(raw: bytes, header: str, secret: str) -> bool:
m = re.fullmatch(r"t=(\d+),v1=([0-9a-f]{64})", header or "")
if not m or abs(time.time() - int(m[1])) > 300:
return False
want = hmac.new(secret.encode(), m[1].encode() + b"." + raw, hashlib.sha256).hexdigest()
return hmac.compare_digest(want, m[2])📚 အသုံးပြုပုံ ဥပမာများ ဥပမာ 1
Credit a member's deposit
အခြေအနေ: Member member-1001 deposits 300 THB and attaches the slip
တောင်းဆိုချက်
POST /v1/deposits/slip
{
"image_base64": "<base64 of the slip image>",
"customer_ref": "member-1001",
"expected_amount": "300.00"
}နမူနာ တုံ့ပြန်ချက်
{
"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
ဥပမာ 2
Attach your own data to the deposit
အခြေအနေ: You want to know which promotion the deposit came from
တောင်းဆိုချက်
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
ဥပမာ 3
Receive the result by webhook
အခြေအနေ: 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
ဥပမာ 4
Check a deposit later
အခြေအနေ: Your site missed the webhook or wants to re-check
တောင်းဆိုချက်
GET /v1/deposits/dep_8f2c…နမူနာ တုံ့ပြန်ချက်
{
"success": true,
"data": {
"deposit_id": "dep_8f2c…",
"status": "succeeded"
}
}
➡️ succeeded = credit · failed = rejected · pending = wait
ဥပမာ 5
Member resubmits the same slip
အခြေအနေ: A member tries to deposit again with the same slip
နမူနာ တုံ့ပြန်ချက်
{
"success": false,
"status": "DUPLICATE"
}
➡️ DUPLICATE; no new deposit is created
🔐
Sign-in for your website (Google, LINE, Facebook, Apple, TikTok, Discord, Telegram, X, Microsoft, GitHub + 14 more)
Add 'Sign in with …' to your site without registering with each provider. Get name, email, photo, a stable member id, and a member list with sign-in history. One service per provider: google_login, line_login, facebook_login, tiktok_login, discord_login, telegram_login, x_login, microsoft_login, github_login.
အလုပ်လုပ်ပုံ provider အတွက် key ဖန်တီးပြီး 'Sign-in အဖွဲ့ဝင်များ' တွင် ဆိုက်အမည်နှင့် redirect URI (https၊ အတိအကျ) သတ်မှတ်ပါ Sign-in ခလုတ်က အသုံးပြုသူကို client_id (key ID)၊ redirect_uri နှင့် state (အကြိမ်တိုင်း random အသစ်၊ session တွင်သိမ်း) ဖြင့် /oauth/authorize သို့ပို့သည် အသုံးပြုသူ redirect_uri?code=…&state=… သို့ပြန်လာ → state စစ် → server က ၂ မိနစ်အတွင်း POST /v1/login/token ခေါ် data.user (ဥပမာ 7F3K9QX2-yourshopcom) ကို member ID အဖြစ်သုံးပါ — လူတစ်ဦးသည် ID တစ်ခုတည်းအမြဲရ
POST /v1/login/token
curl Node.js PHP Python
ကူးရန်
curl -X POST https://api.tungkao.com/v1/login/token \
-H "Authorization: Bearer $TUNGKAO_KEY" \
-H "Content-Type: application/json" \
-d '{"code":"from the redirect","redirect_uri":"https://yourshop.com/auth/callback"}'// Node.js 18+ (nothing to install)
const res = await fetch("https://api.tungkao.com/v1/login/token", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.TUNGKAO_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"code": "from the redirect",
"redirect_uri": "https://yourshop.com/auth/callback"
}),
});
const data = await res.json();
console.log(data);<?php
$ch = curl_init("https://api.tungkao.com/v1/login/token");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("TUNGKAO_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
"code" => "from the redirect",
"redirect_uri" => "https://yourshop.com/auth/callback"
]),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);import os, requests # pip install requests
r = requests.post(
"https://api.tungkao.com/v1/login/token",
headers={"Authorization": f"Bearer {os.environ['TUNGKAO_KEY']}"},
json={
"code": "from the redirect",
"redirect_uri": "https://yourshop.com/auth/callback"
},
timeout=30,
)
print(r.json())GET /v1/login/users?limit=50
curl Node.js PHP Python
ကူးရန်
curl -X GET https://api.tungkao.com/v1/login/users?limit=50 \
-H "Authorization: Bearer $TUNGKAO_KEY"// Node.js 18+ (nothing to install)
const res = await fetch("https://api.tungkao.com/v1/login/users?limit=50", {
method: "GET",
headers: { Authorization: `Bearer ${process.env.TUNGKAO_KEY}` },
});
const data = await res.json();
console.log(data);<?php
$ch = curl_init("https://api.tungkao.com/v1/login/users?limit=50");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("TUNGKAO_KEY")],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);import os, requests # pip install requests
r = requests.get(
"https://api.tungkao.com/v1/login/users?limit=50",
headers={"Authorization": f"Bearer {os.environ['TUNGKAO_KEY']}"},
timeout=30,
)
print(r.json())
📖 Summary: using sign-in keys on several sites ကိစ္စ key သတ်မှတ်ချက် (API Keys စာမျက်နှာ) ရလဒ် One site, 2 keys of the same provider (e.g. website + app, both Google) Both keys: Combined (default) The same person gets the same user ID in both ✅ One site, 2 keys of the same provider, counted as separate accounts Both keys: Separate The same person gets a different user ID on each key 2 sister sites sharing members Both keys: Group A A member has the same user ID on both sites ✅ 2 unrelated sites that must not link members Both keys: Separate Different user IDs, so the sites can't link their members ✅ A Google key and a LINE key (different providers) Any setting Always different user IDs — they are different provider accounts A key that already has sign-ins needs a different group Not allowed (locked 🔒) Create a new key in the wanted group, so member IDs on your site never change
Set it on the “Sign-in user IDs between keys” card on the API Keys page before go-live (new keys default: Combined). Several keys may use the same domain.
ပြည့်စုံသောနမူနာ (ခလုတ် + callback + code လဲ) Node.js (Express) PHP Python (Flask)
ကူးရန်
// npm i express express-session
import express from "express";
import session from "express-session";
import crypto from "node:crypto";
const KEY = process.env.TUNGKAO_KEY; // API key (tk_live_…) server-side only
const CLIENT_ID = process.env.TUNGKAO_CLIENT_ID; // the key id (shown in the portal), not a secret
const REDIRECT = "https://yourshop.com/auth/callback"; // must match the registered URL exactly
const app = express();
app.use(session({ secret: process.env.SESSION_SECRET, resave: false, saveUninitialized: false, cookie: { secure: true, sameSite: "lax" } }));
// 1) your "Sign in" button links here
app.get("/auth/login", (req, res) => {
req.session.state = crypto.randomBytes(24).toString("base64url");
const u = new URL("https://api.tungkao.com/oauth/authorize");
u.search = new URLSearchParams({ client_id: CLIENT_ID, redirect_uri: REDIRECT, state: req.session.state });
res.redirect(u);
});
// 2) the user comes back with a code
app.get("/auth/callback", async (req, res) => {
if (!req.query.state || req.query.state !== req.session.state) return res.status(400).send("state mismatch");
delete req.session.state;
if (req.query.error) return res.redirect("/login?cancelled=1");
// 3) exchange the code for the user (within 2 minutes)
const r = await fetch("https://api.tungkao.com/v1/login/token", {
method: "POST",
headers: { Authorization: `Bearer ${KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({ code: req.query.code, redirect_uri: REDIRECT }),
});
const j = await r.json();
if (!j.success) return res.status(400).send(j.error.message);
req.session.user = j.data; // j.data.user = permanent member id, e.g. 7F3K9QX2-yourshopcom
res.redirect("/");
});
app.listen(3000);<?php
// login.php — your "Sign in" button links to this file
session_start();
$CLIENT_ID = getenv("TUNGKAO_CLIENT_ID");
$REDIRECT = "https://yourshop.com/callback.php";
$_SESSION["state"] = bin2hex(random_bytes(24));
header("Location: https://api.tungkao.com/oauth/authorize?" . http_build_query([
"client_id" => $CLIENT_ID, "redirect_uri" => $REDIRECT, "state" => $_SESSION["state"],
]));
<?php
// callback.php — the user comes back here
session_start();
$REDIRECT = "https://yourshop.com/callback.php";
if (empty($_GET["state"]) || !hash_equals($_SESSION["state"] ?? "", $_GET["state"])) { http_response_code(400); exit("state mismatch"); }
unset($_SESSION["state"]);
if (!empty($_GET["error"])) { header("Location: /login.php?cancelled=1"); exit; }
$ch = curl_init("https://api.tungkao.com/v1/login/token");
curl_setopt_array($ch, [
CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("TUNGKAO_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode(["code" => $_GET["code"], "redirect_uri" => $REDIRECT]),
]);
$j = json_decode(curl_exec($ch), true);
if (!$j["success"]) { http_response_code(400); exit($j["error"]["message"]); }
$_SESSION["user"] = $j["data"]; // $j["data"]["user"] = permanent member id
header("Location: /");# pip install flask requests
import os, secrets, requests
from urllib.parse import urlencode
from flask import Flask, session, request, redirect, abort
app = Flask(__name__)
app.secret_key = os.environ["SESSION_SECRET"]
KEY = os.environ["TUNGKAO_KEY"]
CLIENT_ID = os.environ["TUNGKAO_CLIENT_ID"]
REDIRECT = "https://yourshop.com/auth/callback"
@app.get("/auth/login")
def login():
session["state"] = secrets.token_urlsafe(24)
return redirect("https://api.tungkao.com/oauth/authorize?" + urlencode({"client_id": CLIENT_ID, "redirect_uri": REDIRECT, "state": session["state"]}))
@app.get("/auth/callback")
def callback():
if not request.args.get("state") or not secrets.compare_digest(request.args["state"], session.pop("state", "")):
abort(400)
if request.args.get("error"):
return redirect("/login?cancelled=1")
r = requests.post("https://api.tungkao.com/v1/login/token", headers={"Authorization": f"Bearer {KEY}"},
json={"code": request.args["code"], "redirect_uri": REDIRECT}, timeout=30).json()
if not r["success"]:
abort(400, r["error"]["message"])
session["user"] = r["data"] # r["data"]["user"] = permanent member id
return redirect("/")
Provider Service ရရှိမည်
Googlegoogle_loginအမည်၊ အတည်ပြုပြီး email၊ ဓာတ်ပုံ
LINEline_loginအမည်၊ ဓာတ်ပုံ၊ သဘောတူလျှင် email
Facebookfacebook_loginအမည်၊ ဓာတ်ပုံ၊ email
TikToktiktok_loginပြသအမည်၊ avatar (email မပါ)
Discorddiscord_loginအမည်၊ avatar၊ email
Telegramtelegram_loginname, username, photo
X (Twitter)x_loginname, username, photo
Microsoftmicrosoft_loginname, email (Hotmail/Outlook)
GitHubgithub_loginname, email, avatar
Appleapple_loginpermanent member ID (no name or email in this mode)
Steamsteam_loginname, avatar and SteamID (no email)
Twitchtwitch_loginname, email, avatar
LinkedInlinkedin_loginname, email, photo
Kakaokakao_loginname, photo (email once Kakao approves it)
NAVERnaver_loginname, email, photo
Zalozalo_loginname, photo (no email)
Spotifyspotify_loginname, email, photo
Redditreddit_loginusername, avatar (no email)
GitLabgitlab_loginname, email, avatar
Robloxroblox_loginname, avatar (no email)
Epic Gamesepicgames_logindisplay name (no email)
Yahooyahoo_loginname, email, photo
Slackslack_loginname, email, photo
Amazonamazon_loginname, email
📚 အသုံးပြုပုံ ဥပမာများ ဥပမာ 1
A “Sign in with Google” button on your site
အခြေအနေ: A visitor taps Sign in with Google on your site
တောင်းဆိုချက်
GET /oauth/authorize?client_id=<CLIENT_ID>&redirect_uri=https://yourshop.com/auth/callback&state=xyz
➡️ The user signs in with Google and returns to redirect_uri with a code and the same state
ဥပမာ 2
Exchange the code for the user (server side)
အခြေအနေ: Your server receives the code on the callback page (exchange within 2 minutes)
တောင်းဆိုချက်
POST /v1/login/token
{
"code": "<code from the callback>",
"redirect_uri": "https://yourshop.com/auth/callback"
}နမူနာ တုံ့ပြန်ချက်
{
"success": true,
"data": {
"user": "7F3K9QX2-yourshopcom",
"provider": "google",
"name": "Somchai",
"is_new_user": true
}
}
➡️ Use user as the member id in your database (stable per person)
ဥပမာ 3
A returning user signs in
အခြေအနေ: The same person signs in with Google again
နမူနာ တုံ့ပြန်ချက်
{
"success": true,
"data": {
"user": "7F3K9QX2-yourshopcom",
"is_new_user": false,
"login_count": 5
}
}
➡️ Same user every time → look up the member and sign them in
ဥပမာ 4
One site, two Google keys (website + app)
အခြေအနေ: Separate keys for website and app, same members
➡️ Keep both keys “Combined” (default) before go-live → same user for the same person. Choose “Separate” to keep them apart
ဥပမာ 5
List members who signed in
အခြေအနေ: You want to browse or search members of this key
တောင်းဆိုချက်
GET /v1/login/users?q=somchai&limit=50
➡️ Returns members with last sign-in time and count
ဥပမာ 6
The user cancels during sign-in
အခြေအနေ: The user cancels on the Google screen
➡️ Returns to redirect_uri with error instead of code; show a retry button
User IDs between keys: new keys default to “Combined (whole account)”, so the same person signing in through keys of the same provider in one account gets the same ID. Change it to group A–E or “Separate” on the API Keys page before the first sign-in; after that the group is locked so member IDs never change. Sign-in အောင်မြင်တိုင်းနှင့် အဖွဲ့ဝင်သစ်တစ်ဦးလျှင် တစ်ကြိမ် ခရက်ဒစ်ကောက်သည် — လက်ရှိစျေးကို service ကတ်တွင်ကြည့်ပါ Test mode key များ http://localhost redirect ခွင့်ပြုပြီး အခမဲ့ API key ကို link သို့ စာမျက်နှာတွင် ဘယ်တော့မှမထည့်ပါနှင့် — /oauth/authorize သည် အများသိ client_id (key ID) သာလိုသည်
TUNGKAO ဘော့ဖြင့် အသုံးပြုသူများထံ Telegram စာပို့ — ကိုယ်ပိုင်ဘော့မလို။ ဥပမာ ငွေဝင်၊ အော်ဒါအခြေအနေ၊ OTP
အလုပ်လုပ်ပုံ ref is your own name for a recipient (use your member id, e.g. member-1001): A-Z a-z 0-9 _ . : @ - up to 128 chars. Every call refers to the recipient by this ref. Add a recipient: your server calls POST /v1/telegram/link {ref} → gets data.url (a t.me/…?start=… link) → show it as a “Connect Telegram” button on the member's profile page (valid 30 minutes, single use; request again any time). The member opens the link → presses Start in Telegram → the bot confirms (Telegram does not let a bot message someone who never pressed Start, so this step cannot be skipped). Check the connection: GET /v1/telegram/recipients (status = active) — use it to switch your button to “Connected ✓”. Send: POST /v1/telegram/send with one ref or up to 100 refs; bold text (parse_mode: HTML) and a link button are supported. Per-recipient results are in data.results: sent / not_linked / failed. Remove a recipient: DELETE /v1/telegram/recipients/{ref}. Members can also send /stop to the bot. If a member blocks the bot, that recipient is paused until they connect again. Try it without code: TUNGKAO API key page → this key's card → “Set up notifications” has a create-link button (with QR) and a send-test button.
POST /v1/telegram/link
curl Node.js PHP Python
ကူးရန်
curl -X POST https://api.tungkao.com/v1/telegram/link \
-H "Authorization: Bearer $TUNGKAO_KEY" \
-H "Content-Type: application/json" \
-d '{"ref":"member-1001"}'// Node.js 18+ (nothing to install)
const res = await fetch("https://api.tungkao.com/v1/telegram/link", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.TUNGKAO_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"ref": "member-1001"
}),
});
const data = await res.json();
console.log(data);<?php
$ch = curl_init("https://api.tungkao.com/v1/telegram/link");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("TUNGKAO_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
"ref" => "member-1001"
]),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);import os, requests # pip install requests
r = requests.post(
"https://api.tungkao.com/v1/telegram/link",
headers={"Authorization": f"Bearer {os.environ['TUNGKAO_KEY']}"},
json={
"ref": "member-1001"
},
timeout=30,
)
print(r.json())POST /v1/telegram/send
curl Node.js PHP Python
ကူးရန်
curl -X POST https://api.tungkao.com/v1/telegram/send \
-H "Authorization: Bearer $TUNGKAO_KEY" \
-H "Content-Type: application/json" \
-d '{"ref":"member-1001","text":"<b>Payment received</b> 500 THB","parse_mode":"HTML","button":{"text":"View order","url":"https://yourshop.com/orders/1"}}'// Node.js 18+ (nothing to install)
const res = await fetch("https://api.tungkao.com/v1/telegram/send", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.TUNGKAO_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"ref": "member-1001",
"text": "<b>Payment received</b> 500 THB",
"parse_mode": "HTML",
"button": {
"text": "View order",
"url": "https://yourshop.com/orders/1"
}
}),
});
const data = await res.json();
console.log(data);<?php
$ch = curl_init("https://api.tungkao.com/v1/telegram/send");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("TUNGKAO_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
"ref" => "member-1001",
"text" => "<b>Payment received</b> 500 THB",
"parse_mode" => "HTML",
"button" => [
"text" => "View order",
"url" => "https://yourshop.com/orders/1"
]
]),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);import os, requests # pip install requests
r = requests.post(
"https://api.tungkao.com/v1/telegram/send",
headers={"Authorization": f"Bearer {os.environ['TUNGKAO_KEY']}"},
json={
"ref": "member-1001",
"text": "<b>Payment received</b> 500 THB",
"parse_mode": "HTML",
"button": {
"text": "View order",
"url": "https://yourshop.com/orders/1"
}
},
timeout=30,
)
print(r.json())GET /v1/telegram/messages
curl Node.js PHP Python
ကူးရန်
curl -X GET https://api.tungkao.com/v1/telegram/messages \
-H "Authorization: Bearer $TUNGKAO_KEY"// Node.js 18+ (nothing to install)
const res = await fetch("https://api.tungkao.com/v1/telegram/messages", {
method: "GET",
headers: { Authorization: `Bearer ${process.env.TUNGKAO_KEY}` },
});
const data = await res.json();
console.log(data);<?php
$ch = curl_init("https://api.tungkao.com/v1/telegram/messages");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("TUNGKAO_KEY")],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);import os, requests # pip install requests
r = requests.get(
"https://api.tungkao.com/v1/telegram/messages",
headers={"Authorization": f"Bearer {os.environ['TUNGKAO_KEY']}"},
timeout=30,
)
print(r.json())
📚 အသုံးပြုပုံ ဥပမာများ ဥပမာ 1
Let a member connect Telegram
အခြေအနေ: Member member-1001 wants notifications on Telegram
တောင်းဆိုချက်
POST /v1/telegram/link
{
"ref": "member-1001"
}နမူနာ တုံ့ပြန်ချက်
{
"success": true,
"data": {
"url": "https://t.me/…?start=…"
}
}
➡️ Give the member the link to tap (valid 30 minutes, once)
ဥပမာ 2
Notify a payment
အခြေအနေ: 500 THB arrived and you want to notify the member
တောင်းဆိုချက်
POST /v1/telegram/send
{
"ref": "member-1001",
"text": "<b>Payment received</b> 500 THB",
"parse_mode": "HTML"
}
➡️ The member gets the message in Telegram right away
ဥပမာ 3
Message with a link button
အခြေအနေ: You want a button to open the order
တောင်းဆိုချက်
POST /v1/telegram/send
{
"ref": "member-1001",
"text": "Order #1001 shipped",
"button": {
"text": "View order",
"url": "https://yourshop.com/orders/1001"
}
}
➡️ A button under the message opens the link
ဥပမာ 4
Notify several members at once
အခြေအနေ: Announce a promotion to three members
တောင်းဆိုချက်
POST /v1/telegram/send
{
"refs": [
"member-1001",
"member-1002",
"member-1003"
],
"text": "New promotion today"
}
➡️ Sent to each member; check results with GET /v1/telegram/messages
ဥပမာ 5
A member stops notifications
အခြေအနေ: The member asks to disconnect
တောင်းဆိုချက်
DELETE /v1/telegram/recipients/member-1001
➡️ The link is removed; no more messages are sent
ရောက်ရှိသောစာများသာ ကောက်ခံ — မအောင်မြင်ပါက (ဥပမာ ဘော့ကိုပိတ်) ပြန်အမ်း၍ ထိုလက်ခံသူကို ခဏရပ်သည်
သင့် သို့ ဖောက်သည်၏ Discord channel များသို့ စာပို့ — ဥပမာ အဖွဲ့အတွက် အော်ဒါသစ်
အလုပ်လုပ်ပုံ Create a channel webhook in Discord (needs Manage Webhooks): desktop right-click the channel → Edit Channel → Integrations → Webhooks → New Webhook → name it → Copy Webhook URL (mobile: long-press the channel → Edit Channel). ref is your own name for the channel, e.g. orders-room (A-Z a-z 0-9 _ . : @ - up to 128 chars). One key can hold many channels, each with its own ref. Add a channel: POST /v1/discord/webhooks {ref, url} — url must start with https://discord.com/api/webhooks/…; it is stored encrypted and never returned. Posting the same ref again replaces that channel's link. Send: POST /v1/discord/send {ref, text} (up to 2000 chars; @everyone / @here are disabled automatically). Results are in data.results: sent / not_linked / failed. List channels: GET /v1/discord/recipients. Remove: DELETE /v1/discord/recipients/{ref}. If the webhook is deleted in Discord, the channel is paused and the undelivered message is refunded. Try it without code: TUNGKAO API key page → this key's card → “Set up notifications”: paste the webhook link, add the channel and send a test. Do not confuse this with the key's “Webhook URL” setting: that is your server address for receiving events from TUNGKAO, not a Discord channel link.
POST /v1/discord/webhooks
curl Node.js PHP Python
ကူးရန်
curl -X POST https://api.tungkao.com/v1/discord/webhooks \
-H "Authorization: Bearer $TUNGKAO_KEY" \
-H "Content-Type: application/json" \
-d '{"ref":"orders-room","url":"https://discord.com/api/webhooks/123/abc…"}'// Node.js 18+ (nothing to install)
const res = await fetch("https://api.tungkao.com/v1/discord/webhooks", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.TUNGKAO_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"ref": "orders-room",
"url": "https://discord.com/api/webhooks/123/abc…"
}),
});
const data = await res.json();
console.log(data);<?php
$ch = curl_init("https://api.tungkao.com/v1/discord/webhooks");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("TUNGKAO_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
"ref" => "orders-room",
"url" => "https://discord.com/api/webhooks/123/abc…"
]),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);import os, requests # pip install requests
r = requests.post(
"https://api.tungkao.com/v1/discord/webhooks",
headers={"Authorization": f"Bearer {os.environ['TUNGKAO_KEY']}"},
json={
"ref": "orders-room",
"url": "https://discord.com/api/webhooks/123/abc…"
},
timeout=30,
)
print(r.json())POST /v1/discord/send
curl Node.js PHP Python
ကူးရန်
curl -X POST https://api.tungkao.com/v1/discord/send \
-H "Authorization: Bearer $TUNGKAO_KEY" \
-H "Content-Type: application/json" \
-d '{"ref":"orders-room","text":"🛒 New order #1001 — 590 THB"}'// Node.js 18+ (nothing to install)
const res = await fetch("https://api.tungkao.com/v1/discord/send", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.TUNGKAO_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"ref": "orders-room",
"text": "🛒 New order #1001 — 590 THB"
}),
});
const data = await res.json();
console.log(data);<?php
$ch = curl_init("https://api.tungkao.com/v1/discord/send");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("TUNGKAO_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
"ref" => "orders-room",
"text" => "🛒 New order #1001 — 590 THB"
]),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);import os, requests # pip install requests
r = requests.post(
"https://api.tungkao.com/v1/discord/send",
headers={"Authorization": f"Bearer {os.environ['TUNGKAO_KEY']}"},
json={
"ref": "orders-room",
"text": "🛒 New order #1001 — 590 THB"
},
timeout=30,
)
print(r.json())
📚 အသုံးပြုပုံ ဥပမာများ ဥပမာ 1
Register a Discord channel
အခြေအနေ: You want new orders posted in #orders
တောင်းဆိုချက်
POST /v1/discord/webhooks
{
"ref": "orders-room",
"url": "https://discord.com/api/webhooks/123/abc…"
}
➡️ Name it once with ref and use it forever
ဥပမာ 2
Post a new order
အခြေအနေ: Order #1001 for 590 THB comes in
တောင်းဆိုချက်
POST /v1/discord/send
{
"ref": "orders-room",
"text": "🛒 New order #1001 — 590 THB"
}
➡️ The message appears in the channel right away
ဥပမာ 3
Custom sender name
အခြေအနေ: You want the sender to show as “Shop Bot”
တောင်းဆိုချက်
POST /v1/discord/send
{
"ref": "orders-room",
"text": "Daily sales: 12,400 THB",
"username": "Shop Bot"
}
➡️ The message shows Shop Bot as the sender
ဥပမာ 4
Post to several channels
အခြေအနေ: Notify both the admin and the stock channels
တောင်းဆိုချက်
POST /v1/discord/send
{
"refs": [
"admin-room",
"stock-room"
],
"text": "Stock low: T-shirt size M"
}
➡️ Posted to every listed channel
ဥပမာ 5
Check sending history
အခြေအနေ: You want to see which messages failed
တောင်းဆိုချက်
GET /v1/discord/messages
➡️ Returns each message with its status
API သို့မဟုတ် SMTP ဖြင့် အီးမေးလ်ပို့ (WordPress ရ)၊ OTP ပို့ခြင်းနှင့် စစ်ခြင်း — provider များကြား အလိုအလျောက်ပြောင်း
အလုပ်လုပ်ပုံ email key ဖန်တီးပါ (စမ်းသပ် key သည် ကိုယ့်လိပ်စာသို့သာ တစ်ရက် ၅၀) SMTP: host smtp.tungkao.com၊ port 587 (STARTTLS) သို့မဟုတ် 465 (SSL)၊ username ကြိုက်ရာ၊ password = API key API: အီးမေးလ်ပို့ သို့မဟုတ် OTP တောင်းပြီး otp_id ဖြင့်စစ် (၅ ကြိမ်၊ တစ်ခါသုံး)
POST /v1/email/send
curl Node.js PHP Python
ကူးရန်
curl -X POST https://api.tungkao.com/v1/email/send \
-H "Authorization: Bearer $TUNGKAO_KEY" \
-H "Content-Type: application/json" \
-d '{"to":["[email protected] "],"subject":"Order #1001 confirmed","html":"<h1>Thanks for your order</h1>","text":"Thanks for your order","from_name":"My Shop","reply_to":"[email protected] "}'// Node.js 18+ (nothing to install)
const res = await fetch("https://api.tungkao.com/v1/email/send", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.TUNGKAO_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"to": [
"[email protected] "
],
"subject": "Order #1001 confirmed",
"html": "<h1>Thanks for your order</h1>",
"text": "Thanks for your order",
"from_name": "My Shop",
"reply_to": "[email protected] "
}),
});
const data = await res.json();
console.log(data);<?php
$ch = curl_init("https://api.tungkao.com/v1/email/send");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("TUNGKAO_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
"to" => [
"[email protected] "
],
"subject" => "Order #1001 confirmed",
"html" => "<h1>Thanks for your order</h1>",
"text" => "Thanks for your order",
"from_name" => "My Shop",
"reply_to" => "[email protected] "
]),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);import os, requests # pip install requests
r = requests.post(
"https://api.tungkao.com/v1/email/send",
headers={"Authorization": f"Bearer {os.environ['TUNGKAO_KEY']}"},
json={
"to": [
"[email protected] "
],
"subject": "Order #1001 confirmed",
"html": "<h1>Thanks for your order</h1>",
"text": "Thanks for your order",
"from_name": "My Shop",
"reply_to": "[email protected] "
},
timeout=30,
)
print(r.json())POST /v1/email/otp/send
curl Node.js PHP Python
ကူးရန်
curl -X POST https://api.tungkao.com/v1/email/otp/send \
-H "Authorization: Bearer $TUNGKAO_KEY" \
-H "Content-Type: application/json" \
-d '{"to":"[email protected] ","brand":"My Shop","lang":"th","length":6,"ttl_seconds":300}'// Node.js 18+ (nothing to install)
const res = await fetch("https://api.tungkao.com/v1/email/otp/send", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.TUNGKAO_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"to": "[email protected] ",
"brand": "My Shop",
"lang": "th",
"length": 6,
"ttl_seconds": 300
}),
});
const data = await res.json();
console.log(data);<?php
$ch = curl_init("https://api.tungkao.com/v1/email/otp/send");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("TUNGKAO_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
"to" => "[email protected] ",
"brand" => "My Shop",
"lang" => "th",
"length" => 6,
"ttl_seconds" => 300
]),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);import os, requests # pip install requests
r = requests.post(
"https://api.tungkao.com/v1/email/otp/send",
headers={"Authorization": f"Bearer {os.environ['TUNGKAO_KEY']}"},
json={
"to": "[email protected] ",
"brand": "My Shop",
"lang": "th",
"length": 6,
"ttl_seconds": 300
},
timeout=30,
)
print(r.json())POST /v1/email/otp/verify
curl Node.js PHP Python
ကူးရန်
curl -X POST https://api.tungkao.com/v1/email/otp/verify \
-H "Authorization: Bearer $TUNGKAO_KEY" \
-H "Content-Type: application/json" \
-d '{"otp_id":"8f6c2a1e-…","code":"123456"}'// Node.js 18+ (nothing to install)
const res = await fetch("https://api.tungkao.com/v1/email/otp/verify", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.TUNGKAO_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"otp_id": "8f6c2a1e-…",
"code": "123456"
}),
});
const data = await res.json();
console.log(data);<?php
$ch = curl_init("https://api.tungkao.com/v1/email/otp/verify");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("TUNGKAO_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
"otp_id" => "8f6c2a1e-…",
"code" => "123456"
]),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);import os, requests # pip install requests
r = requests.post(
"https://api.tungkao.com/v1/email/otp/verify",
headers={"Authorization": f"Bearer {os.environ['TUNGKAO_KEY']}"},
json={
"otp_id": "8f6c2a1e-…",
"code": "123456"
},
timeout=30,
)
print(r.json())
📚 အသုံးပြုပုံ ဥပမာများ ဥပမာ 1
Order confirmation email
အခြေအနေ: A customer completes an order
တောင်းဆိုချက်
POST /v1/email/send
{
"to": [
"[email protected] "
],
"subject": "Order #1001 confirmed",
"html": "<h1>Thanks for your order</h1>",
"text": "Thanks for your order",
"from_name": "My Shop",
"reply_to": "[email protected] "
}
➡️ Always send html and text; replies go to reply_to
ဥပမာ 2
Send an email OTP
အခြေအနေ: A new sign-up must confirm their email
တောင်းဆိုချက်
POST /v1/email/otp/send
{
"to": "[email protected] ",
"brand": "My Shop",
"lang": "th",
"length": 6,
"ttl_seconds": 300
}နမူနာ တုံ့ပြန်ချက်
{
"success": true,
"data": {
"otp_id": "8f6c2a1e-…"
}
}
➡️ Keep otp_id; the code expires in 5 minutes
ဥပမာ 3
Check the OTP
အခြေအနေ: The user types the 6-digit code
တောင်းဆိုချက်
POST /v1/email/otp/verify
{
"otp_id": "8f6c2a1e-…",
"code": "123456"
}
➡️ Correct = email confirmed · too many wrong tries = code locked, send a new one
ဥပမာ 4
Send to several people
အခြေအနေ: Tell three staff about a large order
တောင်းဆိုချက်
POST /v1/email/send
{
"to": [
"[email protected] ",
"[email protected] ",
"[email protected] "
],
"subject": "Large order #1002",
"text": "Order #1002: 25,000 THB"
}
➡️ Everyone listed receives the email
ဥပမာ 5
Review sent emails
အခြေအနေ: A customer says the email never arrived
တောင်းဆိုချက်
GET /v1/email/messages
➡️ Check the delivery status of each email
TUNGKAO လိပ်စာမှ ပို့သည်၊ from_name နှင့် reply_to မှာ သင့်ဟာ provider အားလုံးမအောင်လျှင် credit ပြန်အမ်း · SMTP ပူးတွဲဖိုင် မပို့
အသုံးပြုသူတစ်ဦးချင်းအတွက် BTC / USDT / USDC လိပ်စာ (TRON, Ethereum, BNB Chain, Polygon, Arbitrum, Base, Optimism, Avalanche) ပေး၍ webhook ဖြင့်အကြောင်းကြား — မကြာမီစတင်
အလုပ်လုပ်ပုံ အသုံးပြုသူအတွက် လိပ်စာတောင်း အသုံးပြုသူ ငွေပို့ crypto.deposit.confirmed ရလျှင် ငွေထည့်
POST /v1/crypto/addresses
curl Node.js PHP Python
ကူးရန်
curl -X POST https://api.tungkao.com/v1/crypto/addresses \
-H "Authorization: Bearer $TUNGKAO_KEY" \
-H "Content-Type: application/json" \
-d '{"asset":"USDT-TRC20","customer_ref":"member-1001"}'// Node.js 18+ (nothing to install)
const res = await fetch("https://api.tungkao.com/v1/crypto/addresses", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.TUNGKAO_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"asset": "USDT-TRC20",
"customer_ref": "member-1001"
}),
});
const data = await res.json();
console.log(data);<?php
$ch = curl_init("https://api.tungkao.com/v1/crypto/addresses");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("TUNGKAO_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
"asset" => "USDT-TRC20",
"customer_ref" => "member-1001"
]),
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);import os, requests # pip install requests
r = requests.post(
"https://api.tungkao.com/v1/crypto/addresses",
headers={"Authorization": f"Bearer {os.environ['TUNGKAO_KEY']}"},
json={
"asset": "USDT-TRC20",
"customer_ref": "member-1001"
},
timeout=30,
)
print(r.json())
📚 အသုံးပြုပုံ ဥပမာများ ဥပမာ 1
Get a deposit address for a customer
အခြေအနေ: member-1001 will pay in USDT on TRC20
တောင်းဆိုချက်
POST /v1/crypto/addresses
{
"asset": "USDT-TRC20",
"customer_ref": "member-1001"
}
➡️ You get a per-customer address to show as a QR
ဥပမာ 2
List supported coins and networks
အခြေအနေ: You want minimums and confirmations per coin
တောင်းဆိုချက်
GET /v1/crypto/assets
➡️ Returns min_deposit and confirmations_required per asset
ဥပမာ 3
Check incoming deposits
အခြေအနေ: Waiting for the customer's payment
တောင်းဆိုချက်
GET /v1/crypto/depositsနမူနာ တုံ့ပြန်ချက်
{
"success": true,
"data": [
{
"asset": "USDT-TRC20",
"customer_ref": "member-1001",
"amount": "25.00",
"confirmations": 20,
"confirmations_required": 20,
"status": "confirmed"
}
]
}
➡️ confirmed = credit · pending = wait · ignored = below minimum
ဥပမာ 4
Withdraw coins
အခြေအနေ: Withdraw USDT to your own wallet
တောင်းဆိုချက်
POST /v1/crypto/withdrawals
{
"asset": "USDT-TRC20",
"to_address": "T…your address…",
"amount": "100"
}
➡️ Always check the address matches the network; wrong-network transfers can't be recovered
💸 Withdrawal fees: funds received through the API pay 3.5% per withdrawal; wallets you create yourself in the merchant portal pay 2.5%. Taken from the withdrawn coin, not credits; deposits are free (live rate: withdraw_fee_percent in GET /v1/crypto/assets).
🚦 စနစ်အခြေအနေ (GET /status) API ပုံမှန်ဖြစ်မဖြစ် အချိန်မရွေးစစ်နိုင် — key မလို
GET https://api.tungkao.com/status
🟢 ok = ပုံမှန် 🟠 busy = အသုံးပြုသူများ 🔴 slow = အနည်းငယ်နှောင့်နှေး နောက်ဆုံး ၅ မိနစ် တောင်းဆိုမှုအစစ်မှ ဝန်ဆောင်မှုအလိုက် (services[]) တိုင်းတာ — စလစ်စစ်ခြင်းကို အရန်ပံ့ပိုးသူအားလုံးမှ တိုင်းပြီး routes[] တွင်ပြ key မလို၊ browser မှခေါ်နိုင်၊ ၁၅ စက္ကန့် cache busy/slow ဖြစ်ပါက timeout ကို ၁၅–၂၀ စက္ကန့်ထိတိုးပြီး Idempotency-Key တူတူဖြင့် ပြန်ကြိုးစားပါ tungkao.com ညာဘက်အပေါ်တွင်လည်း ပြသည်
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"
}
}
🛡️ တည်ငြိမ်မှုကတိ: တစ်ကြိမ်ချိတ် အမြဲသုံး API /v1 ကို အမြဲပိတ်ထား: မဖျက်၊ အမည်မပြောင်း၊ အမျိုးအစားမပြောင်း — ထပ်ထည့်ရုံသာ။ ကုဒ်ဟောင်းပျက်စေမည့် ပြောင်းလဲမှုကို အလိုအလျောက်စစ်ဆေးမှုက တားသည် provider များ (ဘဏ်၊ LINE၊ Google၊ Facebook၊ TikTok၊ Discord၊ Telegram၊ blockchain) ပြောင်းလျှင် ကျွန်ုပ်တို့ server ဘက်တွင်ပြင်သည် — သင့်ကုဒ်မပြောင်း။ စလစ်စစ်ခြင်းသည် provider ၃ ခုကြား အလိုအလျောက်ပြောင်းသည် အနာဂတ်ခံကုဒ်ရေးပါ: မသိသောကွက်ကိုကျော်၊ error.code ဖြင့်ဆုံးဖြတ်၊ မသိသော status အသစ်ကို 'မအောင်/စောင့်' ဟုယူပါ တစ်ခုခုကို ရပ်ရမည်ဆိုပါက အနည်းဆုံး ၁၂ လကြိုတင် Deprecation / Sunset header၊ email နှင့် webhook ဖြင့်အသိပေးမည် — ထိုနေ့အထိ အလုပ်လုပ်နေမည် တုံ့ပြန်မှုတိုင်းတွင် X-Tungkao-Api-Version header ပါသည်။ မှတ်တမ်းအပြည့်: /changelog.json
🏷️ TUNGKAO credit ပြသရန် စည်းကမ်း TUNGKAO ဝန်ဆောင်မှုသုံးသော စာမျက်နှာတိုင်းတွင် “Powered by TUNGKAO” သို့မဟုတ် “Secured by TUNGKAO” ကို မြင်သာစွာ ပြပြီး https://tungkao.com သို့ လင့်ခ်ချိတ်ရမည် ဝန်ဆောင်မှုအနီးတွင်ထား၊ မဖျောက်ရ “ဝင်ရောက်ခလုတ်” စာမျက်နှာမှ ခလုတ်များတွင် အလိုအလျောက်ပါသည် ဥပမာ: <a href="https://tungkao.com">Powered by TUNGKAO</a> ဖျောက်လိုပါက ကြိုတင်ခွင့်တောင်းပါ
Powered by TUNGKAO