Update Bank Account
Update an existing bank account's details. Only non-sensitive fields can be modified.
PUT
https://api.zenpayz.com/merchant/api/v1/settlements/bank-accounts/{id}Bearer · API key
Request
Headers
| Header | Description |
|---|---|
Authorization REQUIRED | Bearer {api_key} |
X-Signature REQUIRED | HMAC-SHA256 signature |
X-Timestamp REQUIRED | ISO 8601 timestamp |
X-Secret-Salt REQUIRED | Secret salt for HMAC validation |
Content-Type REQUIRED | application/json |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id REQUIRED | string | Bank account ID |
Body Parameters
All fields are optional. Only provided fields will be updated.
| Parameter | Type | Description |
|---|---|---|
accountHolderName OPTIONAL | string | Account holder name |
branchName OPTIONAL | string | Bank branch name |
branchAddress OPTIONAL | string | Bank branch address |
isPrimary OPTIONAL | boolean | Set as primary account |
swiftCode OPTIONAL | string | SWIFT/BIC code |
note
Sensitive fields like accountNumber, ifscCode, and bankName cannot be modified after creation. To change these, delete and re-add the bank account.
Response
Success (200 OK)
{
"success": true,
"data": {
"id": "ba_xxxxx",
"accountNumber": "****5678",
"accountHolderName": "Acme Inc Updated",
"accountType": "CURRENT",
"bankName": "Bank of America",
"branchName": "New Branch",
"ifscCode": "BOFA0001234",
"isPrimary": true,
"createdAt": "2024-01-15T10:30:00.000Z"
}
}
Error Responses
| Code | HTTP | Message |
|---|---|---|
| VALIDATION_ERROR | 400 | Invalid input data |
| BANK_ACCOUNT_NOT_FOUND | 404 | Bank account does not exist |
Examples
- cURL
- SDK
curl -X PUT "https://api.zenpayz.com/merchant/api/v1/settlements/bank-accounts/ba_xxxxx" \
-H "Authorization: Bearer zp_test_xxxxx" \
-H "X-Timestamp: 2024-01-15T10:30:00.000Z" \
-H "X-Signature: a1b2c3d4e5f6..." \
-H "X-Secret-Salt: your_secret_salt" \
-H "Content-Type: application/json" \
-d '{
"isPrimary": true,
"branchName": "New Branch"
}'
await zenpays.settlements.updateBankAccount('ba_xxxxx', {
isPrimary: true,
branchName: 'New Branch',
});