Verify by Payload
Verify a bank slip using the QR code payload string.
Endpoint
http
POST /verify/bankFull URL: https://api.easyslip.com/v2/verify/bank
Authentication
Required. See Authentication Guide.
http
Authorization: Bearer YOUR_API_KEY
Content-Type: application/jsonRequest
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
payload | string | Yes | QR code payload (1-128 characters) |
remark | string | No | Custom remark (1-255 characters) |
matchAccount | boolean | No | Match receiver with registered accounts |
matchAmount | number | No | Expected amount to validate |
checkDuplicate | boolean | No | Check for duplicate slip (default: false) |
Request Body
json
{
"payload": "00000000000000000000000000000000000000000000000",
"remark": "Order #12345",
"matchAccount": true,
"matchAmount": 1500.00,
"checkDuplicate": true
}Type Definitions
typescript
// Request
interface VerifyByPayloadRequest {
payload: string; // 1-128 chars
remark?: string; // 1-255 chars
matchAccount?: boolean;
matchAmount?: number;
checkDuplicate?: boolean;
}
// Response
interface VerifyBankResponse {
success: true;
data: VerifyBankData;
message: string;
}
interface VerifyBankData {
remark?: string;
isDuplicate: boolean;
matchedAccount: MatchedAccount | null;
amountInOrder?: number;
amountInSlip: number;
isAmountMatched?: boolean;
rawSlip: RawSlip;
}
// See POST /verify/bank for full type definitionsExamples
bash
curl -X POST https://api.easyslip.com/v2/verify/bank \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"payload": "00000000000000000000000000000000000000000000000",
"checkDuplicate": true
}'javascript
const verifyByPayload = async (payload, options = {}) => {
const response = await fetch('https://api.easyslip.com/v2/verify/bank', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({ payload, ...options })
});
const result = await response.json();
if (!result.success) {
throw new Error(result.error.message);
}
return result.data;
};
// Usage
const slip = await verifyByPayload('00000000000000000000000000000000000000000000000', {
checkDuplicate: true,
matchAmount: 1500.00
});
console.log('Amount:', slip.rawSlip.amount.amount);
console.log('Sender:', slip.rawSlip.sender.account.name.th);typescript
interface VerifyOptions {
remark?: string;
matchAccount?: boolean;
matchAmount?: number;
checkDuplicate?: boolean;
}
async function verifyByPayload(payload: string, options: VerifyOptions = {}) {
const response = await fetch('https://api.easyslip.com/v2/verify/bank', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.EASYSLIP_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ payload, ...options })
});
const result = await response.json();
if (!result.success) {
throw new Error(result.error?.message || 'Verification failed');
}
return result.data;
}php
function verifyByPayload(string $payload, array $options = []): array
{
$apiKey = getenv('EASYSLIP_API_KEY');
$data = array_merge(['payload' => $payload], $options);
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://api.easyslip.com/v2/verify/bank',
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'];
}
// Usage
$slip = verifyByPayload('00000000000000000000000000000000000000000000000', [
'checkDuplicate' => true
]);
echo "Amount: " . $slip['rawSlip']['amount']['amount'];python
import requests
import os
def verify_by_payload(payload: str, **options) -> dict:
response = requests.post(
'https://api.easyslip.com/v2/verify/bank',
headers={
'Authorization': f'Bearer {os.environ["EASYSLIP_API_KEY"]}',
'Content-Type': 'application/json'
},
json={'payload': payload, **options}
)
result = response.json()
if not result['success']:
raise Exception(result['error']['message'])
return result['data']
# Usage
slip = verify_by_payload(
'00000000000000000000000000000000000000000000000',
checkDuplicate=True
)
print(f"Amount: {slip['rawSlip']['amount']['amount']}")Response
Success (200)
json
{
"success": true,
"data": {
"isDuplicate": false,
"rawSlip": {
"payload": "00000000000000000000000000000000000000000000000",
"transRef": "68370160657749I376388B35",
"date": "2024-01-15T14:30:00+07:00",
"countryCode": "TH",
"amount": {
"amount": 1500.00,
"local": {
"amount": 1500.00,
"currency": "THB"
}
},
"fee": 0,
"sender": {
"bank": {
"id": "004",
"name": "กสิกรไทย",
"short": "KBANK"
},
"account": {
"name": {
"th": "นาย ผู้โอน ทดสอบ",
"en": "MR. SENDER TEST"
},
"bank": {
"type": "BANKAC",
"account": "123-4-xxxxx-5"
}
}
},
"receiver": {
"bank": {
"id": "014",
"name": "ไทยพาณิชย์",
"short": "SCB"
},
"account": {
"name": {
"th": "นาย รับเงิน ทดสอบ"
},
"bank": {
"type": "BANKAC",
"account": "xxx-x-x5678-x"
}
}
}
}
},
"message": "Bank slip verified successfully"
}Error Responses
Invalid Payload (400)
json
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid payload format"
}
}Slip Not Found (404)
json
{
"success": false,
"error": {
"code": "SLIP_NOT_FOUND",
"message": "The slip could not be found or is invalid"
}
}Notes
- This is the fastest verification method (no image processing)
- Payload should be alphanumeric, 1-128 characters
- Use
checkDuplicate: trueto prevent double-crediting - Include order ID in
remarkfor tracking