บัญชี — โอน credit
หน้า Account → Transfer Money ส่ง credit ไป username อื่นภายใต้โดเมนลงทะเบียนเดียวกัน ใช้ access_token ของผู้ส่ง
ใส่ โดเมนลงทะเบียน ใน form — ไม่ใช่ hostname API
ไม่ใช่ merchant send
POST /admin/credits/send ใช้ token merchant บนเซิร์ฟเวอร์ การโอนของ user ใช้ token end-user ดู Admin (server-only)
Playground & Profile
Playground — Home feed → แพลตฟอร์ม → โอน credit เมื่อรัน npm run docs:stack Profile → บัญชี ใช้ flow เดียวกันเมื่อลงชื่อแล้ว — โอนจริง upstream ไม่ยกเลิก
HTTP 200 แต่ error ธุรกิจ
Upstream มักคืน HTTP 200 พร้อม { "error": 1, "message": "…" } ถือ error ไม่เป็นศูนย์ หรือ success: false ว่าล้มเหลว
กฎ (UI dealer)
| กฎ | ค่า |
|---|---|
| ขั้นต่ำต่อครั้ง | 10,000 credits |
| สูงสุดต่อครั้ง | 20,000,000 credits |
| ยอดคงเหลือหลังโอน | ต้อง > 500,000 credits ในกระเป๋าผู้ส่ง |
Preflight: ก่อนเรียก API ตรวจว่ายอดผู้ส่ง ≥ value + 500_001 credits
Upstream
POST https://api.gommo.net/api/apps/go-mmo/users/sendBalances
Content-Type: application/x-www-form-urlencoded
| Field | จำเป็น | หมายเหตุ |
|---|---|---|
access_token | ใช่ | Token session ผู้ส่ง |
domain | ใช่ | โดเมนลงทะเบียน |
type | ใช่ | UI dealer: credit_ai |
value | ใช่ | จำนวน credits |
username | ใช่ | username ผู้รับ |
message | ใช่ | หมายเหตุบังคับ |
language | ไม่ | เช่น EN, TH |
device_id, device_name, device_info | ไม่ | เหมือน login / เปลี่ยนรหัส |
PowerShell (ตั้ง domain — ใช้ token จริงในสภาพแวดล้อมปลอดภัย):
$domain = $env:GOMMO_API_DOMAIN
if (-not $domain) { throw 'Set GOMMO_API_DOMAIN to your registration domain' }
$h = @{ 'Content-Type' = 'application/x-www-form-urlencoded' }
$body = "access_token=$env:TOKEN&domain=$domain&type=credit_ai&value=10000&username=recipient_username&message=Transfer+note&language=EN"
Invoke-RestMethod -Method Post -Uri 'https://api.gommo.net/api/apps/go-mmo/users/sendBalances' -Headers $h -Body $bodyตัวอย่างถูกปฏิเสธ (HTTP 200):
{
"error": 1,
"message": "…must keep more than 500,000 credits…"
}Mode B (gateway)
POST {gateway}/gateway/credits/transfer — Bearer + JSON:
{
"username": "recipient_username",
"value": 10000,
"message": "Transfer note",
"type": "credit_ai",
"language": "EN"
}เซิร์ฟเวอร์เติม access_token, domain; ค่าเริ่มต้น type credit_ai Playground ส่ง device_* ของเบราว์เซอร์ใน JSON
Pass-through JSON upstream; body ว่าง/non-JSON → UPSTREAM_ERROR
OpenAPI: openapi.yaml — /gateway/credits/transfer
SDK: @ai-gateway/client — auth.transferCredits() ดู SDK authentication
→ ประวัติธุรกรรม · อุปกรณ์เซสชัน · ตั๋วซัพพอร์ต · โปรแกรมพาร์ทเนอร์ · Creator Rewards · เปลี่ยนรหัสผ่าน · สมัครสมาชิก · Endpoint map · Deploy → Self-host (advanced)
