Make Your First API Call
This example demonstrates how to make your first authenticated API call using the SessionToken. Before proceeding, ensure you have successfully generated a SessionToken using the Authentication step.
🔐 Authentication
All API requests must include the Authorization in the request header:
code
Authorization: 'Bearer <SessionToken>'
🔁 Token Refresh Handling
While making API calls, you may receive a refreshed token in the response header:
code
x-refresh-token: <new_session_token>
This indicates that your current SessionToken is nearing expiration.
Recommended handling:
- Replace the existing SessionToken with the new
x-refresh-token - Use the refreshed token for all subsequent API requests
- This ensures uninterrupted API access without re-authentication
⚠️ Best Practices
- Always include
Authorizationheader in every request - Do not reuse expired tokens
- If a request fails with
401 Unauthorized, regenerate the SessionToken via/auth - Cache and reuse tokens until expiry to avoid unnecessary auth calls
▶️ Example: Get Account Balance
code
GET {{base_url}}/accounts/balance
Headers:
code
X-AUTH-TOKEN: {{session_token}}
📥 Example Response
code
{
ResponseCode: 200,
ResponseMessage: 'Success',
ResponseData: [
{
Balance: '23997.98',
ReservedAmount: '0.00',
AvailableBalance: '23997.98',
Currency: 'USD',
Name: 'Account (USD)',
Id: '637403491'
…💻 Node.js Example
code
const axios = require('axios');
const baseUrl = "https://sandbox.merchant.fvbank.us/v2";
const sessionToken = "your_session_token";
async function getAccountBalance() {
try {
const response = await axios.get(`${baseUrl}/account/balance`, {
headers: {
"Authorization": `Bearer ${sessionToken}`,
"Content-Type": "application/json"
}
});
…📌 What’s Next
Once you are able to make authenticated API calls, you can:
- Create a Beneficiary
- Add a Payment Method
- Initiate a Payment
- Track Transactions
Or follow the Send Money use case for a complete end-to-end flow.
Try in API reference