Skip to content

POST /verify/truewallet ​

Verify a TrueMoney Wallet transfer slip by uploading an image or sending the text of its QR code.

The API reads the TrueMoney P2P transfer QR on the slip and checks it with TrueMoney. It does not read the text printed on the slip, so the image must contain that QR. A bank transfer QR is rejected with invalid_wallet_qr.

Endpoint ​

http
POST /verify/truewallet

Full URL: https://api.thunder.in.th/v1/verify/truewallet

v2 Available

TrueMoney Wallet verification is now also available in API v2 with additional features like Base64, URL input, account matching, and amount matching.

Authentication ​

Required. See Authentication Guide.

http
Authorization: Bearer YOUR_API_KEY
Content-Type: multipart/form-data

Request ​

Parameters ​

Send exactly one of file or payload. file goes in multipart/form-data. payload can go in a JSON body or as a form field.

ParameterTypeRequiredDescription
fileFileOne ofSlip image file
payloadstringOne ofText of the TrueMoney QR code (1-256 characters)
checkDuplicatebooleanNoCheck for duplicate slip

Image Requirements ​

RequirementValue
Maximum size4 MB
Supported formatsJPEG, PNG, GIF, WebP
QR codeMust contain a readable TrueMoney P2P transfer QR

Type Definitions ​

typescript
// Request: exactly one of file (multipart/form-data) or payload
interface VerifyTrueMoneyRequest {
  file?: File;              // Image file
  payload?: string;         // TrueMoney QR text (1-256 chars)
  checkDuplicate?: boolean;
}

// Response
interface VerifyTrueMoneyResponse {
  status: 200;
  data: TrueMoneySlipData;
}

interface TrueMoneySlipData {
  transactionId: string;
  date: string;              // ISO 8601
  amount: number;
  sender?: {                 // Only when TrueMoney returns the sender phone
    phone: string;           // Masked mobile, e.g. 08-xxx-2345
  };
  receiver?: {               // Only when TrueMoney returns the receiver phone
    phone: string;           // Masked mobile, e.g. 08-xxx-4567
  };
}

// Error Response
interface ErrorResponse {
  status: number;
  message: string;
  data?: TrueMoneySlipData;  // Included when duplicate_slip
}

Examples ​

bash
curl -X POST https://api.thunder.in.th/v1/verify/truewallet \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@/path/to/truemoney-slip.jpg" \
  -F "checkDuplicate=true"
bash
curl -X POST https://api.thunder.in.th/v1/verify/truewallet \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"payload": "TRUEMONEY_QR_TEXT", "checkDuplicate": true}'
javascript
const verifyTrueMoney = async (file, checkDuplicate = false) => {
  const formData = new FormData();
  formData.append('file', file);
  formData.append('checkDuplicate', String(checkDuplicate));

  const response = await fetch(
    'https://api.thunder.in.th/v1/verify/truewallet',
    {
      method: 'POST',
      headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
      body: formData
    }
  );

  const result = await response.json();

  if (result.status !== 200) {
    throw new Error(result.message);
  }

  return result.data;
};

// Usage
const fileInput = document.getElementById('slipFile');
fileInput.addEventListener('change', async (e) => {
  const file = e.target.files[0];
  const slip = await verifyTrueMoney(file, true);
  console.log('Transaction ID:', slip.transactionId);
  console.log('Amount:', slip.amount);
});
php
function verifyTrueMoney(string $filePath, bool $checkDuplicate = false): array
{
    $apiKey = getenv('THUNDER_API_KEY');

    $ch = curl_init();
    curl_setopt_array($ch, [
        CURLOPT_URL => 'https://api.thunder.in.th/v1/verify/truewallet',
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_POST => true,
        CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey],
        CURLOPT_POSTFIELDS => [
            'file' => new CURLFile($filePath),
            'checkDuplicate' => $checkDuplicate ? 'true' : 'false'
        ]
    ]);

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

    $result = json_decode($response, true);

    if ($result['status'] !== 200) {
        throw new Exception($result['message']);
    }

    return $result['data'];
}

// Usage
$slip = verifyTrueMoney('/path/to/truemoney-slip.jpg', true);
echo "Transaction ID: " . $slip['transactionId'];
echo "Amount: " . $slip['amount'];
python
import requests
import os

def verify_truemoney(file_path: str, check_duplicate: bool = False) -> dict:
    with open(file_path, 'rb') as f:
        response = requests.post(
            'https://api.thunder.in.th/v1/verify/truewallet',
            headers={'Authorization': f'Bearer {os.environ["THUNDER_API_KEY"]}'},
            files={'file': f},
            data={'checkDuplicate': 'true' if check_duplicate else 'false'}
        )

    result = response.json()

    if result['status'] != 200:
        raise Exception(result['message'])

    return result['data']

# Usage
slip = verify_truemoney('./truemoney-slip.jpg', check_duplicate=True)
print(f"Transaction ID: {slip['transactionId']}")
print(f"Amount: {slip['amount']}")

Response ​

Success (200) ​

json
{
  "status": 200,
  "data": {
    "transactionId": "12345678901234",
    "date": "2024-01-15T14:30:00+07:00",
    "amount": 500.00,
    "sender": {
      "phone": "08-xxx-2345"
    },
    "receiver": {
      "phone": "08-xxx-4567"
    }
  }
}

Response Fields ​

FieldTypeDescription
transactionIdstringTrueMoney transaction ID
datestringTransaction timestamp (ISO 8601)
amountnumberTransfer amount
sender.phonestringSender's masked mobile, e.g. 08-xxx-2345
receiver.phonestringReceiver's masked mobile, e.g. 08-xxx-4567

The API returns what TrueMoney returns for the transfer QR. There are no names. sender and receiver contain only a masked mobile in the form 0X-xxx-NNNN, and each object appears only when TrueMoney returns that phone.

Error Responses ​

Invalid Image (400) ​

json
{
  "status": 400,
  "message": "invalid_image"
}

Image Size Too Large (400) ​

json
{
  "status": 400,
  "message": "image_size_too_large"
}

No TrueMoney QR (400) ​

json
{
  "status": 400,
  "message": "invalid_wallet_qr"
}

Invalid Input (400) ​

Sent neither file nor payload, or sent both, or payload is empty or longer than 256 characters.

json
{
  "status": 400,
  "message": "invalid_input"
}

Slip Not Found (404) ​

json
{
  "status": 404,
  "message": "slip_not_found"
}

Duplicate Slip (400) ​

json
{
  "status": 400,
  "message": "duplicate_slip",
  "data": {
    "transactionId": "12345678901234",
    "date": "2024-01-15T14:30:00+07:00",
    "amount": 500.00,
    "receiver": {
      "phone": "08-xxx-4567"
    }
  }
}

TrueMoney Unavailable (502/503) ​

The message is the code, e.g. {"status": 503, "message": "wallet_provider_busy"}. Try again later. When the response has a Retry-After header, wait at least that many seconds.

StatusMessageWhen
503wallet_provider_busyToo many requests to TrueMoney right now
503wallet_provider_unavailableTrueMoney did not answer in time
503wallet_provider_not_configuredTrueMoney checking is not set up on our side
502wallet_provider_invalid_responseTrueMoney sent a response the API could not use

Notes ​

  • Ensure the QR code is clearly visible
  • Quota is consumed for each verification request
  • Duplicate slips from same service don't consume quota
  • TrueMoney transfers typically have shorter validity periods

Bank Slip Verification API for Thai Banking