หน้าแรก ร้านค้า เติมเงิน API OTP เติมเกม เข้าสู่ระบบ สมัครสมาชิก

Reseller API

เชื่อมต่อร้านค้าของคุณกับ GOODBUY24 — สั่งซื้อสินค้าอัตโนมัติผ่าน API

API Key
Documentation
Playground

Authentication & Base URL

ทุก request ต้องส่ง API Key อย่างใดอย่างหนึ่ง:

Header: X-API-Key: YOUR_API_KEY

Query param: ?api_key=YOUR_API_KEY

Base URL:

https://www.goodbuy24.store/api/v1/
📱 OTP Endpoints
GET ?action=categories รายการหมวดหมู่ทั้งหมด

ไม่มี parameter เพิ่มเติม

{ "status": "success", "message": "OK", "data": [ { "id": 1, "name": "Game Top-Up", "slug": "game-top-up", "icon": "shopping-cart", "description": "เติมเกมทุกแพลตฟอร์ม" } ] }
GET ?action=products รายการสินค้า
NameTypeDescription
category_id optionalintกรองตามหมวดหมู่
{ "status": "success", "data": [ { "id": 5, "name": "Roblox 100 Robux", "price": "35.00", "min_qty": 1, "max_qty": 10, "stock": 24 } ] }
GET ?action=product_detail รายละเอียดสินค้า
NameTypeDescription
id requiredintProduct ID
{ "status": "success", "data": { "id": 5, "name": "Roblox 100 Robux", "price": "35.00", "stock": 24, "category_name": "Game Top-Up", "total_sold": 150 } }
POST ?action=purchase สั่งซื้อสินค้า
NameTypeDescription
product_id requiredintID สินค้าที่ต้องการซื้อ
quantity optionalintจำนวน (default: 1, จำกัดตาม min_qty/max_qty)
{ "status": "success", "message": "Purchase successful.", "data": { "order_id": 42, "product_name": "Roblox 100 Robux", "quantity": 2, "total_price": 70, "balance_after": 430, "items": ["CODE-XXXX-1", "CODE-XXXX-2"] } }
GET ?action=orders ประวัติการสั่งซื้อ
NameTypeDescription
page optionalintหน้า (default: 1)
limit optionalintจำนวนต่อหน้า (default: 20, max: 50)
{ "data": { "orders": [{"id":42, "product_name":"...", "quantity":2, "total_price":"70.00", "status":"completed"}], "total": 15, "page": 1, "total_pages": 1 } }
GET ?action=order_detail รายละเอียดออเดอร์ + items
NameTypeDescription
order_id requiredintOrder ID
{ "data": { "id": 42, "product_name": "Roblox 100 Robux", "items": ["CODE-XXXX-1", "CODE-XXXX-2"] } }
GET ?action=balance เช็คยอดเงินคงเหลือ
{ "data": { "balance": 500.00 } }
GET ?action=profile ข้อมูล reseller
{ "data": { "user": {"username":"reseller01", "balance":"500.00"}, "total_orders": 15, "total_spent": 1250.50, "rate_limit": 60 } }
📱 OTP Endpoints
GET ?action=otp_services รายการบริการ OTP ทั้งหมด
NameTypeDescription
country optionalintรหัสประเทศ (default: 52 = Thailand)
{ "status": "success", "data": [ { "code": "tg", "name": "Telegram", "price": 3.50, "available": true, "available_count": 5776, "provider": "otp24hr" } ] }
POST ?action=otp_buy ซื้อเบอร์ OTP
NameTypeDescription
service requiredstringรหัสบริการ เช่น "tg", "wa", "fb"
country optionalintรหัสประเทศ (default: 52)
provider optionalstring"otp24hr" (default) หรือ "herosms"
{ "status": "success", "message": "OTP purchased.", "data": { "order_id": 12345, "phone": "0812345678", "service": "Telegram", "price": 3.50, "balance_after": 496.50, "expires_in_min": 20, "provider": "otp24hr" } }

1. เรียก otp_services เพื่อดูรายการบริการและราคา
2. เรียก otp_buy — ระบบหักเงินและส่งคืน order_id + เบอร์โทร
3. เรียก otp_status ซ้ำทุก 3-5 วินาที จนกว่าจะได้รับ OTP code
4. (ถ้าต้องการรอบถัดไป) เรียก otp_resend — ได้ order_id ใหม่ฟรี
5. (ถ้ายกเลิก) เรียก otp_cancel — ระบบคืนเงินอัตโนมัติ

GET ?action=otp_status เช็คสถานะ OTP / รับรหัส
NameTypeDescription
order_id requiredintOrder ID ที่ได้จาก otp_buy
{ "status": "success", "data": { "order_id": 12345, "phone": "0812345678", "status": "received", "otp_code": "123456", "messages": [ { "otp_code": "123456", "full_sms": "Your code is 123456", "received_at": "2025-01-15 12:30:45" } ], "seconds_left": 850 } }
StatusDescription
waitingรอรับ OTP อยู่
receivedได้รับ OTP แล้ว
successเสร็จสิ้น (ใช้ resend ไปแล้ว)
cancelยกเลิกแล้ว (คืนเงินแล้ว)
timeoutหมดเวลา (20 นาที)
POST ?action=otp_resend ขอ OTP รอบถัดไป (ฟรี)
NameTypeDescription
order_id requiredintOrder ID ปัจจุบัน (ต้องได้รับ OTP แล้วอย่างน้อย 1 ครั้ง)
{ "status": "success", "message": "Resend successful. Use new order_id to poll status.", "data": { "new_order_id": 12346, "original_order_id": 12345, "phone": "0812345678", "price": 0 } }

⚠️ เฉพาะ OTP24HR เท่านั้น — ได้เบอร์เดิม ไม่เสียค่าใช้จ่าย
ใช้ new_order_id เรียก otp_status ต่อเพื่อรอรับ OTP รอบใหม่

POST ?action=otp_cancel ยกเลิก OTP + คืนเงิน
NameTypeDescription
order_id requiredintOrder ID ที่ต้องการยกเลิก (status ต้องเป็น waiting หรือ received)
{ "status": "success", "message": "Order cancelled and refunded.", "data": { "order_id": 12345, "refunded": 3.50, "balance_after": 500.00 } }
GET ?action=otp_history ประวัติ OTP ทั้งหมด
NameTypeDescription
page optionalintหน้า (default: 1)
limit optionalintจำนวนต่อหน้า (default: 20, max: 50)
{ "status": "success", "data": { "orders": [ { "order_id": 12345, "provider": "otp24hr", "service_code": "tg", "service_name": "Telegram", "phone": "0812345678", "price": "3.50", "otp_code": "123456", "status": "received", "created_at": "2025-01-15 12:30:00" } ], "total": 8, "page": 1, "limit": 20, "total_pages": 1 } }

Error Codes

CodeDescription
400Bad Request — parameter ไม่ถูกต้อง
401Unauthorized — API Key ไม่ถูกต้อง
403Forbidden — Key ถูกปิดหรือบัญชีถูกระงับ
404Not Found
429Too Many Requests — เกิน rate limit (60 req/min)
500Server Error

API Key

Endpoint

GET categories
GET products
GET product_detail
POST purchase
GET orders
GET order_detail
GET balance
GET profile
OTP
GET otp_services
POST otp_buy
GET otp_status
POST otp_resend
POST otp_cancel
GET otp_history
GET ?action=categories
// กด Send Request เพื่อดู response