> ## 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.

# Create quote

> Creates an account-funded quote.

The quote must be executed before `expires_at`. Expired quotes cannot be used.

Set `amount` on exactly one of `from` or `to`; the other side is calculated when the quote is created.



## OpenAPI

````yaml https://dsct1ci24fgcu.cloudfront.net/prod/merged/openapi.json post /v1/accounts/{account_id}/quotes
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.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: Earn
    description: >-
      Manage Auto Earn preferences and retrieve allocation and reward
      information.
    x-displayName: 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}/quotes:
    parameters:
      - $ref: '#/components/parameters/AccountId'
    post:
      tags:
        - Swaps
      summary: Create quote
      description: >-
        Creates an account-funded quote.


        The quote must be executed before `expires_at`. Expired quotes cannot be
        used.


        Set `amount` on exactly one of `from` or `to`; the other side is
        calculated when the quote is created.
      operationId: createQuote
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - from
                - to
              properties:
                from:
                  $ref: '#/components/schemas/Swaps_CreateQuoteFrom'
                to:
                  $ref: '#/components/schemas/Swaps_CreateQuoteTo'
                fee:
                  $ref: '#/components/schemas/Swaps_QuoteFee'
                  description: Optional partner fee applied to the quote.
            examples:
              buy-crypto-with-a-fixed-fiat-amount:
                summary: Buy crypto with a fixed fiat amount
                value:
                  from:
                    symbol: USD
                    type: fiat
                    amount: '100.00'
                  to:
                    symbol: ETH
                    type: crypto
              buy-a-fixed-amount-of-crypto:
                summary: Buy a fixed amount of crypto
                value:
                  from:
                    symbol: USD
                    type: fiat
                  to:
                    symbol: ETH
                    type: crypto
                    amount: '1'
      responses:
        '201':
          description: ''
          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
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/Swaps_Quote'
              examples:
                quote-ready-to-execute:
                  summary: Quote ready to execute
                  value:
                    data:
                      id: BQ5U74K-XV6GP-TTQ567
                      status: offered
                      expires_at: '2026-01-01T00:02:00Z'
                      from:
                        symbol: USD
                        type: fiat
                        amount: '3209.00'
                      to:
                        symbol: ETH
                        type: crypto
                        amount: '1'
                      fees:
                        trade:
                          symbol: USD
                          type: fiat
                          amount: '9.00'
                      rate:
                        base:
                          symbol: ETH
                          type: crypto
                        quote:
                          symbol: USD
                          type: fiat
                        price: '3200'
        '400':
          description: ''
          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:
                oneOf:
                  - $ref: '#/components/schemas/BadRequestError'
                  - $ref: '#/components/schemas/Swaps_QuoteAmountTooSmallError'
                  - $ref: '#/components/schemas/Swaps_QuoteAmountTooLargeError'
                  - $ref: >-
                      #/components/schemas/Swaps_QuoteAmountPrecisionTooHighError
                  - $ref: '#/components/schemas/Swaps_TotalMarginTooLowError'
                  - $ref: '#/components/schemas/Swaps_TotalMarginTooHighError'
              examples:
                quote-request-validation-failed:
                  $ref: '#/components/examples/swap-quote-validation'
                quote-amount-too-small:
                  $ref: '#/components/examples/swap-quote-amount-too-small'
                quote-amount-too-large:
                  $ref: '#/components/examples/swap-quote-amount-too-large'
                quote-amount-precision-too-high:
                  $ref: '#/components/examples/swap-quote-amount-precision-too-high'
                total-margin-too-low:
                  $ref: '#/components/examples/swap-total-margin-too-low'
                total-margin-too-high:
                  $ref: '#/components/examples/swap-total-margin-too-high'
        '401':
          $ref: '#/components/responses/SwapQuoteUnauthenticatedResponse'
        '403':
          description: ''
          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:
                oneOf:
                  - $ref: '#/components/schemas/ForbiddenError'
                  - $ref: '#/components/schemas/Swaps_TradeLockedError'
              examples:
                caller-is-not-allowed:
                  $ref: '#/components/examples/swap-quote-forbidden'
                trade-is-locked:
                  $ref: '#/components/examples/swap-quote-trade-locked'
        '409':
          description: ''
          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:
                oneOf:
                  - $ref: '#/components/schemas/Swaps_SellOnlyAssetError'
                  - $ref: '#/components/schemas/Swaps_FractionalExtendedHoursError'
                  - $ref: '#/components/schemas/Swaps_IpoAssetError'
                  - $ref: '#/components/schemas/Swaps_OtcRegularHoursOnlyError'
                  - $ref: '#/components/schemas/Swaps_OtcSellOnlyError'
                  - $ref: '#/components/schemas/Swaps_EquityMarketClosedError'
                  - $ref: '#/components/schemas/Swaps_IllegalOrderTypeAfterHoursError'
                  - $ref: '#/components/schemas/Swaps_InsufficientLiquidityError'
              examples:
                sell-only-asset:
                  $ref: '#/components/examples/swap-sell-only-asset'
                fractional-trading-during-extended-hours:
                  $ref: '#/components/examples/swap-fractional-extended-hours'
                ipo-asset:
                  $ref: '#/components/examples/swap-ipo-asset'
                otc-regular-hours-only:
                  $ref: '#/components/examples/swap-otc-regular-hours-only'
                otc-sell-only:
                  $ref: '#/components/examples/swap-otc-sell-only'
                equity-market-closed:
                  $ref: '#/components/examples/swap-equity-market-closed'
                illegal-order-type-after-hours:
                  $ref: '#/components/examples/swap-illegal-order-type-after-hours'
                insufficient-liquidity:
                  $ref: '#/components/examples/swap-quote-insufficient-liquidity'
        '429':
          $ref: '#/components/responses/SwapQuoteResourceExhaustedResponse'
        '500':
          $ref: '#/components/responses/SwapQuoteInternalResponse'
        '503':
          description: ''
          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/swap-quote-service-unavailable'
        '504':
          $ref: '#/components/responses/SwapQuoteDeadlineExceededResponse'
      security:
        - ApiKey: []
          ApiSign: []
          ApiNonce: []
components:
  parameters:
    AccountId:
      name: account_id
      in: path
      required: true
      example: WVSD33HRMGSZUBM7
      schema:
        $ref: '#/components/schemas/AccountId'
  schemas:
    Swaps_CreateQuoteFrom:
      description: >-
        Source side of a quote request. Set `amount` here when the source amount
        is fixed.
      type: object
      required:
        - symbol
        - type
      properties:
        symbol:
          $ref: '#/components/schemas/AssetSymbol'
          description: Source asset ticker symbol.
        type:
          $ref: '#/components/schemas/Swaps_AssetType'
          description: Classification of the source asset.
        amount:
          description: Decimal asset amount as a string to preserve precision.
          type: string
          maxLength: 32
          pattern: ^[0-9]+(\.[0-9]+)?$
    Swaps_CreateQuoteTo:
      description: >-
        Destination side of a quote request. Set `amount` here when the
        destination amount is fixed.
      type: object
      required:
        - symbol
        - type
      properties:
        symbol:
          $ref: '#/components/schemas/AssetSymbol'
          description: Destination asset ticker symbol.
        type:
          $ref: '#/components/schemas/Swaps_AssetType'
          description: Classification of the destination asset.
        amount:
          description: Decimal asset amount as a string to preserve precision.
          type: string
          maxLength: 32
          pattern: ^[0-9]+(\.[0-9]+)?$
    Swaps_QuoteFee:
      description: Partner fee applied to a quote.
      type: object
      properties:
        bps:
          description: Fee in basis points, where 1 bps is 0.01%.
          type: integer
          format: int32
          minimum: 0
          maximum: 10000
          default: 0
        absolute:
          description: Absolute fee amount in quote currency.
          type: string
          maxLength: 32
          pattern: ^[0-9]+(\.[0-9]+)?$
    Swaps_Quote:
      description: A priced swap quote. Execute it before `expires_at`.
      type: object
      required:
        - id
        - status
        - expires_at
        - from
        - to
        - fees
        - rate
      properties:
        id:
          description: Unique identifier for this quote.
          type: string
        status:
          $ref: '#/components/schemas/Swaps_QuoteStatus'
          description: Current lifecycle status of the quote.
        expires_at:
          $ref: '#/components/schemas/DateTime'
          description: Time at which this quote expires if it has not been executed.
        from:
          $ref: '#/components/schemas/Swaps_AssetAmount'
          description: Source asset and amount for the trade.
        to:
          $ref: '#/components/schemas/Swaps_AssetAmount'
          description: Destination asset and amount for the trade.
        fees:
          $ref: '#/components/schemas/Swaps_Fees'
          description: Fees charged for the quote.
        rate:
          $ref: '#/components/schemas/Swaps_Rate'
          description: Exchange rate applied to the quote.
    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
    Swaps_QuoteAmountTooSmallError:
      title: Quote Amount Too Small
      description: The requested quote amount is below the minimum supported amount.
      allOf:
        - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsGeneralError'
                - type: object
                  required:
                    - status
                    - code
                    - causes
                  properties:
                    status:
                      type: integer
                      format: int32
                      const: 400
                    code:
                      type: string
                      enum:
                        - quote_amount_too_small
                    causes:
                      type: array
                      minItems: 1
                      maxItems: 1
                      items:
                        $ref: '#/components/schemas/Swaps_QuoteAmountTooSmallCause'
    Swaps_QuoteAmountTooLargeError:
      title: Quote Amount Too Large
      description: The requested quote amount exceeds the maximum supported amount.
      allOf:
        - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsGeneralError'
                - type: object
                  required:
                    - status
                    - code
                    - causes
                  properties:
                    status:
                      type: integer
                      format: int32
                      const: 400
                    code:
                      type: string
                      enum:
                        - quote_amount_too_large
                    causes:
                      type: array
                      minItems: 1
                      maxItems: 1
                      items:
                        $ref: '#/components/schemas/Swaps_QuoteAmountTooLargeCause'
    Swaps_QuoteAmountPrecisionTooHighError:
      title: Quote Amount Precision Too High
      description: The requested quote amount has more decimal places than supported.
      allOf:
        - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsGeneralError'
                - type: object
                  required:
                    - status
                    - code
                    - causes
                  properties:
                    status:
                      type: integer
                      format: int32
                      const: 400
                    code:
                      type: string
                      enum:
                        - quote_amount_precision_too_high
                    causes:
                      type: array
                      minItems: 1
                      maxItems: 1
                      items:
                        $ref: >-
                          #/components/schemas/Swaps_QuoteAmountPrecisionTooHighCause
    Swaps_TotalMarginTooLowError:
      title: Total Margin Too Low
      description: The requested total margin is below the supported minimum.
      allOf:
        - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsGeneralError'
                - type: object
                  required:
                    - status
                    - code
                    - causes
                  properties:
                    status:
                      type: integer
                      format: int32
                      const: 400
                    code:
                      type: string
                      enum:
                        - total_margin_too_low
                    causes:
                      type: array
                      minItems: 1
                      maxItems: 1
                      items:
                        $ref: '#/components/schemas/Swaps_TotalMarginTooLowCause'
    Swaps_TotalMarginTooHighError:
      title: Total Margin Too High
      description: The requested total margin exceeds the supported maximum.
      allOf:
        - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsGeneralError'
                - type: object
                  required:
                    - status
                    - code
                    - causes
                  properties:
                    status:
                      type: integer
                      format: int32
                      const: 400
                    code:
                      type: string
                      enum:
                        - total_margin_too_high
                    causes:
                      type: array
                      minItems: 1
                      maxItems: 1
                      items:
                        $ref: '#/components/schemas/Swaps_TotalMarginTooHighCause'
    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
    Swaps_TradeLockedError:
      title: Trade Locked
      description: The trade cannot proceed because the source or destination is locked.
      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:
                        - trade_locked
    Swaps_SellOnlyAssetError:
      title: Sell Only Asset
      description: The destination asset is currently sell-only and cannot be acquired.
      allOf:
        - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsGeneralError'
                - type: object
                  required:
                    - status
                    - code
                    - causes
                  properties:
                    status:
                      type: integer
                      format: int32
                      const: 409
                    code:
                      type: string
                      enum:
                        - sell_only_asset
                    causes:
                      type: array
                      minItems: 1
                      maxItems: 32
                      description: One cause for each asset that is currently sell-only.
                      items:
                        $ref: '#/components/schemas/Swaps_SellOnlyAssetCause'
    Swaps_FractionalExtendedHoursError:
      title: Fractional Extended Hours
      description: Fractional equity trading is unavailable outside regular market hours.
      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: 409
                    code:
                      type: string
                      enum:
                        - fractional_extended_hours
    Swaps_IpoAssetError:
      title: IPO Asset
      description: >-
        The asset cannot be traded while it is in its initial public offering
        period.
      allOf:
        - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsGeneralError'
                - type: object
                  required:
                    - status
                    - code
                    - causes
                  properties:
                    status:
                      type: integer
                      format: int32
                      const: 409
                    code:
                      type: string
                      enum:
                        - ipo_asset
                    causes:
                      type: array
                      minItems: 1
                      maxItems: 1
                      items:
                        $ref: '#/components/schemas/Swaps_IpoAssetCause'
    Swaps_OtcRegularHoursOnlyError:
      title: OTC Regular Hours Only
      description: The OTC asset can only be traded during regular market hours.
      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: 409
                    code:
                      type: string
                      enum:
                        - otc_regular_hours_only
    Swaps_OtcSellOnlyError:
      title: OTC Sell Only
      description: The OTC asset is currently sell-only and cannot be acquired.
      allOf:
        - $ref: '#/components/schemas/PwsGeneralErrorEnvelope'
        - type: object
          required:
            - error
          properties:
            error:
              allOf:
                - $ref: '#/components/schemas/PwsGeneralError'
                - type: object
                  required:
                    - status
                    - code
                    - causes
                  properties:
                    status:
                      type: integer
                      format: int32
                      const: 409
                    code:
                      type: string
                      enum:
                        - otc_sell_only
                    causes:
                      type: array
                      minItems: 1
                      maxItems: 1
                      items:
                        $ref: '#/components/schemas/Swaps_OtcSellOnlyCause'
    Swaps_EquityMarketClosedError:
      title: Equity Market Closed
      description: The equity market is closed and the trade cannot be submitted.
      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: 409
                    code:
                      type: string
                      enum:
                        - equity_market_closed
    Swaps_IllegalOrderTypeAfterHoursError:
      title: Illegal Order Type After Hours
      description: The requested order type is unavailable outside regular market hours.
      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: 409
                    code:
                      type: string
                      enum:
                        - illegal_order_type_after_hours
    Swaps_InsufficientLiquidityError:
      title: Insufficient Liquidity
      description: The requested trade cannot be quoted because liquidity is insufficient.
      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: 409
                    code:
                      type: string
                      enum:
                        - insufficient_liquidity
    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
    AccountId:
      description: Globally unique public identifier for an account.
      type: string
      minLength: 14
      maxLength: 42
    AssetSymbol:
      description: Symbol identifying an asset within its asset category.
      type: string
      minLength: 1
      maxLength: 16
    Swaps_AssetType:
      description: Asset classifications currently supported by Swap trading endpoints.
      type: string
      enum:
        - fiat
        - crypto
        - xstock
        - stablecoin
    Swaps_QuoteStatus:
      description: >-
        Current lifecycle status of a quote. `offered` quotes can be executed;
        `executed`, `expired`, and `failed` are final states.
      type: string
      enum:
        - offered
        - executing
        - executed
        - expired
        - failed
        - pending
    DateTime:
      description: RFC 3339 timestamp.
      type: string
      format: date-time
    Swaps_AssetAmount:
      description: An asset and the decimal amount denominated in that asset.
      type: object
      required:
        - symbol
        - type
        - amount
      properties:
        symbol:
          description: Asset ticker symbol, such as BTC, USD, or TSLAx.
          type: string
        type:
          $ref: '#/components/schemas/Swaps_AssetType'
          description: Classification of the asset.
        amount:
          description: Decimal amount as a string to preserve precision.
          type: string
    Swaps_Fees:
      description: Breakdown of all fees charged for a quote or executed swap.
      type: object
      required:
        - trade
      properties:
        trade:
          $ref: '#/components/schemas/Swaps_Fee'
          description: Trading fee charged for the quote or executed swap.
    Swaps_Rate:
      description: Exchange rate applied to a quote or executed price-triggered swap.
      type: object
      required:
        - base
        - quote
        - price
      properties:
        base:
          $ref: '#/components/schemas/Swaps_AssetRef'
          description: Base asset of the rate pair.
        quote:
          $ref: '#/components/schemas/Swaps_AssetRef'
          description: Quote asset of the rate pair.
        price:
          $ref: '#/components/schemas/Price'
          description: Price of one unit of the base asset denominated in the quote asset.
    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
    Swaps_QuoteAmountTooSmallCause:
      description: Details about a quote amount that is below the supported minimum.
      type: object
      required:
        - field
        - message
        - symbol
        - minimum
      properties:
        field:
          description: Dot-notation path to the affected request field.
          type: string
        message:
          description: Human-readable explanation of the rejected amount.
          type: string
        symbol:
          type: string
          minLength: 1
          maxLength: 64
          pattern: ^[-A-Za-z0-9._/]+$
          description: Asset symbol whose requested amount is below the supported minimum.
        minimum:
          type: string
          minLength: 1
          maxLength: 128
          pattern: ^[0-9]+(\.[0-9]+)?$
          description: Minimum supported amount, denominated in `symbol`.
    Swaps_QuoteAmountTooLargeCause:
      description: Details about a quote amount that exceeds the supported maximum.
      type: object
      required:
        - field
        - message
        - symbol
        - maximum
      properties:
        field:
          description: Dot-notation path to the affected request field.
          type: string
        message:
          description: Human-readable explanation of the rejected amount.
          type: string
        symbol:
          type: string
          minLength: 1
          maxLength: 64
          pattern: ^[-A-Za-z0-9._/]+$
          description: Asset symbol whose requested amount exceeds the supported maximum.
        maximum:
          type: string
          minLength: 1
          maxLength: 128
          pattern: ^[0-9]+(\.[0-9]+)?$
          description: Maximum supported amount, denominated in `symbol`.
    Swaps_QuoteAmountPrecisionTooHighCause:
      description: Details about a quote amount with more decimal places than supported.
      type: object
      required:
        - field
        - message
        - precision
        - maximum_precision
      properties:
        field:
          description: Dot-notation path to the affected request field.
          type: string
        message:
          description: Human-readable explanation of the rejected amount precision.
          type: string
        precision:
          description: Number of decimal places in the requested amount.
          type: integer
          format: int32
          minimum: 0
        maximum_precision:
          description: Maximum number of decimal places supported for the requested amount.
          type: integer
          format: int32
          minimum: 0
    Swaps_TotalMarginTooLowCause:
      description: Details about a requested total margin below the supported minimum.
      type: object
      required:
        - field
        - message
        - requested_margin_bps
        - minimum_margin_bps
      properties:
        field:
          description: Dot-notation path to the affected request field.
          type: string
        message:
          description: Human-readable explanation of the rejected margin.
          type: string
        requested_margin_bps:
          type: string
          minLength: 1
          maxLength: 128
          pattern: ^[+-]?[0-9]+(\.[0-9]+)?$
          description: >-
            Requested total margin in basis points, represented as a decimal
            string.
        minimum_margin_bps:
          type: string
          minLength: 1
          maxLength: 128
          pattern: ^[+-]?[0-9]+(\.[0-9]+)?$
          description: >-
            Minimum supported total margin in basis points, represented as a
            decimal string.
    Swaps_TotalMarginTooHighCause:
      description: Details about a requested total margin above the supported maximum.
      type: object
      required:
        - field
        - message
        - requested_margin_bps
        - maximum_margin_bps
      properties:
        field:
          description: Dot-notation path to the affected request field.
          type: string
        message:
          description: Human-readable explanation of the rejected margin.
          type: string
        requested_margin_bps:
          type: string
          minLength: 1
          maxLength: 128
          pattern: ^[+-]?[0-9]+(\.[0-9]+)?$
          description: >-
            Requested total margin in basis points, represented as a decimal
            string.
        maximum_margin_bps:
          type: string
          minLength: 1
          maxLength: 128
          pattern: ^[+-]?[0-9]+(\.[0-9]+)?$
          description: >-
            Maximum supported total margin in basis points, represented as a
            decimal string.
    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
    Swaps_SellOnlyAssetCause:
      description: Details about one asset that is currently sell-only.
      type: object
      required:
        - field
        - message
        - symbol
      properties:
        field:
          description: Dot-notation path to the affected asset symbol.
          type: string
        message:
          description: Human-readable explanation of the trading restriction.
          type: string
        symbol:
          type: string
          minLength: 1
          maxLength: 64
          pattern: ^[-A-Za-z0-9._/]+$
          description: Symbol of an asset that is currently sell-only.
    Swaps_IpoAssetCause:
      description: Details about an asset in its initial public offering period.
      type: object
      required:
        - field
        - message
        - symbol
      properties:
        field:
          description: Dot-notation path to the affected asset symbol.
          type: string
        message:
          description: Human-readable explanation of the trading restriction.
          type: string
        symbol:
          type: string
          minLength: 1
          maxLength: 64
          pattern: ^[-A-Za-z0-9._/]+$
          description: Symbol of the asset in its initial public offering period.
    Swaps_OtcSellOnlyCause:
      description: Details about an OTC asset that is currently sell-only.
      type: object
      required:
        - field
        - message
        - symbol
      properties:
        field:
          description: Dot-notation path to the affected asset symbol.
          type: string
        message:
          description: Human-readable explanation of the trading restriction.
          type: string
        symbol:
          type: string
          minLength: 1
          maxLength: 64
          pattern: ^[-A-Za-z0-9._/]+$
          description: Symbol of the OTC asset that is currently sell-only.
    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
    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
    Swaps_Fee:
      description: A single fee charged against a quote or executed swap.
      type: object
      required:
        - symbol
        - type
        - amount
      properties:
        symbol:
          description: Asset ticker symbol the fee is denominated in.
          type: string
        type:
          $ref: '#/components/schemas/Swaps_AssetType'
          description: Classification of the fee asset.
        amount:
          description: Fee amount as a decimal string.
          type: string
    Swaps_AssetRef:
      description: Reference to an asset by ticker symbol and classification.
      type: object
      required:
        - symbol
        - type
      properties:
        symbol:
          description: Asset ticker symbol, such as BTC, USD, or TSLAx.
          type: string
        type:
          $ref: '#/components/schemas/Swaps_AssetType'
          description: Classification of the asset.
    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]+)?$
    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
  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:
    swap-quote-validation:
      summary: Quote request validation failed
      value:
        error:
          type: quote_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 400
          code: bad_request
          causes:
            - field: amount
              message: >-
                Exactly one of from.amount or to.amount must be set, but both
                were provided
    swap-quote-amount-too-small:
      summary: Quote amount is below the minimum
      value:
        error:
          type: quote_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 400
          code: quote_amount_too_small
          causes:
            - field: amount
              message: Requested amount is below the supported minimum.
              symbol: USD
              minimum: '10.00'
    swap-quote-amount-too-large:
      summary: Quote amount exceeds the maximum
      value:
        error:
          type: quote_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 400
          code: quote_amount_too_large
          causes:
            - field: amount
              message: Requested amount exceeds the supported maximum.
              symbol: USD
              maximum: '100000.00'
    swap-quote-amount-precision-too-high:
      summary: Quote amount has too many decimal places
      value:
        error:
          type: quote_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 400
          code: quote_amount_precision_too_high
          causes:
            - field: amount
              message: Requested amount precision exceeds the supported maximum.
              precision: 4
              maximum_precision: 2
    swap-total-margin-too-low:
      summary: Requested margin is below the minimum
      value:
        error:
          type: quote_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 400
          code: total_margin_too_low
          causes:
            - field: fee
              message: Requested total margin is below the supported minimum.
              requested_margin_bps: '50'
              minimum_margin_bps: '100'
    swap-total-margin-too-high:
      summary: Requested margin exceeds the maximum
      value:
        error:
          type: quote_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 400
          code: total_margin_too_high
          causes:
            - field: fee
              message: Requested total margin exceeds the supported maximum.
              requested_margin_bps: '2549'
              maximum_margin_bps: '1000'
    swap-quote-forbidden:
      summary: Caller is not allowed
      value:
        error:
          type: quote_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 403
          code: forbidden
    swap-quote-trade-locked:
      summary: Trade is locked
      value:
        error:
          type: quote_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 403
          code: trade_locked
    swap-sell-only-asset:
      summary: Asset is sell-only
      value:
        error:
          type: quote_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 409
          code: sell_only_asset
          causes:
            - field: symbol
              message: The asset is currently sell-only.
              symbol: TSLAx
    swap-fractional-extended-hours:
      summary: Fractional trading is unavailable during extended hours
      value:
        error:
          type: quote_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 409
          code: fractional_extended_hours
    swap-ipo-asset:
      summary: Asset is in its initial public offering period
      value:
        error:
          type: quote_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 409
          code: ipo_asset
          causes:
            - field: symbol
              message: The asset is in its initial public offering period.
              symbol: TSLAx
    swap-otc-regular-hours-only:
      summary: OTC asset can only be traded during regular market hours
      value:
        error:
          type: quote_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 409
          code: otc_regular_hours_only
    swap-otc-sell-only:
      summary: OTC asset is sell-only
      value:
        error:
          type: quote_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 409
          code: otc_sell_only
          causes:
            - field: symbol
              message: The OTC asset is currently sell-only.
              symbol: ABC
    swap-equity-market-closed:
      summary: Equity market is closed
      value:
        error:
          type: quote_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 409
          code: equity_market_closed
    swap-illegal-order-type-after-hours:
      summary: Order type is unavailable outside regular market hours
      value:
        error:
          type: quote_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 409
          code: illegal_order_type_after_hours
    swap-quote-insufficient-liquidity:
      summary: Insufficient liquidity
      value:
        error:
          type: quote_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 409
          code: insufficient_liquidity
    swap-quote-service-unavailable:
      summary: Service unavailable
      value:
        error:
          type: quote_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 503
          code: unavailable
    swap-quote-unauthenticated:
      summary: Authentication failed
      value:
        error:
          type: quote_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 401
          code: unauthenticated
    swap-quote-resource-exhausted:
      summary: Rate limit exceeded
      value:
        error:
          type: quote_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 429
          code: resource_exhausted
    swap-quote-internal:
      summary: Internal error
      value:
        error:
          type: quote_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 500
          code: internal
    swap-quote-deadline-exceeded:
      summary: Request deadline exceeded
      value:
        error:
          type: quote_error
          instance: 5f4d2a8e-91a4-4d6c-8a17-9b1e2c3f4a5b
          status: 504
          code: deadline_exceeded
  responses:
    SwapQuoteUnauthenticatedResponse:
      description: ''
      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/swap-quote-unauthenticated'
    SwapQuoteResourceExhaustedResponse:
      description: ''
      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/swap-quote-resource-exhausted'
    SwapQuoteInternalResponse:
      description: ''
      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/swap-quote-internal'
    SwapQuoteDeadlineExceededResponse:
      description: ''
      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/swap-quote-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.

````