https://{your-domain}.fincode.software/api/v1/services/user/create-bank-account
{
"status": "<string>",
"data": {
"accountId": "<string>",
"customerId": "<string>",
"accountNumber": "<string>",
"accountName": "<string>",
"bankCode": "<string>",
"bankName": "<string>",
"isDefault": true,
"isVerified": true
}
}API Endpoints
Add Bank Account
Allows customers to add a bank account to their profile for loan disbursements and repayments.
POST
/
api
/
v1
/
services
/
user
/
create-bank-account
https://{your-domain}.fincode.software/api/v1/services/user/create-bank-account
{
"status": "<string>",
"data": {
"accountId": "<string>",
"customerId": "<string>",
"accountNumber": "<string>",
"accountName": "<string>",
"bankCode": "<string>",
"bankName": "<string>",
"isDefault": true,
"isVerified": true
}
}Customers can use this endpoint to register a bank account that can be used for loan disbursements, repayments, and fund transfers.
https://{your-domain}.fincode.software/api/v1/services/user/create-bank-account
Request Headers
Request Body
Response
Returns confirmation of bank account creation with account details.Bank account details.
Code Examples
curl --location --request POST 'https://{your-domain}.fincode.software/api/v1/services/user/create-bank-account' \
--header 'X-Auth-Token: YOUR_JWT_ACCESS_TOKEN' \
--header 'x-idempotency-key: unique-key-12345' \
--header 'x-fapi-auth-date: 2024-01-15T10:30:00Z' \
--header 'x-fapi-customer-ip-address: 192.168.1.1' \
--header 'x-fapi-interaction-id: interaction-12345' \
--header 'Content-Type: application/json' \
--data '{
"customerId": "123e4567-e89b-12d3-a456-426614174000",
"accountNumber": "1234567890",
"accountName": "John Doe",
"bankCode": "058",
"bankName": "Guaranty Trust Bank",
"accountType": "SAVINGS",
"isDefault": true
}'
const axios = require('axios');
const BASE_URL = 'https://{your-domain}.fincode.software/api/v1/services/user';
async function createBankAccount(accessToken, accountData) {
try {
const response = await axios.post(
`${BASE_URL}/create-bank-account`,
{
customerId: accountData.customerId,
accountNumber: accountData.accountNumber,
accountName: accountData.accountName,
bankCode: accountData.bankCode,
bankName: accountData.bankName,
accountType: accountData.accountType || 'SAVINGS',
isDefault: accountData.isDefault || false,
},
{
headers: {
'X-Auth-Token': accessToken,
'x-idempotency-key': `key-${Date.now()}`,
'x-fapi-auth-date': new Date().toISOString(),
'x-fapi-customer-ip-address': '192.168.1.1',
'x-fapi-interaction-id': `interaction-${Date.now()}`,
'Content-Type': 'application/json',
},
}
);
return response.data.data;
} catch (error) {
console.error(
'Failed to create bank account:',
error.response?.data || error.message
);
throw error;
}
}
// Usage Example
const accessToken = 'YOUR_JWT_ACCESS_TOKEN';
createBankAccount(accessToken, {
customerId: '123e4567-e89b-12d3-a456-426614174000',
accountNumber: '1234567890',
accountName: 'John Doe',
bankCode: '058',
bankName: 'Guaranty Trust Bank',
accountType: 'SAVINGS',
isDefault: true,
});
