# Credit balances

Subscribe to get dynamic credit balance updates.

## Subscribe to credit balances

> Subscribe credit updates request example


```json
{
  "creditBalanceSubscriptionRequest": {
    "type": "CREDIT",
    "customerAccountList": [
      "Margin",
      "Cash"
    ],
    "providersList": [
      "<brokername>"
    ],
    "action": "SUBSCRIBE"
  }
}
```

> Request body


| Attribute  | Description |
|  --- | --- |
| `type` | **string: (required)** Balance type `CREDIT`. |
| `customerAccountList` | **array [string]: (required)** The account types:* `Margin`: Margin balance.
* `Cash`: Cash balance.

 |
| `providersList` | **array [string]: (required)** A list of broker IDs to request balances from. |
| `action` | **string: (required)** Requested action `SUBSCRIBE`. |


> Returns


> Credit balance example


```json
{
  "creditDetails": [
    {
      "orgName": "<customername>",
      "balances": [
        {
          "legalEntity": "Margin",
          "provider": "<brokername>",
          "limitCurrency": "USD",
          "accountBalance": 100000000,
          "marginAvailable": 98000000,
          "marginUsed": 0,
          "unrealizedPnL": 0,
          "currentBalance": 100000000
        }
      ]
    }
  ]
}
```

| Attribute  | Description |
|  --- | --- |
| `orgName` | **string:** Requesting customer ID. |
| `balances` | **array [balances object]:** Balances by broker and account type (`Margin`|`Cash`). |
| `legalEntity` | **string:** Account type (`Margin`|`Cash`). |
| `provider` | **string:** Broker ID of balances. |
| `limitCurrency` | **string:** The currency in which credit amounts are denominated. |
| `accountBalance` | **double:** Credit balance amount. |
| `marginAvailable` | **double:** Credit margin available to the requesting customer. This includes the applied margin factor, if any. |
| `marginUsed` | **double:** Total credit utilized by the requesting customer. |
| `unrealizedPnL` | **double:** Intraday unsettled PnL (customer's net receivables minus their net payables). |
| `currentBalance` | **double:** Current credit balance amount. |