> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.senjaropay.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.senjaropay.com/_mcp/server.

# Get merchant wallet balances

POST https://api.senjaropay.com/senjaropay/merchant/payments/balance
Content-Type: application/json

Reference: https://docs.senjaropay.com/api-documentation/collections/get-balance

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: SenjaroPay API
  version: 1.0.0
paths:
  /senjaropay/merchant/payments/balance:
    post:
      operationId: getBalance
      summary: Get merchant wallet balances
      tags:
        - subpackage_collections
      parameters:
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Wallet balances
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalanceResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties:
                description: Any type
servers:
  - url: https://api.senjaropay.com
    description: SenjaroPay API
components:
  schemas:
    Wallet:
      type: object
      properties:
        id:
          type: integer
        currency:
          type: string
        actual_balance:
          type: string
        available_balance:
          type: string
      title: Wallet
    BalanceResponse:
      type: object
      properties:
        count:
          type: integer
        wallets:
          type: array
          items:
            $ref: '#/components/schemas/Wallet'
      title: BalanceResponse
    ApiError:
      type: object
      properties:
        status:
          type: string
        code:
          type: integer
        error_code:
          type: string
        message:
          type: string
      title: ApiError
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
    apiSecretAuth:
      type: apiKey
      in: header
      name: x-api-secret

```

## Examples



**Request**

```json
{}
```

**Response**

```json
{
  "count": 2,
  "wallets": [
    {
      "id": 221,
      "currency": "TZS",
      "actual_balance": "0.00",
      "available_balance": "0.00"
    }
  ]
}
```

**SDK Code**

```python collections_getBalance_example
import requests

url = "https://api.senjaropay.com/senjaropay/merchant/payments/balance"

payload = {}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript collections_getBalance_example
const url = 'https://api.senjaropay.com/senjaropay/merchant/payments/balance';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go collections_getBalance_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.senjaropay.com/senjaropay/merchant/payments/balance"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby collections_getBalance_example
require 'uri'
require 'net/http'

url = URI("https://api.senjaropay.com/senjaropay/merchant/payments/balance")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java collections_getBalance_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.senjaropay.com/senjaropay/merchant/payments/balance")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php collections_getBalance_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.senjaropay.com/senjaropay/merchant/payments/balance', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp collections_getBalance_example
using RestSharp;

var client = new RestClient("https://api.senjaropay.com/senjaropay/merchant/payments/balance");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift collections_getBalance_example
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.senjaropay.com/senjaropay/merchant/payments/balance")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```