POST /verify/truewallet
ตรวจสอบสลิปโอนเงิน TrueMoney Wallet ด้วยอัปโหลดรูปภาพ, Base64 หรือ URL
Endpoint
http
POST /verify/truewalletURL เต็ม: https://api.easyslip.com/v2/verify/truewallet
การยืนยันตัวตน
จำเป็น ดูคู่มือการยืนยันตัวตน
http
Authorization: Bearer YOUR_API_KEYRequest
วิธีการส่งข้อมูล
| วิธี | ฟิลด์ | Content-Type | คำอธิบาย |
|---|---|---|---|
| รูปภาพ | image | multipart/form-data | อัปโหลดไฟล์รูปภาพ |
| Base64 | base64 | application/json | รูปภาพที่เข้ารหัส Base64 |
| URL | url | application/json | URL ของรูปภาพสลิป |
ต้องระบุวิธีเดียว
คุณต้องระบุเพียง 1 อย่างจาก: image, base64 หรือ url
พารามิเตอร์เสริม
| พารามิเตอร์ | ประเภท | คำอธิบาย |
|---|---|---|
remark | string | หมายเหตุสำหรับติดตาม (1-255 ตัวอักษร) |
matchAccount | boolean | จับคู่ผู้รับกับบัญชี TrueMoney Wallet ที่ลงทะเบียน |
matchAmount | number | จำนวนเงินที่คาดหวังเพื่อตรวจสอบ |
checkDuplicate | boolean | ตรวจสอบว่าสลิปถูกตรวจสอบแล้วหรือไม่ (ค่าเริ่มต้น: false) |
Type Definitions
typescript
// Request Types
interface VerifyTrueWalletRequest {
// ต้องระบุอย่างใดอย่างหนึ่ง
image?: File; // ไฟล์รูปภาพ (multipart/form-data)
base64?: string; // รูปภาพเข้ารหัส Base64
url?: string; // URL ของรูปภาพ (1-255 ตัวอักษร)
// พารามิเตอร์เสริม
remark?: string; // 1-255 ตัวอักษร
matchAccount?: boolean;
matchAmount?: number;
checkDuplicate?: boolean;
}
// Response Types
interface VerifyTrueWalletResponse {
success: true;
data: VerifyTrueWalletData;
message: string;
}
interface VerifyTrueWalletData {
remark?: string;
isDuplicate: boolean;
matchedAccount: MatchedAccount | null;
amountInOrder?: number;
amountInSlip: number;
isAmountMatched?: boolean;
rawSlip: TrueWalletSlip;
}
interface MatchedAccount {
bank: {
nameTh: string;
nameEn: string;
code: string;
shortCode: string;
};
nameTh: string;
nameEn: string;
type: 'PERSONAL' | 'JURISTIC';
bankNumber: string;
}
interface TrueWalletSlip {
transactionId: string;
date: string; // ISO 8601
amount: number;
sender: {
name: string;
};
receiver: {
name: string;
phone: string; // ปิดบังบางส่วน
};
}
// Error Response
interface ErrorResponse {
success: false;
error: {
code: string;
message: string;
};
}ตัวอย่าง
bash
curl -X POST https://api.easyslip.com/v2/verify/truewallet \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "image=@/path/to/truemoney-slip.jpg"bash
curl -X POST https://api.easyslip.com/v2/verify/truewallet \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"base64": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAA..."}'bash
curl -X POST https://api.easyslip.com/v2/verify/truewallet \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/truemoney-slip.jpg"}'Response
Response สำเร็จ (200)
json
{
"success": true,
"data": {
"remark": "Order #12345",
"isDuplicate": false,
"matchedAccount": {
"bank": {
"nameTh": "ทรูมันนี่ วอลเล็ท",
"nameEn": "TrueMoney Wallet",
"code": "TRUEMONEYWALLET",
"shortCode": "TRUEWALLET"
},
"nameTh": "นาย รับเงิน ทดสอบ",
"nameEn": "",
"type": "PERSONAL",
"bankNumber": "0891234567"
},
"amountInOrder": 500.00,
"amountInSlip": 500.00,
"isAmountMatched": true,
"rawSlip": {
"transactionId": "12345678901234",
"date": "2024-01-15T14:30:00+07:00",
"amount": 500.00,
"sender": {
"name": "นาย ผู้โอน ทดสอบ"
},
"receiver": {
"name": "นาย รับเงิน ทดสอบ",
"phone": "08x-xxx-4567"
}
}
},
"message": "TrueMoney Wallet slip verified successfully"
}Error Responses
Validation Error (400)
json
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Please provide either a image file, a base64 encoded image, or a image URL"
}
}รูปภาพไม่ถูกต้อง (400)
json
{
"success": false,
"error": {
"code": "INVALID_IMAGE",
"message": "Image is not a valid TrueMoney Wallet slip"
}
}ไม่พบสลิป (404)
json
{
"success": false,
"error": {
"code": "SLIP_NOT_FOUND",
"message": "TrueMoney Wallet slip not found or invalid"
}
}เกินโควต้า (403)
json
{
"success": false,
"error": {
"code": "QUOTA_EXCEEDED",
"message": "Service quota limit has been reached"
}
}ข้อกำหนดรูปภาพ
| ข้อกำหนด | ค่า |
|---|---|
| ขนาดสูงสุด | 4 MB |
| รูปแบบที่รองรับ | JPEG, PNG, GIF, WebP |
| QR Code | ต้องมองเห็นได้ชัดเจน |
| ข้อจำกัด URL | HTTP/HTTPS เท่านั้น, ไม่รองรับ Private IP |
การจัดการสลิปซ้ำ
เมื่อ checkDuplicate: true:
| สถานการณ์ | ผลลัพธ์ | โควต้า |
|---|---|---|
| Branch เดียวกัน, ตรวจสอบแล้ว | ข้อมูล Cache, isDuplicate: true | ไม่หัก |
| สลิปใหม่ | ข้อมูลใหม่, isDuplicate: false | หัก |
การจับคู่บัญชี
เมื่อ matchAccount: true:
- ระบบตรวจสอบเบอร์โทรผู้รับกับบัญชี TrueMoney Wallet ที่คุณลงทะเบียน
- จับคู่จาก 4 หลักสุดท้ายของเบอร์โทรผู้รับ
- คืน
matchedAccount: nullถ้าไม่พบบัญชีที่ตรงกัน
หมายเหตุ
- Request ถูกนับรวมในโควต้ารายเดือน
- ตรวจสอบ
/infoendpoint สำหรับการใช้งานปัจจุบัน - QR Code ต้องมองเห็นได้ชัดเจนเพื่อผลลัพธ์ที่ดีที่สุด
- ใช้
checkDuplicate: trueเสมอเพื่อป้องกันการฉ้อโกง - ดูหน้าวิธีการแต่ละแบบสำหรับตัวอย่างโดยละเอียด