GET /bank-accounts
List the bank accounts linked to the calling branch. Results are paginated and exclude deleted accounts.
Endpoint
http
GET /bank-accountsFull URL: https://api.easyslip.com/v2/bank-accounts
Authentication
Required. See Authentication Guide.
http
Authorization: Bearer YOUR_API_KEYRequest
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | No | Filter by account type — NATURAL or JURISTIC |
bankCode | string | No | Filter by bank code |
page | number | No | Page number (default: 1) |
limit | number | No | Items per page (default: 20, max: 100) |
Type Definitions
typescript
// Response
interface ListBankAccountsResponse {
success: true;
data: {
items: BankAccount[];
total: number;
page: number;
limit: number;
};
}
interface BankAccount {
id: number;
bankCode: string;
bankNumber: string;
nameTh: string;
nameEn: string;
type: 'NATURAL' | 'JURISTIC';
extraVerify: string | null;
createdAt: string; // ISO 8601
updatedAt: string; // ISO 8601
}
// Error Response
interface ErrorResponse {
success: false;
error: {
code: string;
message: string;
};
}Examples
bash
curl -X GET "https://api.easyslip.com/v2/bank-accounts?type=JURISTIC&page=1&limit=20" \
-H "Authorization: Bearer YOUR_API_KEY"javascript
const listBankAccounts = async (params = {}) => {
const query = new URLSearchParams(params).toString();
const response = await fetch(`https://api.easyslip.com/v2/bank-accounts?${query}`, {
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const result = await response.json();
if (!result.success) {
throw new Error(result.error.message);
}
return result.data;
};
// Usage
const { items, total } = await listBankAccounts({ type: 'JURISTIC', limit: 20 });
console.log(`Showing ${items.length} of ${total} accounts`);php
function listBankAccounts(array $params = []): array
{
$query = http_build_query($params);
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://api.easyslip.com/v2/bank-accounts?' . $query,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_KEY'
]
]);
$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
$data = listBankAccounts(['type' => 'JURISTIC', 'limit' => 20]);
echo "Total: " . $data['total'];python
import requests
def list_bank_accounts(**params) -> dict:
response = requests.get(
'https://api.easyslip.com/v2/bank-accounts',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
params=params
)
result = response.json()
if not result['success']:
raise Exception(result['error']['message'])
return result['data']
# Usage
data = list_bank_accounts(type='JURISTIC', limit=20)
print(f"Showing {len(data['items'])} of {data['total']} accounts")Response
Success Response (200)
json
{
"success": true,
"data": {
"items": [
{
"id": 12345,
"bankCode": "004",
"bankNumber": "123-4-56789-0",
"nameTh": "บริษัท ตัวอย่าง จำกัด",
"nameEn": "EXAMPLE CO., LTD.",
"type": "JURISTIC",
"extraVerify": null,
"createdAt": "2024-01-15T14:30:00+07:00",
"updatedAt": "2024-01-15T14:30:00+07:00"
}
],
"total": 1,
"page": 1,
"limit": 20
}
}Response Fields
| Field | Type | Description |
|---|---|---|
items | BankAccount[] | Accounts linked to the calling branch |
total | number | Total number of matching accounts |
page | number | Current page number |
limit | number | Items per page |
Error Responses
Validation Error (400)
json
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "limit: Too big: expected number to be <=100"
}
}Notes
- Only accounts linked to the calling branch are returned.
- Deleted accounts are excluded.
limitis capped at100.