Sesuai ketentuan, halaman yang memakai layanan wajib menampilkan “Powered by TUNGKAO” (atau “Secured by TUNGKAO” untuk login/pembayaran) yang tertaut ke https://tungkao.com
Integrasi dengan TUNGKAO
Satu gaya API untuk semua layanan — Base URL: https://api.tungkao.com
🕒 Pembaruan API terbaru per kanal
Seluruh platform terakhir diperbarui:Waktu Thailand (UTC+07:00) — 📘 The TrueMoney Wallet docs page is now fully translated into all 10 languages (steps, examples, case table, notes)
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"))
Setiap respons berupa JSON dengan success dan request_id. Error membawa error.code (mis. KEY_EXPIRED, INSUFFICIENT_CREDITS) — lihat /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 kedaluwarsa sesuai pilihan (1–24 bulan atau tidak pernah). Kami mengingatkan 30/7/1 hari sebelumnya lewat webhook api_key.expiring. Perpanjang di portal — string key tetap sama.
Verifikasi domain: setiap key live terikat ke satu situs. API key → 'Verifikasi domain' → masukkan domain, unggah tungkao-verify-….html ke https://domain-anda/ (atau tambah DNS TXT _tungkao-verify.domain-anda) lalu tekan Verifikasi. Key belum terverifikasi mendapat DOMAIN_NOT_VERIFIED; domain terverifikasi tak bisa diubah dan akun lain tak bisa memakainya.
Secret bocor? Tekan 'Ganti sekarang' — tanpa batas, key lama langsung berhenti. Key hanya berfungsi untuk layanannya sendiri (selain itu WRONG_PRODUCT).
Lanjutan (opsional): aktifkan 'Tanda tangan request' pada key untuk mendapat tksign_…; setiap request lalu butuh X-Tungkao-Timestamp dan X-Tungkao-Signature = HMAC-SHA256(secret, ts.METHOD.path.sha256(body)). Key yang bocor saja jadi tak berguna.
🧪 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.
Kirim Accept-Language (th, en, lo, my, zh-CN, ko, ja, vi, km, id) untuk memilih bahasa pesan.
🧾
Verifikasi bukti transfer bank
slip_verify
Memeriksa bukti asli, jumlahnya cocok, dibayar ke Anda, dan belum dipakai — untuk toko yang pelanggannya melampirkan bukti.
Cara kerja
Pelanggan mengunggah bukti; situs Anda membaca teks QR-nya (diawali 0041…).
Kirim qr_payload, jumlah yang diharapkan, dan rekening penerima ke API.
2 situs (aaa.com, bbb.com) menerima ke rekening yang sama
Kedua key: Grup A (atau Seluruh akun)
Bukti yang lolos di aaa.com mengembalikan DUPLICATE di bbb.com — hanya bisa dipakai di satu situs ✅
2 situs berbagi rekening tetapi key terpisah (default)
Kedua key: Hanya key ini
Satu bukti lolos di kedua situs ⚠️ pelanggan bisa top-up dua kali — tautkan key
2 situs dengan rekening penerima berbeda
Hanya key ini (default)
Bukti untuk satu situs sudah mengembalikan RECEIVER_MISMATCH di situs lain ✅
2 situs di akun tungkao berbeda (pemilik berbeda) tetapi rekening penerima sama
Key tidak bisa ditautkan antar akun tungkao
Satu bukti lolos di keduanya ⚠️ — beli kedua key dari satu akun tungkao lalu tautkan
Satu situs memakai 2 key (mis. situs web + aplikasi)
Kedua key: grup yang sama
Bukti hanya bisa dipakai sekali, dari situs web maupun aplikasi ✅
DUPLICATE terdeteksi langsung dari nomor referensi di QR. Atur di kartu “Perlindungan bukti ganda antar key” pada halaman API Keys (default key baru: hanya key ini).
📚 Contoh penggunaan
Contoh 1
Customer tops up with a matching slip (passes)
Situasi: A customer transfers 500 THB to your account and uploads the slip on your top-up page
Permintaan
POST /v1/slip/verify
{
"image_base64": "<base64 of the slip image>",
"expected_amount": "500.00"
}
➡️ HTTP 503 and nothing is charged. Ask the customer to retry later, or queue it for manual review
Kirim header Idempotency-Key (mis. nomor pesanan): pengulangan tidak pernah ditagih dua kali.
Satu bukti hanya VALID sekali per key (kedua kalinya 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).
Verifikasi bukti TrueMoney Wallet
truewallet_verify
Mengecek bukti transfer TrueMoney Wallet asli, nominalnya sesuai, masuk ke nomor e-wallet Anda dan belum pernah dipakai.
Cara kerja
Simpan dompet penerima sekali (PUT /v1/truewallet/profile, atau di kartu key pada portal): nomor HP dompet atau e-Wallet ID, nama Thai/Inggris dan gambar QR penerima.
Tampilkan gambar QR (qr_image_url) agar pelanggan membayar, lalu minta pelanggan mengunggah gambar bukti.
Kirim gambar bukti (image_base64) dan nominal yang diharapkan ke API. Nomor dan nama diambil dari profil tersimpan (atau kirim wallet_number / ewallet_id di permintaan).
2 situs (aaa.com, bbb.com) menerima ke rekening yang sama
Kedua key: Grup A (atau Seluruh akun)
Bukti yang lolos di aaa.com mengembalikan DUPLICATE di bbb.com — hanya bisa dipakai di satu situs ✅
2 situs berbagi rekening tetapi key terpisah (default)
Kedua key: Hanya key ini
Satu bukti lolos di kedua situs ⚠️ pelanggan bisa top-up dua kali — tautkan key
2 situs dengan rekening penerima berbeda
Hanya key ini (default)
Bukti untuk satu situs sudah mengembalikan RECEIVER_MISMATCH di situs lain ✅
2 situs di akun tungkao berbeda (pemilik berbeda) tetapi rekening penerima sama
Key tidak bisa ditautkan antar akun tungkao
Satu bukti lolos di keduanya ⚠️ — beli kedua key dari satu akun tungkao lalu tautkan
Satu situs memakai 2 key (mis. situs web + aplikasi)
Kedua key: grup yang sama
Bukti hanya bisa dipakai sekali, dari situs web maupun aplikasi ✅
DUPLICATE terdeteksi langsung dari nomor referensi di QR. Atur di kartu “Perlindungan bukti ganda antar key” pada halaman API Keys (default key baru: hanya key ini).
📚 Contoh penggunaan
Contoh 1
Simpan dompet penerima sekali
Situasi: Toko Anda menerima ke TrueMoney 081-234-5678 (Somchai) dan punya QR penerima
Permintaan
PUT /v1/truewallet/profile
{
"receive_by": "wallet_number",
"wallet_number": "0812345678",
"name_en": "Somchai Jaidee",
"qr_image_base64": "<base64 of the QR image>"
}
➡️ Tidak perlu mengirim nomor lagi; dompet yang tersimpan di key dipakai
Contoh 3
Terima hanya dengan e-Wallet ID
Situasi: Pelanggan membayar lewat e-Wallet ID 15 digit; Anda tidak perlu membagikan nomor HP
Permintaan
PUT /v1/truewallet/profile
{
"receive_by": "ewallet_id",
"ewallet_id": "140000812345678"
}
➡️ Bukti ke nomor HP mengembalikan RECEIVER_MISMATCH; hanya e-Wallet ID yang diterima
Contoh 4
Kirim penerima di permintaan (beberapa dompet)
Situasi: Anda bergantian memakai beberapa dompet per cabang
Permintaan
POST /v1/truewallet/verify
{
"image_base64": "<base64 of the slip image>",
"expected_amount": "300.00",
"wallet_numbers": [
"0812345678",
"0898765432"
],
"wallet_name_en": "Somchai Jaidee"
}
➡️ Lolos jika bukti masuk ke salah satu dompet di daftar dan namanya cocok
Contoh 5
Penyedia utama gangguan, cadangan mengambil alih
Situasi: Pemeriksa utama gagal saat pelanggan mengirim
Permintaan
POST /v1/truewallet/verify
{
"image_base64": "<base64 of the slip image>",
"expected_amount": "300.00"
}
➡️ Cadangan memverifikasi dalam permintaan yang sama. Kirim image_base64: cadangan memverifikasi dari gambar
Contoh 6
Bukti ganda atau nominal salah
Situasi: Pelanggan mengirim ulang bukti atau membayar kurang
Contoh respons
{
"success": false,
"status": "DUPLICATE"
}
➡️ DUPLICATE = sudah dipakai · AMOUNT_MISMATCH = nominal salah. Jangan tambahkan kredit pada kedua kasus
Tentukan penerima dengan salah satu atau keduanya: wallet_number (nomor HP 10 digit) atau ewallet_id (e-Wallet ID 15 digit). Bukti yang cocok dengan salah satunya lolos.
Pilih cara menerima lewat receive_by: wallet_number (hanya nomor), ewallet_id (hanya e-Wallet ID) atau any (default, salah satu). Bukti dicek terhadap identitas yang dipilih.
Nama penerima: name_th, name_en atau keduanya (wallet_name_th / wallet_name_en di permintaan verifikasi). Jika diatur, bukti harus cocok dengan salah satunya; jika tidak, nama tidak dicek.
Gambar QR penerima: JPG/PNG maks 1 MB dengan QR yang terbaca. Anda mendapat qr_image_url untuk halaman pembayaran; mengunggah gambar baru membuat tautan baru.
wallet_number adalah nomor HP 10 digit dompet penerima. Kirim beberapa dengan wallet_numbers (maks 10), atau simpan di key pada portal.
Respons dan status sama dengan /v1/slip/verify. Satu bukti hanya VALID sekali per key (kedua kalinya DUPLICATE).
Kirim header Idempotency-Key (mis. nomor pesanan): pengulangan tidak pernah ditagih dua kali.
🏦
Deposit bukti transfer
slip_deposit
Isi saldo pengguna: memeriksa bukti, mencatat deposit pengguna itu, dan memberi tahu situs lewat webhook.
Cara kerja
Atur rekening penerima dan URL webhook pada key di portal.
Kirim bukti dengan customer_ref (ID pengguna Anda).
Saat webhook deposit.succeeded (verifikasi tanda tangannya) tambahkan saldo pengguna.
Setiap webhook membawa X-Tungkao-Signature: t=…,v1=…. Verifikasi sebelum memercayai data (secret webhook tampil saat Anda mengatur 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]));
}
Situasi: A member tries to deposit again with the same slip
Contoh respons
{
"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.
Cara kerja
Buat key untuk penyedia, lalu di 'Member login' atur nama situs dan redirect URI (https, sama persis).
Tombol login mengarahkan pengguna ke /oauth/authorize dengan client_id (ID key), redirect_uri, dan state (acak baru, disimpan di session).
Pengguna kembali ke redirect_uri?code=…&state=… → cek state → server memanggil POST /v1/login/token dalam 2 menit.
Gunakan data.user (mis. 7F3K9QX2-yourshopcom) sebagai ID member — orang yang sama selalu mendapat ID yang sama.
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.
Contoh lengkap (tombol + callback + tukar code)
// 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("/")
Penyedia
Layanan
Yang Anda dapat
Google
google_login
nama, email terverifikasi, foto
LINE
line_login
nama, foto, email jika pengguna setuju
Facebook
facebook_login
nama, foto, email
TikTok
tiktok_login
nama tampilan, avatar (tanpa email)
Discord
discord_login
nama, avatar, email
Telegram
telegram_login
name, username, photo
X (Twitter)
x_login
name, username, photo
Microsoft
microsoft_login
name, email (Hotmail/Outlook)
GitHub
github_login
name, email, avatar
Apple
apple_login
permanent member ID (no name or email in this mode)
Steam
steam_login
name, avatar and SteamID (no email)
Twitch
twitch_login
name, email, avatar
LinkedIn
linkedin_login
name, email, photo
Kakao
kakao_login
name, photo (email once Kakao approves it)
NAVER
naver_login
name, email, photo
Zalo
zalo_login
name, photo (no email)
Spotify
spotify_login
name, email, photo
Reddit
reddit_login
username, avatar (no email)
GitLab
gitlab_login
name, email, avatar
Roblox
roblox_login
name, avatar (no email)
Epic Games
epicgames_login
display name (no email)
Yahoo
yahoo_login
name, email, photo
Slack
slack_login
name, email, photo
Amazon
amazon_login
name, email
📚 Contoh penggunaan
Contoh 1
A “Sign in with Google” button on your site
Situasi: A visitor taps Sign in with Google on your site
Permintaan
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
Contoh 2
Exchange the code for the user (server side)
Situasi: Your server receives the code on the callback page (exchange within 2 minutes)
Permintaan
POST /v1/login/token
{
"code": "<code from the callback>",
"redirect_uri": "https://yourshop.com/auth/callback"
}
➡️ Same user every time → look up the member and sign them in
Contoh 4
One site, two Google keys (website + app)
Situasi: 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
Contoh 5
List members who signed in
Situasi: You want to browse or search members of this key
Permintaan
GET /v1/login/users?q=somchai&limit=50
➡️ Returns members with last sign-in time and count
Contoh 6
The user cancels during sign-in
Situasi: 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.
Kredit dipotong setiap login berhasil dan sekali per member baru — lihat harga terkini di kartu layanan.
Key mode test mengizinkan redirect http://localhost dan gratis.
Jangan pernah taruh API key di tautan atau halaman — /oauth/authorize hanya butuh client_id (ID key) yang publik.
✈️
Notifikasi Telegram
telegram_notify
Kirim pesan Telegram ke pengguna lewat bot TUNGKAO — tanpa bot sendiri. Mis. dana masuk, status pesanan, OTP.
Cara kerja
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/send
{
"refs": [
"member-1001",
"member-1002",
"member-1003"
],
"text": "New promotion today"
}
➡️ Sent to each member; check results with GET /v1/telegram/messages
Contoh 5
A member stops notifications
Situasi: The member asks to disconnect
Permintaan
DELETE /v1/telegram/recipients/member-1001
➡️ The link is removed; no more messages are sent
Hanya pesan terkirim yang ditagih — kegagalan (mis. pengguna memblokir bot) dikembalikan dan penerima itu dijeda.
🔔
Notifikasi Discord
discord_notify
Kirim pesan ke kanal Discord Anda atau pelanggan — mis. pesanan baru untuk tim.
Cara kerja
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/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
Contoh 2
Send an email OTP
Situasi: A new sign-up must confirm their email
Permintaan
POST /v1/email/otp/send
{
"to": "[email protected]",
"brand": "My Shop",
"lang": "th",
"length": 6,
"ttl_seconds": 300
}
Email dikirim dari alamat TUNGKAO; nama pengirim (from_name) dan reply_to milik Anda.
Jika semua penyedia gagal, kredit dikembalikan otomatis · lampiran via SMTP tidak diteruskan.
₿
Pembayaran kripto (segera hadir)
crypto
Setiap pengguna mendapat alamat BTC / USDT / USDC sendiri (TRON, Ethereum, BNB Chain, Polygon, Arbitrum, Base, Optimism, Avalanche) dan Anda diberi tahu lewat webhook — segera hadir.
➡️ 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).
🚦 Status sistem (GET /status)
Cek kapan saja apakah API normal — tanpa key
GET https://api.tungkao.com/status
🟢 ok = normal
🟠 busy = lalu lintas tinggi
🔴 slow = sedikit tertunda
Diukur dari permintaan nyata 5 menit terakhir per layanan (services[]). Verifikasi/deposit bukti transfer diukur dari semua penyedia cadangan, status tiap jalur di routes[]
Tanpa API key, bisa dipanggil dari browser (CORS terbuka), cache 15 detik — cek paling sering 1 kali/menit
Saat busy/slow, naikkan timeout ke 15–20 detik dan ulangi dengan Idempotency-Key yang sama — tidak ditagih dua kali
🛡️ Janji stabilitas: integrasi sekali, terus berjalan
API /v1 dibekukan permanen: tidak ada yang dihapus, diganti nama, atau diubah tipenya — hanya penambahan field atau endpoint baru. Tes kontrak otomatis memblokir deploy yang merusak kode lama.
Saat penyedia (bank, LINE, Google, Facebook, TikTok, Discord, Telegram, blockchain) berubah, kami menyesuaikan di server kami — kode Anda tetap sama. Cek bukti otomatis berpindah antara 3 penyedia.
Tulis kode tahan masa depan: abaikan field yang tak dikenal, bercabang berdasarkan error.code (bukan teks pesan), dan anggap status baru yang tak dikenal sebagai “tidak lolos / menunggu”.
Jika suatu saat sesuatu harus dihentikan, kami umumkan minimal 12 bulan sebelumnya lewat header Deprecation / Sunset di setiap respons, email, dan webhook — perilaku lama tetap berjalan sampai saat itu.
Setiap respons membawa header X-Tungkao-Api-Version berisi versi dan tanggal revisi terbaru. Riwayat lengkap: /changelog.json
🏷️ Ketentuan mencantumkan kredit TUNGKAO
Setiap halaman yang memakai layanan TUNGKAO wajib menampilkan teks “Powered by TUNGKAO” atau “Secured by TUNGKAO” yang terlihat dan tertaut ke https://tungkao.com
Letakkan dekat fiturnya; jangan disembunyikan, disamarkan, atau terlalu kecil
Tombol dari halaman “Tombol login” sudah otomatis menyertakan kredit; halaman login TUNGKAO juga menampilkannya
Contoh: <a href="https://tungkao.com" target="_blank" rel="noopener">Powered by TUNGKAO</a>
Untuk menghapus kredit (white-label), minta persetujuan terlebih dahulu