Skip to content

GET /verify (Payload)

Verify a bank slip using the QR code payload string.

Endpoint

http
GET /verify

Full URL: https://developer.easyslip.com/api/v1/verify

Authentication

Required. See Authentication Guide.

http
Authorization: Bearer YOUR_API_KEY

Request

Query Parameters

ParameterTypeRequiredDescription
payloadstringYesQR code payload (1-255 characters)
checkDuplicatebooleanNoCheck for duplicate slip

Type Definitions

typescript
// Request
interface VerifyByPayloadRequest {
  payload: string;          // 1-255 chars
  checkDuplicate?: boolean;
}

// Response
interface VerifyResponse {
  status: 200;
  data: SlipData;
}

interface SlipData {
  payload: string;
  transRef: string;
  date: string;              // ISO 8601
  countryCode: string;
  amount: {
    amount: number;
    local: {
      amount?: number;
      currency?: string;
    };
  };
  fee?: number;
  ref1?: string;
  ref2?: string;
  ref3?: string;
  sender: Party;
  receiver: Party & { merchantId?: string };
}

interface Party {
  bank: {
    id?: string;
    name?: string;
    short?: string;
  };
  account: {
    name: {
      th?: string;
      en?: string;
    };
    bank?: {
      type: 'BANKAC' | 'TOKEN' | 'DUMMY';
      account: string;
    };
    proxy?: {
      type: 'NATID' | 'MSISDN' | 'EWALLETID' | 'EMAIL' | 'BILLERID';
      account: string;
    };
  };
}

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

Examples

bash
curl -X GET "https://developer.easyslip.com/api/v1/verify?payload=YOUR_QR_PAYLOAD&checkDuplicate=true" \
  -H "Authorization: Bearer YOUR_API_KEY"
javascript
const verifyByPayload = async (payload, checkDuplicate = false) => {
  const params = new URLSearchParams({
    payload,
    checkDuplicate: String(checkDuplicate)
  });

  const response = await fetch(
    `https://developer.easyslip.com/api/v1/verify?${params}`,
    { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
  );

  const result = await response.json();

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

  return result.data;
};

// Usage
const slip = await verifyByPayload('YOUR_QR_PAYLOAD', true);
console.log('Amount:', slip.amount.amount);
console.log('Sender:', slip.sender.account.name.th);
php
function verifyByPayload(string $payload, bool $checkDuplicate = false): array
{
    $apiKey = getenv('EASYSLIP_API_KEY');

    $params = http_build_query([
        'payload' => $payload,
        'checkDuplicate' => $checkDuplicate ? 'true' : 'false'
    ]);

    $ch = curl_init();
    curl_setopt_array($ch, [
        CURLOPT_URL => 'https://developer.easyslip.com/api/v1/verify?' . $params,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey]
    ]);

    $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 = verifyByPayload('YOUR_QR_PAYLOAD', true);
echo "Amount: " . $slip['amount']['amount'];
python
import requests
import os

def verify_by_payload(payload: str, check_duplicate: bool = False) -> dict:
    response = requests.get(
        'https://developer.easyslip.com/api/v1/verify',
        headers={'Authorization': f'Bearer {os.environ["EASYSLIP_API_KEY"]}'},
        params={
            'payload': payload,
            'checkDuplicate': 'true' if check_duplicate else 'false'
        }
    )

    result = response.json()

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

    return result['data']

# Usage
slip = verify_by_payload('YOUR_QR_PAYLOAD', check_duplicate=True)
print(f"Amount: {slip['amount']['amount']}")

Response

Success (200)

json
{
  "status": 200,
  "data": {
    "payload": "00000000000000000000000000000000000000000000000",
    "transRef": "68370160657749I376388B35",
    "date": "2024-01-15T14:30:00+07:00",
    "countryCode": "TH",
    "amount": {
      "amount": 1000,
      "local": {
        "amount": 0,
        "currency": ""
      }
    },
    "fee": 0,
    "ref1": "",
    "ref2": "",
    "ref3": "",
    "sender": {
      "bank": {
        "id": "004",
        "name": "กสิกรไทย",
        "short": "KBANK"
      },
      "account": {
        "name": {
          "th": "นาย ผู้โอน ทดสอบ",
          "en": "MR. SENDER TEST"
        },
        "bank": {
          "type": "BANKAC",
          "account": "1234xxxx5678"
        }
      }
    },
    "receiver": {
      "bank": {
        "id": "014",
        "name": "ไทยพาณิชย์",
        "short": "SCB"
      },
      "account": {
        "name": {
          "th": "นาย รับเงิน ทดสอบ"
        },
        "bank": {
          "type": "BANKAC",
          "account": "12xxxx3456"
        },
        "proxy": {
          "type": "MSISDN",
          "account": "08xxxxxxxx89"
        }
      }
    }
  }
}

Error Responses

Invalid Payload (400)

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

Duplicate Slip (400)

json
{
  "status": 400,
  "message": "duplicate_slip",
  "data": { ... }
}

INFO

Returns the original slip data when duplicate is detected.

Unauthorized (401)

json
{
  "status": 401,
  "message": "unauthorized"
}

Quota Exceeded (403)

json
{
  "status": 403,
  "message": "quota_exceeded"
}

Slip Not Found (404)

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

Notes

  • This is the fastest verification method (no image processing)
  • Use checkDuplicate=true to prevent double-crediting
  • Payload should be alphanumeric, 1-255 characters

Bank Slip Verification API for Thai Banking