Version Comparison
EasySlip offers two API versions. This guide helps you choose the right version for your needs.
Quick Comparison
| Feature | API v1 | API v2 |
|---|---|---|
| Status | Stable | Latest |
| Base URL | /api/v1 | /api/v2 |
| Bank Slip Verification | Yes | Yes |
| TrueMoney Wallet | Yes | No |
| QR Code Generation | Yes | No |
| Account Matching | No | Yes |
| Amount Validation | No | Yes |
| Multi-Branch | No | Yes |
| Response Format | Legacy | Standardized |
API v2 (Recommended)
Base URL: https://api.easyslip.com/v2
Advantages
Standardized Response Format
- Consistent
success,data,errorstructure - Clear error codes with descriptive messages
- Consistent
Account Matching
- Match receiver account with registered bank accounts
- Smart name matching with 85% similarity threshold
- Support for PromptPay and merchant accounts
Amount Validation
- Verify expected amount matches slip amount
- Prevent underpayment/overpayment
Multi-Branch Support
- Create multiple API keys per application
- Track quota per branch
- Different IP restrictions per branch
Better Error Handling
- Structured error responses
- Specific error codes for debugging
Endpoints
| Endpoint | Method | Description |
|---|---|---|
/verify/bank | POST | Verify bank slip |
/info | GET | Get application info |
/health | GET | Health 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
TrueMoney Wallet Support
- Verify TrueMoney wallet transfers
- QR code and OCR extraction
QR Code Generation
- Generate PromptPay QR codes
- K-Shop, Mae Manee, Tungngern support
Mature & Stable
- Well-tested in production
- Extensive documentation
Endpoints
| Endpoint | Method | Description |
|---|---|---|
/verify | GET | Verify by payload |
/verify | POST | Verify by image/URL/Base64 |
/verify/truewallet | POST | Verify TrueMoney |
/me | GET | Get application info |
/qr/generate | POST | Generate 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 Endpoint | v2 Endpoint | Notes |
|---|---|---|
GET /verify?payload=X | POST /verify/bank | Now uses POST with JSON body |
POST /verify (image) | POST /verify/bank | Same endpoint, multipart |
GET /me | GET /info | Renamed, 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.