Skip to content

PATCH /bank-accounts/:id ​

Update a bank account. Partial update — send only the fields you want to change. Only accessible if the account is linked to the calling branch, otherwise returns 404.

Endpoint ​

http
PATCH /bank-accounts/:id

Full URL: https://api.easyslip.com/v2/bank-accounts/:id

Authentication ​

Required. See Authentication Guide.

http
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Request ​

Path Parameters ​

ParameterTypeRequiredDescription
idnumberYesThe bank account id

Body Parameters ​

All fields are optional. Provide only the ones you want to update.

ParameterTypeDescription
bankCodestringA valid code from GET /banks — validated if provided
bankNumberstringThe account number
nameThstringAccount holder name in Thai (≤255 chars)
nameEnstringAccount holder name in English (≤255 chars)
typestringAccount type — NATURAL or JURISTIC
extraVerifystring | nullVerify option for the bank — a valid option value to set, or null to clear. Validated per-bank (see GET /banks)
matchModestringPromptPay matching mode — NAME, NUMBER, or NAME_NUMBER. PromptPay accounts only; omit to keep the current mode

Request Body ​

json
{
  "nameEn": "EXAMPLE COMPANY LIMITED",
  "extraVerify": "REF-2024"
}

Type Definitions ​

typescript
// Request — all fields optional
interface UpdateBankAccountRequest {
  bankCode?: string;                   // validated against the bank list if provided
  bankNumber?: string;
  nameTh?: string;                     // ≤255 chars
  nameEn?: string;                     // ≤255 chars
  type?: 'NATURAL' | 'JURISTIC';
  extraVerify?: string | null;         // a valid option value to set, or null to clear (see GET /banks)
  matchMode?: 'NAME' | 'NUMBER' | 'NAME_NUMBER'; // PromptPay only; omit to keep current mode
}

// Response
interface BankAccountResponse {
  success: true;
  data: BankAccount;
}

interface BankAccount {
  id: number;
  bankCode: string;
  bankNumber: string;
  nameTh: string;
  nameEn: string;
  type: 'NATURAL' | 'JURISTIC';
  extraVerify: string | null;
  matchMode: 'NAME' | 'NUMBER' | 'NAME_NUMBER' | null;
  createdAt: string;                   // ISO 8601
  updatedAt: string;                   // ISO 8601
}

// Error Response
interface ErrorResponse {
  success: false;
  error: {
    code: string;
    message: string;
  };
}

Examples ​

bash
curl -X PATCH https://api.easyslip.com/v2/bank-accounts/12345 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "nameEn": "EXAMPLE COMPANY LIMITED"
  }'
javascript
const updateBankAccount = async (id, changes) => {
  const response = await fetch(`https://api.easyslip.com/v2/bank-accounts/${id}`, {
    method: 'PATCH',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(changes)
  });

  const result = await response.json();

  if (!result.success) {
    throw new Error(result.error.message);
  }

  return result.data;
};

// Usage
const account = await updateBankAccount(12345, {
  nameEn: 'EXAMPLE COMPANY LIMITED'
});
php
function updateBankAccount(int $id, array $changes): array
{
    $ch = curl_init();
    curl_setopt_array($ch, [
        CURLOPT_URL => 'https://api.easyslip.com/v2/bank-accounts/' . $id,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_CUSTOMREQUEST => 'PATCH',
        CURLOPT_HTTPHEADER => [
            'Authorization: Bearer YOUR_API_KEY',
            'Content-Type: application/json'
        ],
        CURLOPT_POSTFIELDS => json_encode($changes)
    ]);

    $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
$account = updateBankAccount(12345, [
    'nameEn' => 'EXAMPLE COMPANY LIMITED'
]);
python
import requests

def update_bank_account(account_id: int, changes: dict) -> dict:
    response = requests.patch(
        f'https://api.easyslip.com/v2/bank-accounts/{account_id}',
        headers={
            'Authorization': 'Bearer YOUR_API_KEY',
            'Content-Type': 'application/json'
        },
        json=changes
    )

    result = response.json()

    if not result['success']:
        raise Exception(result['error']['message'])

    return result['data']

# Usage
account = update_bank_account(12345, {
    'nameEn': 'EXAMPLE COMPANY LIMITED'
})

Response ​

Success Response (200) ​

json
{
  "success": true,
  "data": {
    "id": 12345,
    "bankCode": "004",
    "bankNumber": "123-4-56789-0",
    "nameTh": "บริษัท ตัวอย่าง จำกัด",
    "nameEn": "EXAMPLE COMPANY LIMITED",
    "type": "JURISTIC",
    "extraVerify": "REF-2024",
    "matchMode": null,
    "createdAt": "2024-01-15T14:30:00+07:00",
    "updatedAt": "2024-01-16T09:15:00+07:00"
  }
}

Error Responses ​

Invalid Bank Code (400) ​

json
{
  "success": false,
  "error": {
    "code": "INVALID_BANK_CODE",
    "message": "The provided bankCode is not supported"
  }
}

Invalid Extra Verify (400) ​

json
{
  "success": false,
  "error": {
    "code": "INVALID_EXTRA_VERIFY",
    "message": "The provided extraVerify is not a valid option for this bank"
  }
}

Invalid Match Mode (400) ​

json
{
  "success": false,
  "error": {
    "code": "INVALID_MATCH_MODE",
    "message": "matchMode is supported only for PromptPay accounts"
  }
}

Bank Account Not Found (404) ​

json
{
  "success": false,
  "error": {
    "code": "BANK_ACCOUNT_NOT_FOUND",
    "message": "Bank account not found"
  }
}

Updating extraVerify ​

extraVerify is validated against the target bank's supported options (the values from GET /banks). How it behaves depends on whether you also change bankCode.

Same bankCode (or bankCode omitted) ​

You sendResult
a valid extraVerify valueStored
extraVerify: nullCleared
extraVerify omittedLeft unchanged
an invalid value400 INVALID_EXTRA_VERIFY

Changing bankCode ​

When bankCode changes, extraVerify is re-resolved against the new bank:

New bankYou sendResult
has optionsa valid extraVerify valueStored
has optionsextraVerify omitted, and the old value is not valid for the new bank400 INVALID_EXTRA_VERIFY — you must send a valid one for the new bank
has no options(anything)Cleared (set to null)

Updating matchMode ​

matchMode is supported only when the resulting bankCode is PROMPTPAY:

UpdateResult
PromptPay account + explicit NAME, NUMBER, or NAME_NUMBERStores the selected mode
PromptPay account + matchMode omittedKeeps the current mode; a legacy null remains effective NUMBER
Change another bank to PromptPay + matchMode omittedUses effective mode NUMBER
Change PromptPay to another bankClears matchMode to null
Send matchMode for a non-PromptPay account400 INVALID_MATCH_MODE

extraVerify remains required for matching

All three modes still require the slip's PromptPay proxy type to match the account's extraVerify value. matchMode changes only the subsequent name/number comparison.

PromptPay responses always return the effective mode. Therefore legacy rows stored with matchMode: null are returned as "matchMode": "NUMBER"; non-PromptPay accounts return "matchMode": null.

Notes ​

  • Only the fields you send are changed; omitted fields keep their current values.
  • If bankCode is provided, it is validated against GET /banks.
  • extraVerify accepts a valid option value to set, null to clear, or omit to leave unchanged. See Updating extraVerify for how it interacts with a bankCode change.
  • matchMode accepts NAME, NUMBER, or NAME_NUMBER for PromptPay only. Omit it to preserve the current mode.
  • Returns 404 BANK_ACCOUNT_NOT_FOUND if the account does not exist or is not linked to your branch.

Bank Slip Verification API for Thai Banking