> For the complete documentation index, see [llms.txt](https://blufin360-api-documentation.gitbook.io/blufin360_api_documentation-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://blufin360-api-documentation.gitbook.io/blufin360_api_documentation-docs/banking/fetch-balance.md).

# Fetch Balance

Sync and retrieve the live available balance of a merchant account from the banking partner.

The API includes:

* Live account balance
* Account number & IFSC
* Account type & holder name
* Balance sync timestamp

**Endpoints**

**Staging :** <mark style="color:$primary;">`https://apidev.blufin360.com`</mark>

**Prod :** <mark style="color:$primary;">`https://api.blufin360.com`</mark>

**Path**

POST <mark style="color:$primary;">`/api/v1/banking/balance-sync`</mark>

**Authentication**

Use a JWT access token in the `Authorization` header.

Generate the token using [<mark style="color:$primary;">Generate JWT Access Token (Merchant Login API)</mark>](/blufin360_api_documentation-docs/getting-started/authentication.md). Generate the token using [<mark style="color:$primary;">Authentication</mark>](/blufin360_api_documentation-docs/getting-started/authentication.md).

### Example request

{% tabs %}
{% tab title="Shell" %}
{% code title="FetchBalance - cURL" %}

```bash
curl --location 'https://api.blufin360.com/api/v1/banking/fund-transfer' \
  --header 'Authorization: Bearer <accessToken>' \
  --header 'Content-Type: application/json' \
  --data
{
  "account_id": "01234e-eb3f-427c-9b55-421237cb06f3"
}
```

{% endcode %}
{% endtab %}

{% tab title="Node" %}
{% code title="FetchBalance- fetch" %}

```javascript
const res = await fetch("https://api.blufin360.com/api/v1/banking/fund-transfer", {
  method: "POST",
  headers: { Authorization: "Bearer <accessToken>", "Content-Type": "application/json" },
  body: JSON.stringify({
    api_request_id: "API_REQ_123", merchant_ref_id: "MER_REF_123",
    collection_details: {
      vpa_id: "cbf2f90b-cdfd-4f27-afe5-8c58c64d0000",
      account_id: "550e8400-e29b-41d4-a716-446655440000",
      collection_mode: "INTENT_LINK", amount: "11.00", currency: "INR",
      description: "Payment for Vendor", target_device: "ANDROID", target_app: "GENERIC"
    },
    payer_details: {
      name: "PRIYAM JAISWAL", contact_no: "9876543210",
      account_number: "50100018760107", ifsc_code: "HDFC0000239", validate_payer: true
    },
    validity: {
      validity_start_datetime: "2026-06-22T15:17:00+05:30",
      validity_end_datetime: "2026-06-22T15:30:00+05:30"
    }
  }),
});
```

{% endcode %}
{% endtab %}

{% tab title="Python" %}
{% code title="FetchBalance - Python" %}

```python
import requests
import json

ENDPOINT = 'https://api.blufin360.com/api/v1/banking/fund-transfer'
ACCESS_TOKEN = '<accessToken>'

headers = {
    'Authorization': f'Bearer {ACCESS_TOKEN}',
    'Content-Type': 'application/json'
}

payload = {
    "api_request_id": "API_REQ_123",
    "merchant_ref_id": "ORD12345678",
    "payment_mode": "IMPS",
    "transfer_type": "EXTERNAL_FUND_TRANSFER",
    "account_id": "550e8400-e29b-41d4-a716-446655440000",
    "amount": 1250.50,
    "description": "Vendor payout April",
    "beneficiary_details": {
        "beneficiary_name": "Rohit Sharma",
        "account_number": "123456789012",
        "ifsc_code": "SBIN0123456",
        "beneficiary_email": "rohit@example.com",
        "beneficiary_mobile": "9876543210",
        "bank_name": "State Bank of India"
    }
}

response = requests.post(ENDPOINT, headers=headers, json=payload)

if response.status_code == 200:
    print("Request successful!")
    print(json.dumps(response.json(), indent=2))
else:
    print(f"Request failed with status code: {response.status_code}")
    print(response.text)
```

{% endcode %}
{% endtab %}

{% tab title="Go" %}
{% code title="FetchBalance - net/http" %}

```go
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"time"
)
type BeneficiaryDetails struct {
	BeneficiaryName   string `json:"beneficiary_name"`
	AccountNumber     string `json:"account_number"`
	IFSCCode          string `json:"ifsc_code"`
	BeneficiaryEmail  string `json:"beneficiary_email"`
	BeneficiaryMobile string `json:"beneficiary_mobile"`
	BankName          string `json:"bank_name"`
}

type PaymentRequest struct {
	APIRequestID       string             `json:"api_request_id"`
	MerchantRefID      string             `json:"merchant_ref_id"`
	PaymentMode        string             `json:"payment_mode"`
	TransferType       string             `json:"transfer_type"`
	AccountID          string             `json:"account_id"`
	Amount             float64            `json:"amount"`
	Description        string             `json:"description"`
	BeneficiaryDetails BeneficiaryDetails `json:"beneficiary_details"`
}

func main() {

	endpoint := "https://api.blufin360.com/api/v1/banking/fund-transfer" 
	accessToken := "YOUR_ACCESS_TOKEN"               
	payload := PaymentRequest{
		APIRequestID:  "API_REQ_123",
		MerchantRefID: "ORD12345678",
		PaymentMode:   "IMPS",
		TransferType:  "EXTERNAL_FUND_TRANSFER",
		AccountID:     "550e8400-e29b-41d4-a716-446655440000",
		Amount:        1250.50,
		Description:   "Vendor payout April",
		BeneficiaryDetails: BeneficiaryDetails{
			BeneficiaryName:   "Rohit Sharma",
			AccountNumber:     "123456789012",
			IFSCCode:          "SBIN0123456",
			BeneficiaryEmail:  "rohit@example.com",
			BeneficiaryMobile: "9876543210",
			BankName:          "State Bank of India",
		},
	}
	jsonData, err := json.Marshal(payload)
	if err != nil {
		fmt.Printf("Error marshaling JSON: %v\n", err)
		return
	}

	req, err := http.NewRequest("POST", endpoint, bytes.NewBuffer(jsonData))
	if err != nil {
		fmt.Printf("Error creating request: %v\n", err)
		return
	}

	req.Header.Set("Authorization", "Bearer "+accessToken)
	req.Header.Set("Content-Type", "application/json")
	client := &http.Client{
		Timeout: time.Second * 30,
	}

	resp, err := client.Do(req)
	if err != nil {
		fmt.Printf("Error sending request: %v\n", err)
		return
	}
	defer resp.Body.Close()

	body, err := io.ReadAll(resp.Body)
	if err != nil {
		fmt.Printf("Error reading response body: %v\n", err)
		return
	}

	fmt.Printf("Status Code: %d\n", resp.StatusCode)
	fmt.Printf("Response Body: %s\n", string(body))
}
```

{% endcode %}
{% endtab %}

{% tab title="Java" %}
{% code title="FetchBalance - HttpClient (Java 11+)" %}

```java
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;

public class ApiClient {
    public static void main(String[] args) throws Exception {
        String endpoint = "https://api.blufin360.com/api/v1/banking/fund-transfer";
        String accessToken = "<accessToken>";

        String jsonPayload = "{\n" +
                "  \"api_request_id\": \"API_REQ_123\",\n" +
                "  \"merchant_ref_id\": \"ORD12345678\",\n" +
                "  \"payment_mode\": \"IMPS\",\n" +
                "  \"transfer_type\": \"EXTERNAL_FUND_TRANSFER\",\n" +
                "  \"account_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n" +
                "  \"amount\": 1250.50,\n" +
                "  \"description\": \"Vendor payout April\",\n" +
                "  \"beneficiary_details\": {\n" +
                "    \"beneficiary_name\": \"Rohit Sharma\",\n" +
                "    \"account_number\": \"123456789012\",\n" +
                "    \"ifsc_code\": \"SBIN0123456\",\n" +
                "    \"beneficiary_email\": \"rohit@example.com\",\n" +
                "    \"beneficiary_mobile\": \"9876543210\",\n" +
                "    \"bank_name\": \"State Bank of India\"\n" +
                "  }\n" +
                "}";

        URL url = new URL(endpoint);
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("POST");
        connection.setRequestProperty("Authorization", "Bearer " + accessToken);
        connection.setRequestProperty("Content-Type", "application/json");
        connection.setDoOutput(true);

        try (OutputStream os = connection.getOutputStream()) {
            byte[] input = jsonPayload.getBytes(StandardCharsets.UTF_8);
            os.write(input, 0, input.length);
        }
        int responseCode = connection.getResponseCode();
        System.out.println("Response Code: " + responseCode);
        connection.disconnect();
    }
}
```

{% endcode %}
{% endtab %}

{% tab title="PHP" %}
{% code title="FetchBalance- cURL (PHP)" %}

```php
<?php
$endpoint = 'https://api.blufin360.com/api/v1/banking/fund-transfer';
$accessToken = '<accessToken>';

$payload = [
    'api_request_id' => 'API_REQ_123',
    'merchant_ref_id' => 'ORD12345678',
    'payment_mode' => 'IMPS',
    'transfer_type' => 'EXTERNAL_FUND_TRANSFER',
    'account_id' => '550e8400-e29b-41d4-a716-446655440000',
    'amount' => 1250.50,
    'description' => 'Vendor payout April',
    'beneficiary_details' => [
        'beneficiary_name' => 'Rohit Sharma',
        'account_number' => '123456789012',
        'ifsc_code' => 'SBIN0123456',
        'beneficiary_email' => 'rohit@example.com',
        'beneficiary_mobile' => '9876543210',
        'bank_name' => 'State Bank of India',
    ],
];

$ch = curl_init($endpoint);

curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . $accessToken,
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode($payload, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE),
]);

$response = curl_exec($ch);

if ($response === false) {
    $error = curl_error($ch);
    curl_close($ch);
    throw new Exception('cURL Error: ' . $error);
}

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

echo "HTTP Status Code: " . $httpCode . PHP_EOL;
echo "Response: " . $response . PHP_EOL;
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Headers

| Header        | Type     | Required | Description                   | Format                                 |
| ------------- | -------- | -------- | ----------------------------- | -------------------------------------- |
| Authorization | `string` | ✅        | Access token for auth         | Authorization: Bearer `<access_token>` |
| Content-Type  | `string` | ✅        | Specifies request body format | application/json                       |

### Request Payload

```json
{
  "account_id": "01234e-eb3f-427c-9b55-421237cb06f3"
}
```

### Body

| Field       | Type   | Required | Description                 |
| ----------- | ------ | -------- | --------------------------- |
| account\_id | `UUID` | ✅        | Merchant account identifier |

### Success Response — <mark style="color:$primary;">200</mark> (example)

```json
{
    "status": "success",
    "status_code": 200,
    "message": "Balance synced successfully",
    "data": {
        "service_type": null,
        "service_subtype": null,
        "response_code": "TXN-2600",
        "response_message": "Balance fetched successfully",
        "account_id": "0ca770ce-eb3f-427c-9b55-427527cb06f3",
        "account_number": "777705161218",
        "ifsc": "ICIC0000583",
        "account_type": "CURRENT",
        "nickname": "TESTING",
        "account_holder": "WEBFINEX TECHFUSION PRIVATE LIMITED",
        "account_balance": "3473.40000",
        "balance_synced_at": "2026-04-16T04:44:44+05:30"
    },
    "detail": null
}
```

### Response Metadata

| Field               | Type      | Description                                                      |
| ------------------- | --------- | ---------------------------------------------------------------- |
| status              | `string`  | Indicates the overall result of the API call.                    |
| code / status\_code | `integer` | HTTP status code                                                 |
| timestamp           | `integer` | Epoch time of response                                           |
| message             | `string`  | A summary of the outcome (e.g. `"Balance synced successfully"`). |
| data                | `object`  | Verification response payload                                    |

### Failure Response — <mark style="color:$danger;">400 / 422 / 500</mark>

| Field   | Type      | Description                                                                  |
| ------- | --------- | ---------------------------------------------------------------------------- |
| status  | `string`  | Indicates the overall result of the API call. Returns an `error` on failure. |
| code    | `integer` | Error status code                                                            |
| message | `string`  | A summary of the outcome (e.g. `"Balance sync unsuccessful"`).               |
| error   | `object`  | Error details                                                                |

**Common Error**

{% hint style="warning" %}
Please rely on the **response\_code** field to determine the final outcome of the transaction. While the **transaction\_status** and **response\_message** provide a general indication.
{% endhint %}
