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

# Get portfolio

> Returns one account portfolio snapshot containing account-level values and the per-asset breakdown. Quote-denominated monetary amounts use an `_in_quote` suffix; native asset amounts omit the suffix.



## OpenAPI

````yaml https://d2588n1sy4m36o.cloudfront.net/uat/merged/openapi.json get /v1/accounts/{account_id}/portfolio
openapi: 3.1.0
info:
  title: PWS Public API
  version: '1'
  description: >-
    Integrate with Payward Services to onboard users, manage accounts and funds,
    trade assets, and receive event notifications.
  contact:
    name: Payward Services
servers:
  - url: https://api.sandbox.services.payward.com
security: []
tags:
  - name: Assets
    description: List the assets PWS is willing to swap.
    x-displayName: Assets
  - name: Conversions
    description: >-
      Rule-driven and on-demand fiat ↔ crypto value movement, including
      conversion rules and deposits.
    x-displayName: Conversions
  - name: Auto Earn
    description: >-
      Manage Auto Earn preferences and retrieve allocation and reward
      information.
    x-displayName: Auto Earn
  - name: Bonded Earn
    description: >-
      Allocate funds to and deallocate funds from bonded earn strategies, review
      allocations, and track request status.
    x-displayName: Bonded Earn
  - name: Funding
    description: >-
      Discover deposit and withdrawal options, manage deposit addresses, and
      move funds between accounts.
    x-displayName: Funding
  - name: Derivative transfers
    description: >-
      Move funds between an account's spot balance and the same owner's futures
      balance.
    x-displayName: Derivative transfers
  - name: Portfolio
    description: 'Inspect a customer''s portfolio: balances, valuations, and transactions.'
    x-displayName: Portfolio
  - name: Ramp
    description: >-
      Support Ramp flows with discovery, quotes, limits, and hosted checkout
      experiences.
    x-displayName: Ramp
  - name: Reports
    description: Settlement and reconciliation reports for the partner.
    x-displayName: Reports
  - name: Swaps
    description: Account-funded quotes that lock a price until they expire or are executed.
    x-displayName: Swaps
  - name: Onchain quotes
    description: Wallet-funded quotes that return the data needed to settle onchain.
    x-displayName: Onchain quotes
  - name: Price trigger swaps
    description: Swaps that wait for a target price before submitting a trade.
    x-displayName: Price trigger swaps
  - name: Travel Rule verifications
    description: Travel Rule address ownership verification flows.
    x-displayName: Travel Rule verifications
  - name: Users
    description: >-
      User onboarding and status flows that the partner manages.


      - **Create User** provisions an account-owned user from an external
      reference and optional email.

      - **Get User** retrieves the user's profile, verification status, and
      required actions.


      Use the returned user `id` for calls that require the user's identifier.
    x-displayName: Users
  - name: Verifications
    description: Identity verification (KYC) submission and status for end users.
    x-displayName: Verifications
  - name: Webhooks
    description: >-
      Register HTTPS destinations to receive event deliveries, rotate signing
      secrets, and inspect, update, or delete existing subscriptions. Each
      subscription is owned by the authenticated partner; deliveries are signed
      with HMAC-SHA256 and retried on transient failures.
    x-displayName: Webhooks
paths:
  /v1/accounts/{account_id}/portfolio:
    get:
      tags:
        - Portfolio
      summary: Get portfolio
      description: >-
        Returns one account portfolio snapshot containing account-level values
        and the per-asset breakdown. Quote-denominated monetary amounts use an
        `_in_quote` suffix; native asset amounts omit the suffix.
      operationId: getPortfolio
      parameters:
        - in: query
          name: quote_symbol
          schema:
            $ref: '#/components/schemas/AssetSymbol'
            description: Quote asset symbol.
            default: USD
          style: form
          example: USD
        - in: query
          name: quote_type
          schema:
            $ref: '#/components/schemas/Portfolio_QuoteAssetType'
          description: Quote asset classification. Supports fiat and stablecoin.
          style: form
          example: fiat
        - in: query
          name: with_zero_balances
          schema:
            type: boolean
            default: false
          description: Whether to include assets with zero balances.
          style: form
          example: true
        - $ref: '#/components/parameters/AccountId'
      responses:
        '200':
          description: Successful response
          headers:
            X-Trace-Id:
              $ref: '#/components/headers/TraceId'
            Strict-Transport-Security:
              $ref: '#/components/headers/StrictTransportSecurity'
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Portfolio_Portfolio'
                required:
                  - data
              examples:
                portfolio:
                  summary: Illustrative USD-quoted snapshot
                  value:
                    data:
                      as_of: '2026-08-25T12:34:56Z'
                      quote:
                        symbol: USD
                        type: fiat
                        usd_index_rate: '1'
                      total_in_quote: '41000.00'
                      availability:
                        available_in_quote: '30000.00'
                        withheld:
                          total_in_quote: '11000.00'
                          open_orders_in_quote: '2000.00'
                          earn_in_quote: '4000.00'
                          other_in_quote: '5000.00'
                      pnl:
                        unrealized_in_quote: '3500.00'
                        realized_in_quote: '-3.7440'
                        reference_currency:
                          symbol: USD
                          type: fiat
                        status:
                          unrealized: ready
                          realized: in_progress
                      assets:
                        - symbol: BTC
                          type: crypto
                          index_price_in_quote: '62000.00'
                          balances:
                            total: '0.5'
                            total_in_quote: '31000.00'
                            main:
                              total: '0.5'
                              total_in_quote: '31000.00'
                          availability:
                            trade: '0.5'
                          pnl:
                            avg_entry_price_in_quote: '55000.00'
                            cost_basis_in_quote: '27500.00'
                            unrealized_in_quote: '3500.00'
                            reference_currency:
                              symbol: USD
                              type: fiat
                            status:
                              avg_entry_price: ready
                              cost_basis: ready
                              unrealized: ready
                              realized: in_progress
                        - symbol: USD
                          type: fiat
                          index_price_in_quote: '1'
                          balances:
                            total: '10000.00'
                            total_in_quote: '10000.00'
                            main:
                              total: '10000.00'
                              total_in_quote: '10000.00'
        '400':
          description: Validation error
          headers:
            X-Trace-Id:
              $ref: '#/components/headers/TraceId'
            Strict-Transport-Security:
              $ref: '#/components/headers/StrictTransportSecurity'
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
              examples:
                invalid-request:
                  $ref: '#/components/examples/portfolio-bad-request'
        '401':
          description: Authentication required
          headers:
            X-Trace-Id:
              $ref: '#/components/headers/TraceId'
            Strict-Transport-Security:
              $ref: '#/components/headers/StrictTransportSecurity'
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
              examples:
                authentication-failed:
                  $ref: '#/components/examples/portfolio-unauthenticated'
        '403':
          description: Forbidden
          headers:
            X-Trace-Id:
              $ref: '#/components/headers/TraceId'
            Strict-Transport-Security:
              $ref: '#/components/headers/StrictTransportSecurity'
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
              examples:
                caller-is-not-allowed:
                  $ref: '#/components/examples/portfolio-forbidden'
        '404':
          description: Not found
          headers:
            X-Trace-Id:
              $ref: '#/components/headers/TraceId'
            Strict-Transport-Security:
              $ref: '#/components/headers/StrictTransportSecurity'
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
              examples:
                not-found:
                  $ref: '#/components/examples/portfolio-not-found'
        '429':
          description: Rate limit exceeded
          headers:
            X-Trace-Id:
              $ref: '#/components/headers/TraceId'
            Strict-Transport-Security:
              $ref: '#/components/headers/StrictTransportSecurity'
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceExhaustedError'
              examples:
                rate-limit-exceeded:
                  $ref: '#/components/examples/portfolio-resource-exhausted'
        '500':
          description: Internal server error
          headers:
            X-Trace-Id:
              $ref: '#/components/headers/TraceId'
            Strict-Transport-Security:
              $ref: '#/components/headers/StrictTransportSecurity'
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
              examples:
                internal-error:
                  $ref: '#/components/examples/portfolio-internal'
        '501':
          description: Error response
          headers:
            X-Trace-Id:
              $ref: '#/components/headers/TraceId'
            Strict-Transport-Security:
              $ref: '#/components/headers/StrictTransportSecurity'
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnimplementedError'
              examples:
                not-implemented:
                  $ref: '#/components/examples/portfolio-unimplemented'
        '503':
          description: Service unavailable
          headers:
            X-Trace-Id:
              $ref: '#/components/headers/TraceId'
            Strict-Transport-Security:
              $ref: '#/components/headers/StrictTransportSecurity'
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnavailableError'
              examples:
                service-unavailable:
                  $ref: '#/components/examples/portfolio-unavailable'
        '504':
          description: Deadline exceeded
          headers:
            X-Trace-Id:
              $ref: '#/components/headers/TraceId'
            Strict-Transport-Security:
              $ref: '#/components/headers/StrictTransportSecurity'
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeadlineExceededError'
              examples:
                request-deadline-exceeded:
                  $ref: '#/components/examples/portfolio-deadline-exceeded'
      security:
        - ApiKey: []
          ApiSign: []
          ApiNonce: []
components:
  schemas:
    AssetSymbol:
      description: Symbol identifying an asset within its asset category.
      type: string
      minLength: 1
      maxLength: 16
    Portfolio_QuoteAssetType:
      description: Quote asset classification. Supports fiat and stablecoin.
      type: string
      enum:
        - fiat
        - stablecoin
      default: fiat
    Portfolio_Portfolio:
      description: A unified account portfolio snapshot.
      type: object
      properties:
        as_of:
          $ref: '#/components/schemas/DateTime'
          description: Time of the latest index-price update represented by this snapshot.
        quote:
          $ref: '#/components/schemas/Portfolio_PortfolioQuote'
        total_in_quote:
          description: Total account value across all holdings in the quote currency.
          type: string
        availability:
          $ref: '#/components/schemas/Portfolio_PortfolioAvailability'
        pnl:
          $ref: '#/components/schemas/Portfolio_PortfolioPnl'
        assets:
          description: >-
            Per-asset portfolio breakdown. Always present and empty when there
            are no assets.
          type: array
          items:
            $ref: '#/components/schemas/Portfolio_PortfolioAsset'
      required:
        - as_of
        - quote
        - total_in_quote
        - availability
        - assets
    BadRequestError:
      title: Bad Request
      description: Request validation failed or the request could not be processed.
      oneOf:
        - title: Bad Request
          allOf:
            - $ref: '#/components/schemas/PwsValidationErrorEnvelope'
            - type: object
              required:
                - error
              properties:
                error:
                  allOf:
                    - $ref: '#/components/schemas/PwsValidationError'
                    - type: object
                      required:
                        - status
                        - code
                      properties:
                        status:
                          type: integer
                          format: int32
                          const: 400
                        code:
                          type: string
                          enum:
                            - bad_request
        - title: Gateway
          description: >-
            Gateway-level validation failure returned before the request reaches
            the service.
          allOf:
            - $ref: '#/components/schemas/PwsValidationErrorEnvelope'
            - type: object
              required:
                - error
              properties:
                error:
                  allOf:
                    - $ref: '#/components/schemas/PwsValidationError'
                    - type: object
                      required:
                        - status
                        - code
                      properties:
                        type:
                          type: string
                          const: service_error
                        status:
                          type: integer
                          format: int32
                          const: 400
                        code:
                          type: string
                          const: gateway
    UnauthenticatedError:
      title: Unauthenticated
      description: Authentication credentials are missing, invalid, or not accepted.
      oneOf:
        - title: Unauthenticated
          allOf:
            - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
            - type: object
              required:
                - error
              properties:
                error:
                  allOf:
                    - $ref: '#/components/schemas/PwsGeneralError'
                    - type: object
                      required:
                        - status
                        - code
                      properties:
                        status:
                          type: integer
                          format: int32
                          const: 401
                        code:
                          type: string
                          enum:
                            - unauthenticated
        - title: Gateway
          description: Authentication failure returned by the API gateway.
          allOf:
            - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
            - type: object
              required:
                - error
              properties:
                error:
                  allOf:
                    - $ref: '#/components/schemas/PwsGeneralError'
                    - type: object
                      required:
                        - status
                        - code
                      properties:
                        type:
                          type: string
                          const: service_error
                        status:
                          type: integer
                          format: int32
                          const: 401
                        code:
                          type: string
                          const: gateway
    ForbiddenError:
      title: Forbidden
      description: The caller is not allowed to perform this operation.
      oneOf:
        - title: Forbidden
          allOf:
            - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
            - type: object
              required:
                - error
              properties:
                error:
                  allOf:
                    - $ref: '#/components/schemas/PwsGeneralError'
                    - type: object
                      required:
                        - status
                        - code
                      properties:
                        status:
                          type: integer
                          format: int32
                          const: 403
                        code:
                          type: string
                          enum:
                            - forbidden
        - title: Gateway
          description: Authorization failure returned by the API gateway.
          allOf:
            - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
            - type: object
              required:
                - error
              properties:
                error:
                  allOf:
                    - $ref: '#/components/schemas/PwsGeneralError'
                    - type: object
                      required:
                        - status
                        - code
                      properties:
                        type:
                          type: string
                          const: service_error
                        status:
                          type: integer
                          format: int32
                          const: 403
                        code:
                          type: string
                          const: gateway
    NotFoundError:
      description: The requested resource was not found.
      allOf:
        - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsGeneralError'
                - type: object
                  required:
                    - status
                    - code
                  properties:
                    status:
                      type: integer
                      format: int32
                      const: 404
                    code:
                      type: string
                      enum:
                        - not_found
    ResourceExhaustedError:
      description: The request was rate limited or a resource quota was exhausted.
      allOf:
        - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsGeneralError'
                - type: object
                  required:
                    - status
                    - code
                  properties:
                    status:
                      type: integer
                      format: int32
                      const: 429
                    code:
                      type: string
                      enum:
                        - resource_exhausted
    InternalError:
      description: An unexpected server-side error occurred.
      allOf:
        - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsGeneralError'
                - type: object
                  required:
                    - status
                    - code
                  properties:
                    status:
                      type: integer
                      format: int32
                      const: 500
                    code:
                      type: string
                      enum:
                        - internal
    UnimplementedError:
      description: The requested operation is not implemented.
      allOf:
        - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsGeneralError'
                - type: object
                  required:
                    - status
                    - code
                  properties:
                    status:
                      type: integer
                      format: int32
                      const: 501
                    code:
                      type: string
                      enum:
                        - unimplemented
    UnavailableError:
      description: The service is temporarily unavailable.
      allOf:
        - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsGeneralError'
                - type: object
                  required:
                    - status
                    - code
                  properties:
                    status:
                      type: integer
                      format: int32
                      const: 503
                    code:
                      type: string
                      enum:
                        - unavailable
    DeadlineExceededError:
      description: The request deadline was exceeded before a response could be produced.
      allOf:
        - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsGeneralError'
                - type: object
                  required:
                    - status
                    - code
                  properties:
                    status:
                      type: integer
                      format: int32
                      const: 504
                    code:
                      type: string
                      enum:
                        - deadline_exceeded
    AccountId:
      description: Globally unique public identifier for an account.
      type: string
      minLength: 14
      maxLength: 42
    DateTime:
      description: RFC 3339 timestamp.
      type: string
      format: date-time
    Portfolio_PortfolioQuote:
      description: Currency used for monetary values throughout the portfolio snapshot.
      type: object
      properties:
        symbol:
          description: Public quote-asset symbol.
          type: string
          example: USD
        type:
          $ref: '#/components/schemas/Portfolio_QuoteAssetType'
        usd_index_rate:
          description: USD value of one unit of this quote asset. Omitted when unavailable.
          type: string
          example: '1.14'
      required:
        - symbol
        - type
    Portfolio_PortfolioAvailability:
      description: Account-level availability and holds in the portfolio quote.
      type: object
      properties:
        available_in_quote:
          description: Funds available for trading or withdrawal after holds.
          type: string
        withheld:
          $ref: '#/components/schemas/Portfolio_PortfolioWithheld'
      required:
        - available_in_quote
        - withheld
    Portfolio_PortfolioPnl:
      description: Account-level average-cost-basis PnL in the portfolio quote.
      type: object
      properties:
        reference_currency:
          $ref: '#/components/schemas/Portfolio_PnlReferenceCurrency'
        unrealized_in_quote:
          description: Lots-based unrealized PnL.
          type: string
        realized_in_quote:
          description: Realized PnL.
          type: string
        cost_basis_in_quote:
          description: Total cost basis.
          type: string
        status:
          $ref: '#/components/schemas/Portfolio_PnlProcessingStatus'
    Portfolio_PortfolioAsset:
      description: Portfolio data for one asset.
      type: object
      properties:
        symbol:
          description: Public asset symbol.
          type: string
        type:
          $ref: '#/components/schemas/Portfolio_AssetType'
        index_price_in_quote:
          $ref: '#/components/schemas/Price'
          description: Price of one unit of the asset in the top-level portfolio quote.
        balances:
          $ref: '#/components/schemas/Portfolio_PortfolioBalances'
        held_for_orders:
          $ref: '#/components/schemas/Portfolio_PortfolioHeldForOrders'
        earn:
          $ref: '#/components/schemas/Portfolio_PortfolioEarn'
        availability:
          $ref: '#/components/schemas/Portfolio_PortfolioAssetAvailability'
        credit_line:
          $ref: '#/components/schemas/Portfolio_PortfolioCreditLine'
        pnl:
          $ref: '#/components/schemas/Portfolio_PortfolioAssetPnl'
      required:
        - symbol
        - type
        - balances
    PwsValidationErrorEnvelope:
      description: Error envelope for request validation failures.
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/PwsValidationError'
          description: Validation error details.
    PwsValidationError:
      description: Standard PWS API error object for request validation failures.
      type: object
      required:
        - type
        - status
        - instance
        - code
      properties:
        type:
          description: Machine-readable error class.
          type: string
        status:
          description: HTTP status code returned for this error.
          type: integer
          format: int32
        instance:
          description: Request identifier for this specific error occurrence.
          type: string
        code:
          description: Stable machine-readable error code.
          type: string
        doc_url:
          description: Optional link to documentation for this error.
          type: string
          format: uri
        causes:
          description: Validation failures that contributed to the error.
          type: array
          items:
            $ref: '#/components/schemas/PwsErrorCause'
    PwsGeneralErrorEnvelope:
      description: Error envelope for operational or domain failures.
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/PwsGeneralError'
          description: General error details.
    PwsGeneralError:
      description: Standard PWS API error object for non-validation failures.
      allOf:
        - $ref: '#/components/schemas/PwsErrorBase'
        - type: object
          properties:
            causes:
              description: Additional error details, when present.
              type: array
              items:
                type: object
                additionalProperties: true
    Portfolio_PortfolioWithheld:
      description: >-
        Funds unavailable because of orders, earn allocation, or other temporary
        holds.
      type: object
      properties:
        total_in_quote:
          description: Total withheld value.
          type: string
        open_orders_in_quote:
          description: Total value held for open orders.
          type: string
        earn_in_quote:
          description: Value withheld for earn products.
          type: string
        other_in_quote:
          description: >-
            Other temporary holds such as card holds, paylinks, or pending
            movements.
          type: string
      required:
        - total_in_quote
        - open_orders_in_quote
        - earn_in_quote
        - other_in_quote
    Portfolio_PnlReferenceCurrency:
      description: Currency Portfolio uses as the PnL calculation basis.
      type: object
      properties:
        symbol:
          description: Public symbol of the PnL reference currency.
          type: string
        type:
          $ref: '#/components/schemas/Portfolio_AssetType'
      required:
        - symbol
        - type
    Portfolio_PnlProcessingStatus:
      description: Readiness of average-cost-basis calculations.
      type: object
      properties:
        avg_entry_price:
          $ref: '#/components/schemas/Portfolio_PnlProcessingState'
        cost_basis:
          $ref: '#/components/schemas/Portfolio_PnlProcessingState'
        unrealized:
          $ref: '#/components/schemas/Portfolio_PnlProcessingState'
        realized:
          $ref: '#/components/schemas/Portfolio_PnlProcessingState'
    Portfolio_AssetType:
      description: Asset classification for portfolio resources.
      type: string
      enum:
        - fiat
        - crypto
        - xstock
        - stablecoin
        - equity
    Price:
      description: >-
        Price of one unit of an asset or instrument in the applicable quote
        units.
      type: string
      minLength: 1
      maxLength: 64
      pattern: ^[0-9]+(\.[0-9]+)?$
    Portfolio_PortfolioBalances:
      description: >-
        Asset balance and its value in the top-level portfolio quote, with
        optional breakdowns by account balance source. `main` includes balances
        used by spot trading and balances received from swaps; it is not a
        transaction-origin classification. `total` is the native-asset sum of
        all balance sources, and `total_in_quote` is the quoted value of that
        same total.
      type: object
      properties:
        total:
          description: >-
            Total balance across all sources in the asset's native display
            units.
          type: string
        total_in_quote:
          description: Value of the total balance in the top-level portfolio quote.
          type: string
        main:
          $ref: '#/components/schemas/Portfolio_PortfolioBalance'
        custody_pledged_collateral:
          $ref: '#/components/schemas/Portfolio_PortfolioBalance'
        custody_otc_trading:
          $ref: '#/components/schemas/Portfolio_PortfolioBalance'
        dual_currency_investment:
          $ref: '#/components/schemas/Portfolio_PortfolioBalance'
        custody_staking:
          $ref: '#/components/schemas/Portfolio_PortfolioBalance'
        kraken_launch:
          $ref: '#/components/schemas/Portfolio_PortfolioBalance'
      required:
        - total
    Portfolio_PortfolioHeldForOrders:
      description: Native asset amounts held for open orders.
      type: object
      properties:
        main:
          $ref: '#/components/schemas/Portfolio_PortfolioAmount'
        equities:
          $ref: '#/components/schemas/Portfolio_PortfolioAmount'
    Portfolio_PortfolioEarn:
      description: Earn balances grouped by strategy liquidity.
      type: object
      properties:
        locked:
          $ref: '#/components/schemas/Portfolio_PortfolioEarnBalance'
        flex:
          $ref: '#/components/schemas/Portfolio_PortfolioEarnBalance'
        hybrid:
          $ref: '#/components/schemas/Portfolio_PortfolioEarnBalance'
    Portfolio_PortfolioAssetAvailability:
      description: Asset amounts available for specific actions.
      type: object
      properties:
        trade:
          description: Amount available for trading, in the asset's native display units.
          type: string
        transfer:
          description: >-
            Amount available for internal transfer, in the asset's native
            display units.
          type: string
    Portfolio_PortfolioCreditLine:
      description: Credit usage and total limit. Remaining credit is limit minus used.
      type: object
      properties:
        used:
          $ref: '#/components/schemas/Portfolio_PortfolioAmount'
        limit:
          $ref: '#/components/schemas/Portfolio_PortfolioAmount'
    Portfolio_PortfolioAssetPnl:
      description: Per-asset average-cost-basis PnL in the top-level portfolio quote.
      type: object
      properties:
        reference_currency:
          $ref: '#/components/schemas/Portfolio_PnlReferenceCurrency'
        unrealized_in_quote:
          description: Lots-based unrealized PnL.
          type: string
        realized_in_quote:
          description: Realized PnL.
          type: string
        cost_basis_in_quote:
          description: Total value spent to acquire the current balance.
          type: string
        avg_entry_price_in_quote:
          $ref: '#/components/schemas/Price'
          description: Volume-weighted average acquisition price.
        status:
          $ref: '#/components/schemas/Portfolio_PnlProcessingStatus'
    PwsErrorCause:
      description: A single request validation failure.
      type: object
      required:
        - field
        - message
      properties:
        field:
          description: Dot-notation path to the offending request field.
          type: string
        message:
          description: Human-readable explanation of the failed validation rule.
          type: string
    PwsErrorBase:
      description: Common fields present on every PWS API error object.
      type: object
      required:
        - type
        - status
        - instance
        - code
      properties:
        type:
          description: Machine-readable error class.
          type: string
        status:
          description: HTTP status code returned for this error.
          type: integer
          format: int32
        instance:
          description: Request identifier for this specific error occurrence.
          type: string
        code:
          description: Stable machine-readable error code.
          type: string
        doc_url:
          description: Optional link to documentation for this error.
          type: string
          format: uri
    Portfolio_PnlProcessingState:
      description: >-
        Processing state for a PnL calculation. `ready` means the value is
        complete. `in_progress` means calculation is still running, and the
        corresponding value may be absent or not final.
      type: string
      enum:
        - ready
        - in_progress
    Portfolio_PortfolioBalance:
      description: Balance held in one account balance source.
      type: object
      properties:
        total:
          description: Balance in the asset's native display units.
          type: string
        total_in_quote:
          description: Value of the balance in the top-level portfolio quote.
          type: string
      required:
        - total
    Portfolio_PortfolioAmount:
      description: An amount in the asset's native display units.
      type: object
      properties:
        amount:
          description: Balance in the asset's native display units.
          type: string
      required:
        - amount
    Portfolio_PortfolioEarnBalance:
      description: >-
        Two views of the same earn total: lifecycle state and yield source. Do
        not add the lifecycle and yield-source breakdowns together.
      type: object
      properties:
        total:
          $ref: '#/components/schemas/Portfolio_PortfolioAmount'
        earning:
          $ref: '#/components/schemas/Portfolio_PortfolioAmount'
        bonding:
          $ref: '#/components/schemas/Portfolio_PortfolioAmount'
        unbonding:
          $ref: '#/components/schemas/Portfolio_PortfolioAmount'
        exit_queue:
          $ref: '#/components/schemas/Portfolio_PortfolioAmount'
        by_yield_source:
          $ref: '#/components/schemas/Portfolio_PortfolioEarnYieldSources'
    Portfolio_PortfolioEarnYieldSources:
      description: Earn total decomposed by yield source.
      type: object
      properties:
        staking:
          $ref: '#/components/schemas/Portfolio_PortfolioAmount'
        opt_in_rewards:
          $ref: '#/components/schemas/Portfolio_PortfolioAmount'
        base_rewards:
          $ref: '#/components/schemas/Portfolio_PortfolioAmount'
  parameters:
    AccountId:
      name: account_id
      in: path
      required: true
      example: WVSD33HRMGSZUBM7
      schema:
        $ref: '#/components/schemas/AccountId'
  headers:
    TraceId:
      description: Trace identifier for the request. Include it when contacting support.
      schema:
        type: string
        example: 4bf92f3577b34da6a3ce929d0e0e4736
    StrictTransportSecurity:
      description: Enforces HTTPS for the duration specified by `max-age`.
      schema:
        type: string
        example: max-age=31536000; includeSubDomains; preload
    CacheControl:
      description: Prevents caching of sensitive financial data. Always `no-store`.
      schema:
        type: string
        enum:
          - no-store
        example: no-store
  examples:
    portfolio-bad-request:
      summary: Invalid request
      value:
        error:
          type: portfolio_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 400
          code: bad_request
          causes:
            - field: account_id
              message: must be a valid account identifier
    portfolio-unauthenticated:
      summary: Authentication failed
      value:
        error:
          type: portfolio_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 401
          code: unauthenticated
    portfolio-forbidden:
      summary: Caller is not allowed
      value:
        error:
          type: portfolio_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 403
          code: forbidden
    portfolio-not-found:
      summary: Resource not found
      value:
        error:
          type: portfolio_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 404
          code: not_found
    portfolio-resource-exhausted:
      summary: Rate limit exceeded
      value:
        error:
          type: portfolio_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 429
          code: resource_exhausted
    portfolio-internal:
      summary: Internal server error
      value:
        error:
          type: portfolio_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 500
          code: internal
    portfolio-unimplemented:
      summary: Operation is not implemented
      value:
        error:
          type: portfolio_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 501
          code: unimplemented
    portfolio-unavailable:
      summary: Service unavailable
      value:
        error:
          type: portfolio_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 503
          code: unavailable
    portfolio-deadline-exceeded:
      summary: Request deadline exceeded
      value:
        error:
          type: portfolio_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 504
          code: deadline_exceeded
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: API-Key
      description: Your public API key. Identifies the partner making the request.
    ApiSign:
      type: apiKey
      in: header
      name: API-Sign
      description: HMAC signature over the request, computed with your private key.
    ApiNonce:
      type: apiKey
      in: header
      name: API-Nonce
      description: Monotonically increasing nonce included in the request signature.

````