Register a Discord channel
Situasi: 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
API v1 · Terakhir diperbarui: Waktu Thailand (UTC+07:00)
https://tungkao.com · https://api.tungkao.com/docs
Sesuai ketentuan, halaman yang memakai layanan wajib menampilkan “Powered by TUNGKAO” (atau “Secured by TUNGKAO” untuk login/pembayaran) yang tertaut ke https://tungkao.com
discord_notifyKirim pesan ke kanal Discord Anda atau pelanggan — mis. pesanan baru untuk tim.
🕒 Terakhir diperbarui: Waktu Thailand (UTC+07:00) · ✅ Kode lama tetap berjalan
Salin tautan ini untuk dibaca AI (seluruh API dalam Markdown) atau tekan tombol: prompt disalin dan AI dibuka
https://api.tungkao.com/docs/api/discord_notify.md?lang=idhttps://api.tungkao.com/changelog/discord_notify.jsonTautan ini mengembalikan pembaruan API ini sebagai JSON (tanpa key, dari asal mana pun). Tampilkan di halaman admin sebagai kotak “Pengumuman pembaruan” dan tandai “Baru” saat last_updated berubah
Salin + buka di: Menekan tombol AI otomatis menyalin prompt — jika kotak chat kosong, tinggal tempel
Buat key discord_notify di portal merchant (API key) dan kirim header ini di setiap request — key layanan lain tidak berfungsi di sini
Authorization: Bearer $TUNGKAO_KEY/v1/discord/webhookscurl -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())/v1/discord/sendcurl -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())Situasi: 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
Situasi: 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
Situasi: 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
Situasi: 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
Situasi: You want to see which messages failed
GET /v1/discord/messages
➡️ Returns each message with its status
✅ Kode lama tetap berjalan
Cek kapan saja apakah API normal — tanpa key
GET https://api.tungkao.com/status
curl https://api.tungkao.com/status{
"success": true,
"data": {
"status": "ok",
"services": [
{ "id": "slip_verify", "status": "ok", "routes": ["ok", "ok", "busy"] },
{ "id": "slip_deposit", "status": "ok", "routes": ["ok", "ok", "busy"] },
{ "id": "login", "status": "ok" },
{ "id": "telegram", "status": "ok" },
{ "id": "discord", "status": "ok" },
{ "id": "email", "status": "busy" },
{ "id": "crypto", "status": "ok" },
{ "id": "core", "status": "ok" }
],
"paused": [],
"updated_at": "2026-11-14T12:00:00.000Z"
}
}Powered by TUNGKAO