TrueMoney API Documentation

ระบบ API สำหรับตรวจสอบและแลกของขวัญ TrueMoney พร้อมตรวจสอบสลิปการโอนเงิน

Base URL: http://localhost:3000

GET

/verify

ตรวจสอบความถูกต้องของของขวัญ TrueMoney โดยจะไม่แลกอั่งเปา

Parameters

Parameter Type Status Description
gift string Required รหัสของขวัญหรือ URL
mobile string Required เบอร์โทรศัพท์ 10 หลัก

Example Request

GET /verify?gift=019acf013d917769798f084f6bfe416898E&mobile=0999999999

Success Response

{
  "success": true,
  "message": "ตรวจสอบสำเร็จ สามารถแลกของขวัญได้",
  "code": "SUCCESS",
  "voucher": {
    "code": "019acf013d917769798f084f6bfe416898E",
    "amount": "10.00",
    "status": "active",
    "available": true,
    "expire_date": "2025-12-31T23:59:59.000Z"
  },
  "owner": {
    "name": "John ***"
  }
}
POST

/redeem

แลกของขวัญและโอนเงินไปยังบัญชี TrueMoney

Request Body

Field Type Status Description
gift string Required รหัสของขวัญหรือ URL
mobile string Required เบอร์โทรศัพท์ 10 หลัก

Example Request

POST /redeem Content-Type: application/json { "gift": "019acf013d917769798f084f6bfe416898E", "mobile": "0999999999" }

Success Response

{
  "success": true,
  "message": "แลกของขวัญสำเร็จ",
  "code": "SUCCESS",
  "voucher": {
    "code": "019acf013d917769798f084f6bfe416898E",
    "amount": "10.00",
    "redeemed_amount": "10.00",
    "status": "active"
  },
  "owner": {
    "name": "John ***"
  },
  "redeemer": {
    "mobile": "0999999999",
    "name": "Jane ***",
    "amount_received": "10.00",
    "redeemed_at": "2024-01-01T12:00:00.000Z"
  }
}
POST

/verify

ตรวจสอบความถูกต้องของสลิปการโอนเงิน TrueMoney Wallet

Request Body

Field Type Status Description
qrcode_data string Required ข้อมูล QR Code จากสลิป
phone string Optional เบอร์ปลายทาง (เทียบ 3 ตัวหน้า + 4 ตัวหลัง)
amount string Optional จำนวนเงิน (เทียบกับยอดในสลิป)

Example Request

POST /verify Content-Type: application/json { "qrcode_data": "00020126360014com.truemoney...", "phone": "0920004561", "amount": "20025" }

Success Response

{
  "success": true,
  "message": "ตรวจสอบสลิปสำเร็จ",
  "code": "SUCCESS",
  "data": {
    "sender_mobile": "089***2345",
    "receiver_mobile": "092***4561",
    "amount": "20025",
    "message": "ค่าอาหาร",
    "transaction_date": "2026-01-29 14:20"
  }
}

Error Codes

INVALID_API_KEY
API Key ไม่ถูกต้องหรือหายไป
MISSING_PARAMETERS
ขาดพารามิเตอร์ที่จำเป็น
TARGET_USER_NOT_FOUND
ไม่พบเบอร์โทรศัพท์นี้ในระบบ TrueMoney
VOUCHER_NOT_FOUND
ไม่พบของขวัญนี้
VOUCHER_OUT_OF_STOCK
ของขวัญถูกใช้ไปแล้ว
VOUCHER_EXPIRED
ของขวัญหมดอายุแล้ว
CANNOT_GET_OWN_VOUCHER
ไม่สามารถแลกของขวัญของตัวเองได้
INVALID_SLIP
สลิปไม่ถูกต้อง
VALIDATION_FAILED
การตรวจสอบข้อมูลไม่ผ่าน
INTERNAL_ERROR
เกิดข้อผิดพลาดภายในระบบ

API Tester

Response

Response will appear here...

TrueMoney API | Make By Hitori