Skip to content

Version Comparison

EasySlip offers two API versions. This guide helps you choose the right version for your needs.

Quick Comparison

FeatureAPI v1API v2
StatusStableLatest
Base URL/api/v1/api/v2
Bank Slip VerificationYesYes
TrueMoney WalletYesNo
QR Code GenerationYesNo
Account MatchingNoYes
Amount ValidationNoYes
Multi-BranchNoYes
Response FormatLegacyStandardized

Base URL: https://api.easyslip.com/v2

Advantages

  1. Standardized Response Format

    • Consistent success, data, error structure
    • Clear error codes with descriptive messages
  2. Account Matching

    • Match receiver account with registered bank accounts
    • Smart name matching with 85% similarity threshold
    • Support for PromptPay and merchant accounts
  3. Amount Validation

    • Verify expected amount matches slip amount
    • Prevent underpayment/overpayment
  4. Multi-Branch Support

    • Create multiple API keys per application
    • Track quota per branch
    • Different IP restrictions per branch
  5. Better Error Handling

    • Structured error responses
    • Specific error codes for debugging

Endpoints

EndpointMethodDescription
/verify/bankPOSTVerify bank slip
/infoGETGet application info
/healthGETHealth check

Example Request

bash
curl -X POST https://api.easyslip.com/v2/verify/bank \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "payload": "QR_PAYLOAD",
    "matchAccount": true,
    "matchAmount": 1000,
    "checkDuplicate": true
  }'

Example Response

json
{
  "success": true,
  "data": {
    "isDuplicate": false,
    "matchedAccount": {
      "bank": {
        "nameTh": "กสิกรไทย",
        "code": "004"
      },
      "nameTh": "บริษัท ตัวอย่าง จำกัด"
    },
    "amountInOrder": 1000,
    "amountInSlip": 1000,
    "isAmountMatched": true,
    "rawSlip": { ... }
  },
  "message": "Bank slip verified successfully"
}

API v1 (Legacy)

Base URL: https://developer.easyslip.com/api/v1

Advantages

  1. TrueMoney Wallet Support

    • Verify TrueMoney wallet transfers
    • QR code and OCR extraction
  2. QR Code Generation

    • Generate PromptPay QR codes
    • K-Shop, Mae Manee, Tungngern support
  3. Mature & Stable

    • Well-tested in production
    • Extensive documentation

Endpoints

EndpointMethodDescription
/verifyGETVerify by payload
/verifyPOSTVerify by image/URL/Base64
/verify/truewalletPOSTVerify TrueMoney
/meGETGet application info
/qr/generatePOSTGenerate QR code

Example Request

bash
curl -X GET "https://developer.easyslip.com/api/v1/verify?payload=QR_PAYLOAD" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example Response

json
{
  "status": 200,
  "data": {
    "payload": "00000000...",
    "transRef": "68370160657749I376388B35",
    "date": "2024-01-15T14:30:00+07:00",
    "amount": {
      "amount": 1000
    },
    "sender": { ... },
    "receiver": { ... }
  }
}

Migration Guide: v1 to v2

Response Format Changes

v1 Response:

json
{
  "status": 200,
  "data": { ... }
}

v2 Response:

json
{
  "success": true,
  "data": { ... },
  "message": "Success message"
}

Error Handling Changes

v1 Error:

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

v2 Error:

json
{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid payload format"
  }
}

Endpoint Changes

v1 Endpointv2 EndpointNotes
GET /verify?payload=XPOST /verify/bankNow uses POST with JSON body
POST /verify (image)POST /verify/bankSame endpoint, multipart
GET /meGET /infoRenamed, more detailed response
POST /verify/truewallet-Not available in v2
POST /qr/generate-Not available in v2

Code Migration Example

v1 Code:

javascript
const response = await fetch(
  `https://developer.easyslip.com/api/v1/verify?payload=${payload}`,
  {
    headers: { 'Authorization': `Bearer ${apiKey}` }
  }
);
const { status, data, message } = await response.json();

if (status === 200) {
  console.log('Success:', data);
} else {
  console.error('Error:', message);
}

v2 Code:

javascript
const response = await fetch(
  'https://api.easyslip.com/v2/verify/bank',
  {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${apiKey}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ payload })
  }
);
const result = await response.json();

if (result.success) {
  console.log('Success:', result.data);
} else {
  console.error('Error:', result.error.code, result.error.message);
}

When to Use Each Version

Use API v2 When:

  • Starting a new project
  • Need account matching features
  • Need amount validation
  • Want standardized error handling
  • Need multi-branch quota tracking

Use API v1 When:

  • Need TrueMoney Wallet verification
  • Need QR code generation
  • Maintaining existing v1 integration
  • Can't migrate to v2 yet

Conclusion

For new integrations, we strongly recommend API v2 for its improved features, better error handling, and standardized response format. API v1 remains available for TrueMoney and QR code features not yet available in v2.

Bank Slip Verification API for Thai Banking