> ## Documentation Index
> Fetch the complete documentation index at: https://docs.swiftpay.cx/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Balance

> Retrieve your current balance breakdown

# Get Balance

Returns your current balance information including available balance, reserved amounts, and pending withdrawals.

<Note>
  Available balance = Total settled funds - Reserved balance - Pending
  withdrawals
</Note>

## Request

<ParamField header="Authorization" type="string" required>
  Bearer token with your API key. Example: `Bearer mp_live_your_api_key`
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Whether the request was successful
</ResponseField>

<ResponseField name="data" type="object">
  <Expandable title="properties">
    <ResponseField name="balance" type="integer">
      Current available balance in cents (alias for `availableBalance`)
    </ResponseField>

    <ResponseField name="availableBalance" type="integer">
      Amount available for withdrawal in cents
    </ResponseField>

    <ResponseField name="reservedBalance" type="integer">
      Amount held in rolling reserves in cents
    </ResponseField>

    <ResponseField name="totalBalance" type="integer">
      Total settled balance in cents (available + reserved)
    </ResponseField>

    <ResponseField name="pendingWithdrawals" type="integer">
      Amount in pending/processing withdrawals in cents
    </ResponseField>

    <ResponseField name="totalPayouts" type="integer">
      Total amount of successful withdrawals in cents
    </ResponseField>

    <ResponseField name="totalRefunds" type="integer">
      Total amount of processed refunds in cents
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl https://api.swiftpay.cx/api/balance \
    -H "Authorization: Bearer mp_live_your_api_key"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.swiftpay.cx/api/balance", {
     headers: {
        Authorization: "Bearer mp_live_your_api_key",
     },
  });

  const balance = await response.json();
  console.log(balance.data.availableBalance);
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://api.swiftpay.cx/api/balance',
      headers={'Authorization': 'Bearer mp_live_your_api_key'}
  )

  balance = response.json()
  print(balance['data']['availableBalance'])
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "data": {
      "availableBalance": 150000,
      "reservedBalance": 25000,
      "totalBalance": 175000,
      "pendingWithdrawals": 0
    }
  }
  ```

  ```json 401 theme={null}
  {
     "success": false,
     "error": {
        "type": "unauthorized",
        "message": "Invalid API key",
        "requestId": "req_abc123"
     }
  }
  ```
</ResponseExample>
