Skip to content

ตรวจสอบด้วย URL

ตรวจสอบสลิป TrueMoney Wallet ด้วย URL ของรูปภาพ

Endpoint

http
POST /verify/truewallet

URL เต็ม: https://api.easyslip.com/v2/verify/truewallet

การยืนยันตัวตน

จำเป็น ดูคู่มือการยืนยันตัวตน

http
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Request

พารามิเตอร์

พารามิเตอร์ประเภทจำเป็นคำอธิบาย
urlstringใช่URL ของรูปสลิป (1-255 ตัวอักษร)
remarkstringไม่หมายเหตุ (1-255 ตัวอักษร)
matchAccountbooleanไม่จับคู่ผู้รับกับบัญชีที่ลงทะเบียน
matchAmountnumberไม่จำนวนเงินที่คาดหวัง
checkDuplicatebooleanไม่ตรวจสอบสลิปซ้ำ

ข้อกำหนด URL

ข้อกำหนดค่า
ProtocolHTTP หรือ HTTPS เท่านั้น
ความยาวสูงสุด255 ตัวอักษร
Content typeต้องเป็นรูปภาพที่ถูกต้อง
ขนาดสูงสุด4 MB
ข้อจำกัด IPไม่รองรับ Private/Internal IP

ตัวอย่าง

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/slips/truemoney-slip.jpg",
    "checkDuplicate": true
  }'
javascript
const verifyTrueWallet = async (url, options = {}) => {
  const response = await fetch('https://api.easyslip.com/v2/verify/truewallet', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ url, ...options })
  });

  const result = await response.json();

  if (!result.success) {
    throw new Error(result.error.message);
  }

  return result.data;
};

// การใช้งาน
const slip = await verifyTrueWallet('https://example.com/slips/truemoney-slip.jpg', {
  checkDuplicate: true,
  matchAmount: 500.00
});

console.log('จำนวนเงิน:', slip.rawSlip.amount);
php
function verifyTrueWallet(string $url, array $options = []): array
{
    $apiKey = getenv('EASYSLIP_API_KEY');
    $data = array_merge(['url' => $url], $options);

    $ch = curl_init();
    curl_setopt_array($ch, [
        CURLOPT_URL => 'https://api.easyslip.com/v2/verify/truewallet',
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_POST => true,
        CURLOPT_HTTPHEADER => [
            'Authorization: Bearer ' . $apiKey,
            'Content-Type: application/json'
        ],
        CURLOPT_POSTFIELDS => json_encode($data)
    ]);

    $response = curl_exec($ch);
    curl_close($ch);

    $result = json_decode($response, true);

    if (!$result['success']) {
        throw new Exception($result['error']['message']);
    }

    return $result['data'];
}

// การใช้งาน
$slip = verifyTrueWallet('https://example.com/slips/truemoney-slip.jpg', [
    'checkDuplicate' => true
]);

echo "จำนวนเงิน: " . $slip['rawSlip']['amount'];
python
import requests
import os

def verify_truewallet(url: str, **options) -> dict:
    response = requests.post(
        'https://api.easyslip.com/v2/verify/truewallet',
        headers={
            'Authorization': f'Bearer {os.environ["EASYSLIP_API_KEY"]}',
            'Content-Type': 'application/json'
        },
        json={'url': url, **options}
    )

    result = response.json()

    if not result['success']:
        raise Exception(result['error']['message'])

    return result['data']

# การใช้งาน
slip = verify_truewallet(
    'https://example.com/slips/truemoney-slip.jpg',
    checkDuplicate=True
)

print(f"จำนวนเงิน: {slip['rawSlip']['amount']}")

Response

สำเร็จ (200)

json
{
  "success": true,
  "data": {
    "isDuplicate": false,
    "amountInSlip": 500.00,
    "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

Protocol ไม่ถูกต้อง (400)

json
{
  "success": false,
  "error": {
    "code": "URL_PROTOCOL_NOT_ALLOWED",
    "message": "Only HTTP and HTTPS protocols are allowed"
  }
}

IP Range ไม่ถูกต้อง (400)

json
{
  "success": false,
  "error": {
    "code": "URL_INVALID_IP_RANGE",
    "message": "URL points to a restricted IP range"
  }
}

เข้าถึง URL ไม่ได้ (400)

json
{
  "success": false,
  "error": {
    "code": "IMAGE_URL_UNREACHABLE",
    "message": "Unable to access the image URL"
  }
}

รูปภาพใหญ่เกินไป (400)

json
{
  "success": false,
  "error": {
    "code": "IMAGE_SIZE_TOO_LARGE",
    "message": "Image size exceeds 4MB limit"
  }
}

หมายเหตุ

  • ใช้ HTTPS URL เพื่อความปลอดภัย
  • URL ต้องเข้าถึงได้จากภายนอก
  • API มี timeout 10 วินาทีสำหรับดึงรูปจาก URL
  • แนะนำให้โฮสต์รูปบน CDN เพื่อความเสถียร

Bank Slip Verification API for Thai Banking