Add Bank Account
Register a new bank account for receiving settlement payouts.
POST
https://api.zenpayz.com/merchant/api/v1/settlements/bank-accountsBearer · 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 |
Body Parameters
| Parameter | Type | Description |
|---|---|---|
accountHolderName REQUIRED | string | Account holder name |
accountNumber REQUIRED | string | Bank account number |
accountType REQUIRED | string | CURRENT or SAVINGS |
ifscCode REQUIRED | string | IFSC/Routing code |
bankName REQUIRED | string | Name of the bank |
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 for international transfers |
Response
Success (201 Created)
{
"success": true,
"data": {
"id": "ba_xxxxx",
"accountNumber": "****5678",
"accountHolderName": "Acme Inc",
"accountType": "CURRENT",
"bankName": "Bank of America",
"branchName": "Main Branch",
"ifscCode": "BOFA0001234",
"isPrimary": false,
"createdAt": "2024-01-15T10:30:00.000Z"
}
}
Error Responses
| Code | HTTP | Message |
|---|---|---|
| VALIDATION_ERROR | 400 | Invalid input data |
| UNAUTHORIZED | 401 | Invalid API key |
| DUPLICATE_ACCOUNT | 409 | Account number already registered |
Examples
- cURL
- SDK
curl -X POST "https://api.zenpayz.com/merchant/api/v1/settlements/bank-accounts" \
-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 '{
"accountHolderName": "Acme Inc",
"accountNumber": "9876543210",
"accountType": "CURRENT",
"ifscCode": "BOFA0001234",
"bankName": "Bank of America",
"branchName": "Main Branch",
"isPrimary": false
}'
const account = await zenpays.settlements.addBankAccount({
accountHolderName: 'Acme Inc',
accountNumber: '9876543210',
accountType: 'CURRENT',
ifscCode: 'BOFA0001234',
bankName: 'Bank of America',
branchName: 'Main Branch',
});
console.log(`Bank account added: ${account.id}`);