{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/finance-dev/json-schema/finance-dev-account-balance-v2-schema.json",
  "title": "AccountBalanceV2",
  "description": "Response body for GET /v2/accounts/{id}/balance. Returned as the **top-level JSON object**. Numeric amounts are decimal strings.",
  "x-generated": "2026-12-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/finance-dev-openapi.json#/components/schemas/AccountBalanceV2",
  "properties": {
    "accountId": {
      "description": "Account these balances belong to. Match it to the account selected by the user.",
      "type": "string"
    },
    "amountAvailableToWithdraw": {
      "description": "Cash currently available to withdraw from the account, returned as a decimal string.",
      "type": "string"
    },
    "balance": {
      "description": "Total account balance (net account value), returned as a decimal string. Use this as the headline portfolio value.",
      "type": "string"
    },
    "cashBalance": {
      "description": "Current cash balance in the account, returned as a decimal string. Can be negative on a margin account.",
      "type": "string"
    },
    "costOfPositions": {
      "description": "Aggregate cost basis of all currently open positions, returned as a decimal string.",
      "type": "string"
    },
    "credit": {
      "description": "Total margin credit line extended to the account. Decimal string.",
      "type": "string"
    },
    "creditRemaining": {
      "description": "How much of the credit line is still available to draw against. Decimal string.",
      "type": "string"
    },
    "dayOpenPnl": {
      "description": "Open (unrealized) profit/loss generated during the current trading day, returned as a decimal string.",
      "type": "string"
    },
    "dayRealizedPnl": {
      "description": "Profit/loss realized from positions closed during the current trading day, returned as a decimal string.",
      "type": "string"
    },
    "dayTotalPnl": {
      "description": "Total profit/loss for the current trading day, combining day open and day realized P&L (`dayOpenPnl` + `dayRealizedPnl`). Decimal string.",
      "type": "string"
    },
    "dayTradeBuyingPower": {
      "description": "How much the user can use for same-day round-trip trades. Typically up to 4× equity for pattern day traders. Resets at end of day. Decimal string.",
      "type": "string"
    },
    "dayTradeOvernightRegTBuyingPower": {
      "description": "Reg T overnight buying power available for day-trade-related calculations, returned as a decimal string.",
      "type": "string"
    },
    "fundsAvailableForWithdrawal": {
      "description": "Cash available to withdraw right now, returned as a decimal string. The lower of `creditRemaining` and `smaCreditRemaining`, adjusted by the clearing firm's previous-close haircut (`sodNetFundsAvailable` minus `sodGrossFundsAvailable`) and floored at zero. Derived at read time. Until the start-of-day funds data has loaded (see `sodFundsAvailableDate`) the haircut is zero and this equals the lower of the two credit figures.",
      "type": "string"
    },
    "grossMargin": {
      "description": "Total amount currently borrowed from the broker on margin (before offsets). Use this in risk and account-health displays. Decimal string.",
      "type": "string"
    },
    "heldBackFunds": {
      "description": "Funds reserved or held back by the brokerage, returned as a decimal string. Subtract this from available cash displays when explaining restricted funds.",
      "type": "string"
    },
    "intradayMarginBalance": {
      "description": "Margin loan currently outstanding, returned as a positive decimal string and rolled forward through today's trading: the start-of-day margin trade balance (sign-inverted) plus `valueSold` minus `valueBought`. Derived at read time, not stored.",
      "type": "string"
    },
    "maintReq": {
      "description": "**Maintenance requirement** — the minimum equity that must be held to support current positions. Drop below this and the account may receive a margin call. Decimal string.",
      "type": "string"
    },
    "netBuyingPower": {
      "description": "Total purchasing power available right now across all instruments — the main number to show as 'Buying Power' in a trading UI. Decimal string.",
      "type": "string"
    },
    "openPnl": {
      "description": "Total open (unrealized) profit/loss across all currently held positions, returned as a decimal string. Mirrors `unrealizedPl`.",
      "type": "string"
    },
    "optionBuyingPower": {
      "description": "How much the user can spend specifically on options. Usually lower than stock buying power because options require cash. Decimal string.",
      "type": "string"
    },
    "pdt": {
      "description": "**Pattern Day Trader** flag balance — relates to FINRA Rule 4210 (four-day-trades-in-five-days rule, $25,000 minimum equity). Decimal string.",
      "type": "string"
    },
    "pdtCreditRemaining": {
      "description": "Remaining day-trade buying power for a PDT-flagged account. Decimal string.",
      "type": "string"
    },
    "pendingOrdersCount": {
      "description": "Number of orders currently pending. Use this to explain why available buying power may be reserved.",
      "type": "integer"
    },
    "pendingOrdersMarginRequirements": {
      "description": "Estimated margin requirement reserved by pending orders, returned as a decimal string.",
      "type": "string"
    },
    "realizedPl": {
      "description": "Cumulative profit/loss from positions that have already been **closed**. Locked in — does not move with the market. Decimal string.",
      "type": "string"
    },
    "settledFunds": {
      "description": "Cash that has fully settled (T+1/T+2 has passed) and is freely available with no restrictions. Decimal string.",
      "type": "string"
    },
    "sma": {
      "description": "**Special Memorandum Account** — a Reg T concept. Effectively a stored-up pool of 'extra' buying power that grew from past gains in a margin account. Decimal string.",
      "type": "string"
    },
    "smaCreditRemaining": {
      "description": "Remaining SMA-based buying power still available to draw against, returned as a decimal string.",
      "type": "string"
    },
    "sodFundsAvailableDate": {
      "description": "Business date (YYYY-MM-DD) of the start-of-day funds data behind `sodGrossFundsAvailable` and `sodNetFundsAvailable`. Omitted when that data has not loaded for the account, which is the only way to tell a genuine zero from an unloaded one.",
      "format": "date",
      "type": "string"
    },
    "sodGrossFundsAvailable": {
      "description": "Gross funds available at the previous close, as reported by the clearing firm, returned as a decimal string. `\"0\"` until the start-of-day load has run; check `sodFundsAvailableDate` before relying on it.",
      "type": "string"
    },
    "sodMarginTradeBalance": {
      "description": "Start-of-day margin trade-date balance as reported by the clearing firm, returned as a decimal string. Negative while a margin loan is outstanding. `\"0\"` until the start-of-day load has run for the account.",
      "type": "string"
    },
    "sodNetFundsAvailable": {
      "description": "Net funds available to withdraw at the previous close, as reported by the clearing firm, returned as a decimal string. Previous-close only; for the live figure use `fundsAvailableForWithdrawal`. `\"0\"` until the start-of-day load has run.",
      "type": "string"
    },
    "sodPositionsMarketValue": {
      "description": "Market value of positions at the start of the day, returned as a decimal string. Use this for daily performance comparisons.",
      "type": "string"
    },
    "sodTtlEquity": {
      "description": "Total account equity at the start of the day, returned as a decimal string. Use this as the baseline for day-over-day equity changes.",
      "type": "string"
    },
    "sodTtlEquityUpdatedAt": {
      "description": "When start-of-day total equity (`sodTtlEquity`) was last updated, in RFC3339 format. Omitted when not set.",
      "format": "date-time",
      "type": "string"
    },
    "startOfDayCash": {
      "description": "Cash balance when today's trading session opened. Useful as the baseline for calculating today's cash change. Decimal string.",
      "type": "string"
    },
    "stockBuyingPower": {
      "description": "How much the user can spend specifically on stocks. On a margin account this is typically up to 2× cash. Decimal string.",
      "type": "string"
    },
    "unrealizedPl": {
      "description": "Profit/loss on positions the user currently **holds open** — paper gains/losses based on current market prices. Changes with the market. Decimal string.",
      "type": "string"
    },
    "unsettledFunds": {
      "description": "Cash from recent sales that hasn't settled yet. Usable for most trades, but cash accounts may restrict using it for new buys. Decimal string.",
      "type": "string"
    },
    "valueBought": {
      "description": "Total value bought for the reporting window, returned as a decimal string. Use this in trading activity summaries.",
      "type": "string"
    },
    "valueSold": {
      "description": "Total value sold for the reporting window, returned as a decimal string. Use this in trading activity summaries.",
      "type": "string"
    }
  },
  "type": "object"
}