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

# List orders

> List orders for a specific account.

**US offering:** Orders are returned newest first, by `created_at` for open orders and `closed_at` for closed orders.

**International/EEA offering:** Orders are returned by `created_at`, newest first.

Keep the same account and filters between pages. Continue while `next_page_token` is present.



## OpenAPI

````yaml https://d2588n1sy4m36o.cloudfront.net/uat/merged/openapi.json?mintlify-view=derivatives get /v1/accounts/{account_id}/orders
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: Derivatives transfers
    description: >-
      Move funds between an account's spot balance and the same owner's futures
      balance.
    x-displayName: Derivatives 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: Market data stream
    description: Live market data for derivatives instruments.
    x-displayName: Market data stream
  - name: Derivatives instruments
    description: Discover instruments available for trading by asset type.
    x-displayName: Derivatives instruments
  - name: Derivatives tickers
    x-group: Derivatives market data
    description: Read market-data snapshots for supported trading instruments.
    x-displayName: Derivatives tickers
  - name: Derivatives order books
    x-group: Derivatives market data
    description: Read level-two market depth for supported trading instruments.
    x-displayName: Derivatives order books
  - name: Derivatives OHLC
    x-group: Derivatives market data
    description: Read historical candlestick market data for supported trading instruments.
    x-displayName: Derivatives OHLC
  - name: Derivatives orders
    description: Submit and inspect orders by asset type.
    x-displayName: Derivatives orders
  - name: Derivatives trades
    description: Inspect executions by asset type.
    x-displayName: Derivatives trades
  - name: Derivatives leverage
    description: Read and update per-instrument leverage preferences for trading accounts.
    x-displayName: Derivatives leverage
  - 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.


      In webhook payloads, `account_id` and `user_id` are in groups of four
      characters, with a space between the groups. For example, `WCQY T95Y CUL2
      A7NX`. The REST APIs send the same identifier without spaces, for example
      `WCQYT95YCUL2A7NX`. Remove the spaces before you compare a webhook
      identifier with a REST identifier.


      Amounts in webhook payloads are decimal strings, in the ledger precision
      of the asset. Compare amounts as decimal numbers, not as strings.
    x-displayName: Webhooks
paths:
  /v1/accounts/{account_id}/orders:
    servers:
      - url: https://api.sandbox.services.payward.com
    parameters:
      - $ref: '#/components/parameters/AccountId'
    get:
      tags:
        - Derivatives orders
      summary: List orders
      description: >-
        List orders for a specific account.


        **US offering:** Orders are returned newest first, by `created_at` for
        open orders and `closed_at` for closed orders.


        **International/EEA offering:** Orders are returned by `created_at`,
        newest first.


        Keep the same account and filters between pages. Continue while
        `next_page_token` is present.
      operationId: listOrders
      parameters:
        - $ref: '#/components/parameters/TradingOrders_AssetTypeFilter'
        - $ref: '#/components/parameters/TradingOrders_PageSize'
        - $ref: '#/components/parameters/PageToken'
        - $ref: '#/components/parameters/TradingOrders_ClientOrderIdFilter'
        - in: query
          name: symbol
          description: |-
            **Available only for the International/EEA offering.**

            Filter orders by instrument symbol, ignoring case.
          example: PF_XBTUSD
          schema:
            type: string
            minLength: 1
            maxLength: 64
            pattern: ^\S+$
            example: PF_XBTUSD
        - in: query
          name: state
          example: closed
          schema:
            $ref: '#/components/schemas/TradingOrders_OrderCollectionState'
            example: closed
        - in: query
          name: start_timestamp
          description: >-
            Exclusive lower bound for the order closing time. Rejected unless
            `state=closed`. Sub-millisecond values are rejected. Must not be
            later than `end_timestamp`.
          example: '2026-08-01T00:00:00.123Z'
          schema:
            $ref: '#/components/schemas/DateTime'
            example: '2026-08-01T00:00:00.123Z'
        - in: query
          name: end_timestamp
          description: >-
            Inclusive upper bound for the order closing time. Rejected unless
            `state=closed`. Sub-millisecond values are rejected.
          example: '2026-10-01T00:00:00.456Z'
          schema:
            $ref: '#/components/schemas/DateTime'
            example: '2026-10-01T00:00:00.456Z'
      responses:
        '200':
          description: Orders for the selected asset type.
          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:
                    description: >-
                      Orders matching the selected state and filters. The `data`
                      array is empty if none match.
                    type: array
                    items:
                      $ref: '#/components/schemas/TradingOrders_Order'
                  next_page_token:
                    description: >-
                      Opaque token for retrieving the next page. Absent when
                      there are no more results.
                    type: string
                    minLength: 1
                    maxLength: 256
              examples:
                us-derivatives-open:
                  value:
                    data:
                      - asset_type: perpetual
                        id: FOPCDC6-PQIPJ-JLEIRY
                        symbol: PBTCUCZ0.BTNL
                        side: buy
                        type: limit
                        status: open
                        quantity: '2'
                        filled_quantity: '1'
                        limit_price: '66290'
                        notional: '662.9'
                        fee: '1.05'
                        time_in_force: gtc
                        created_at: '2026-08-03T10:00:00Z'
                        updated_at: '2026-08-03T10:00:01Z'
                        average_execution_price: '66290'
                international-eea-derivatives-open:
                  value:
                    data:
                      - asset_type: perpetual
                        id: 4ef5cfda-11cb-546a-bdf6-92a426113261
                        client_order_id: 4ce0941f-0ca5-46b1-8285-011e18e0b051
                        symbol: PF_XBTUSD
                        side: sell
                        type: limit
                        status: open
                        quantity: '0.01'
                        filled_quantity: '0'
                        limit_price: '85000'
                        fee: '0'
                        time_in_force: gtc
                        created_at: '2026-09-01T10:43:00.260Z'
                        updated_at: '2026-09-01T10:43:00.260Z'
                        reduce_only: false
                        post_only: true
                us-derivatives-closed:
                  value:
                    data:
                      - asset_type: perpetual
                        id: FOPCDC6-PQIPJ-JLEIRY
                        symbol: PBTCUCZ0.BTNL
                        side: buy
                        type: limit
                        status: closed
                        quantity: '2'
                        filled_quantity: '2'
                        limit_price: '66290'
                        notional: '1325.8'
                        fee: '2.10'
                        time_in_force: gtc
                        created_at: '2026-08-03T10:00:00Z'
                        updated_at: '2026-08-03T10:00:02Z'
                        close_reason: Order closed
                        average_execution_price: '66290'
                        closed_at: '2026-08-03T10:00:02Z'
                international-eea-derivatives-closed:
                  value:
                    data:
                      - asset_type: perpetual
                        id: 04da4904-1936-55a2-b66d-921ae04b183c
                        client_order_id: 550e8400-e29b-41d4-a716-446655440000
                        symbol: PF_XBTUSD
                        side: sell
                        type: stop_loss
                        status: cancelled
                        quantity: '0.01'
                        filled_quantity: '0'
                        trigger_price: '70000'
                        fee: '0'
                        time_in_force: gtc
                        created_at: '2026-09-01T10:43:45.547Z'
                        updated_at: '2026-09-01T10:44:45.547Z'
                        close_reason: 'Order cancelled: cancelled by user'
                        closed_at: '2026-09-01T10:44:45.547Z'
                        reduce_only: true
                        post_only: false
                      - asset_type: perpetual
                        id: 4ef5cfda-11cb-546a-bdf6-92a426113261
                        client_order_id: 4ce0941f-0ca5-46b1-8285-011e18e0b051
                        symbol: PF_XBTUSD
                        side: sell
                        type: limit
                        status: cancelled
                        quantity: '0.01'
                        filled_quantity: '0'
                        limit_price: '85000'
                        fee: '0'
                        time_in_force: gtc
                        created_at: '2026-09-01T10:43:00.260Z'
                        updated_at: '2026-09-01T10:44:00.260Z'
                        close_reason: 'Order cancelled: cancelled by user'
                        closed_at: '2026-09-01T10:44:00.260Z'
                        reduce_only: false
                        post_only: true
                    next_page_token: >-
                      CAEQAjIoMDZkNTY1YTUtNzI0YS00ZTVjLWFjMjItZjQ5NmRmYWQyMThkShDq7hK2bWVFYCVpyZ9LYsT3
                international-eea-derivatives-filled:
                  value:
                    data:
                      - asset_type: perpetual
                        id: a304ab5b-a8c5-480d-b362-ff15618c16dd
                        client_order_id: 2c720eb1-dd03-4ae9-8703-e8db904e520a
                        symbol: PF_XBTUSD
                        side: sell
                        type: market
                        status: closed
                        quantity: '0.0001'
                        filled_quantity: '0.0001'
                        notional: '8.2803'
                        fee: '0.0018630675'
                        created_at: '2026-10-19T10:08:21.075Z'
                        updated_at: '2026-10-19T10:08:21.075Z'
                        close_reason: Order filled
                        average_execution_price: '82803'
                        closed_at: '2026-10-19T10:08:21.075Z'
                        reduce_only: false
                        post_only: false
                no-matching-orders:
                  value:
                    data: []
        '400':
          description: >-
            The account, asset type, state, symbol, client order ID, time
            filters, or pagination values are invalid.
          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:
                gateway-validation-failed:
                  value:
                    error:
                      type: service_error
                      status: 400
                      instance: 4bf92f3577b34da6a3ce929d0e0e4736
                      code: gateway
                invalid-client-order-id:
                  value:
                    error:
                      type: derivatives_error
                      status: 400
                      instance: 4bf92f3577b34da6a3ce929d0e0e4736
                      code: bad_request
                      causes:
                        - field: client_order_id
                          message: must be a valid UUID
                us-symbol-filter-not-supported:
                  value:
                    error:
                      type: derivatives_error
                      status: 400
                      instance: 4bf92f3577b34da6a3ce929d0e0e4736
                      code: bad_request
                      causes:
                        - field: symbol
                          message: >-
                            Filtering orders by symbol is not supported for this
                            offering.
                invalid-page-token:
                  value:
                    error:
                      type: derivatives_error
                      status: 400
                      instance: 4bf92f3577b34da6a3ce929d0e0e4736
                      code: bad_request
                      causes:
                        - field: page_token
                          message: The page token is invalid for this collection.
                invalid-time-range:
                  value:
                    error:
                      type: derivatives_error
                      status: 400
                      instance: 4bf92f3577b34da6a3ce929d0e0e4736
                      code: bad_request
                      causes:
                        - field: start_timestamp
                          message: >-
                            The start timestamp must be earlier than or equal to
                            the end timestamp.
        '401':
          description: Authentication failed.
          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/spot-derivatives-unauthenticated'
                gateway-authentication-failed:
                  $ref: >-
                    #/components/examples/spot-derivatives-gateway-unauthenticated
        '403':
          description: The caller is not allowed to perform this operation.
          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:
                access-denied:
                  $ref: '#/components/examples/spot-derivatives-forbidden'
                gateway-access-denied:
                  $ref: '#/components/examples/spot-derivatives-gateway-forbidden'
        '429':
          description: The request was rate limited.
          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/spot-derivatives-resource-exhausted'
        '500':
          description: An unexpected server-side error occurred.
          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/spot-derivatives-internal'
        '503':
          description: >-
            The order list is temporarily unavailable. This can also occur when
            the account cannot be matched to its order history.
          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/spot-derivatives-unavailable'
        '504':
          description: The request deadline elapsed.
          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/spot-derivatives-deadline-exceeded'
      security:
        - ApiKey: []
          ApiSign: []
          ApiTimestamp: []
      x-codeSamples:
        - lang: bash
          label: Active orders
          source: |
            curl --request GET \
              --url 'https://api.sandbox.services.payward.com/v1/accounts/WVSD33HRMGSZUBM7/orders?asset_type=perpetual&page_size=20&state=open' \
              --header "API-Key: $PWS_API_KEY" \
              --header "API-Timestamp: $PWS_API_TIMESTAMP" \
              --header "API-Sign: $PWS_API_SIGN"
        - lang: bash
          label: Order history
          source: |
            curl --request GET \
              --url 'https://api.sandbox.services.payward.com/v1/accounts/WVSD33HRMGSZUBM7/orders?asset_type=perpetual&page_size=20&state=closed&start_timestamp=2026-08-01T00:00:00Z&end_timestamp=2026-10-01T00:00:00Z' \
              --header "API-Key: $PWS_API_KEY" \
              --header "API-Timestamp: $PWS_API_TIMESTAMP" \
              --header "API-Sign: $PWS_API_SIGN"
        - lang: bash
          label: Next page of order history
          source: |
            curl --request GET \
              --url "https://api.sandbox.services.payward.com/v1/accounts/WVSD33HRMGSZUBM7/orders?asset_type=perpetual&page_token=$NEXT_PAGE_TOKEN&state=closed&start_timestamp=2026-08-01T00:00:00Z&end_timestamp=2026-10-01T00:00:00Z" \
              --header "API-Key: $PWS_API_KEY" \
              --header "API-Timestamp: $PWS_API_TIMESTAMP" \
              --header "API-Sign: $PWS_API_SIGN"
        - lang: bash
          label: Order history by symbol (International/EEA)
          source: |
            curl --request GET \
              --url 'https://api.sandbox.services.payward.com/v1/accounts/WVSD33HRMGSZUBM7/orders?asset_type=perpetual&state=closed&symbol=PF_XBTUSD&page_size=20' \
              --header "API-Key: $PWS_API_KEY" \
              --header "API-Timestamp: $PWS_API_TIMESTAMP" \
              --header "API-Sign: $PWS_API_SIGN"
components:
  parameters:
    AccountId:
      name: account_id
      in: path
      required: true
      example: WVSD33HRMGSZUBM7
      schema:
        $ref: '#/components/schemas/AccountId'
    TradingOrders_AssetTypeFilter:
      name: asset_type
      in: query
      required: false
      example: perpetual
      schema:
        $ref: '#/components/schemas/TradingOrders_AssetType'
        default: perpetual
        example: perpetual
    TradingOrders_PageSize:
      name: page_size
      in: query
      description: >-
        Maximum number of results to return. Ignored when `page_token` is
        present.
      required: false
      style: form
      example: 20
      schema:
        type: integer
        format: int32
        minimum: 1
        maximum: 100
        default: 20
        example: 20
    PageToken:
      name: page_token
      in: query
      description: >-
        Opaque token returned as `next_page_token` in the previous response.
        Omit to request the first page.
      required: false
      schema:
        type: string
        minLength: 1
        maxLength: 256
      style: form
      example: MjoyRHuBXSgoe0mDHt-iFALROW46EGdvk_trgja31Vwr7H4
    TradingOrders_ClientOrderIdFilter:
      name: client_order_id
      in: query
      description: >-
        **Available for the International/EEA offering.**


        Filter by the reference supplied when creating an order. Use a
        lowercase, hyphenated UUID. Reused references can match multiple orders
        and fills. Other filters still apply.
      required: false
      example: 550e8400-e29b-41d4-a716-446655440000
      schema:
        $ref: '#/components/schemas/TradingOrders_ClientOrderId'
        example: 550e8400-e29b-41d4-a716-446655440000
  schemas:
    TradingOrders_OrderCollectionState:
      description: |
        Choose which orders to return:

        - `open`: Active orders with `status` of `pending`, `open`, or
          `pending_cancel`. Includes partially filled orders that remain open.
        - `closed`: Orders that are no longer active, with `status` of `closed`,
          `cancelled`, or `expired`.
      type: string
      enum:
        - open
        - closed
      default: open
    DateTime:
      description: RFC 3339 timestamp.
      type: string
      format: date-time
    TradingOrders_Order:
      description: >-
        An order and its current execution status.


        `reduce_only` and `post_only` are omitted when their values are
        unavailable.
      type: object
      required:
        - asset_type
        - id
        - symbol
        - side
        - type
        - status
        - filled_quantity
        - created_at
        - updated_at
      properties:
        asset_type:
          $ref: '#/components/schemas/TradingOrders_AssetType'
          example: perpetual
        id:
          description: Server-issued order identifier.
          type: string
          example: FOPCDC6-PQIPJ-JLEIRY
        client_order_id:
          description: >-
            **Available for the International/EEA offering.**


            Partner-provided order reference, shared by all fills. Omitted when
            unavailable.
          type: string
          minLength: 1
          maxLength: 64
          example: 550e8400-e29b-41d4-a716-446655440000
        symbol:
          description: Instrument symbol.
          type: string
          example: PBTCUCZ0.BTNL
        side:
          $ref: '#/components/schemas/TradingOrders_OrderSide'
          example: buy
        type:
          $ref: '#/components/schemas/TradingOrders_OrderType'
          example: limit
        status:
          $ref: '#/components/schemas/TradingOrders_OrderStatus'
          example: closed
        quantity:
          description: >-
            Order quantity, in contracts. The US offering uses whole numbers.
            Omitted when the quantity is determined at trigger activation.
          type: string
          example: '2'
        filled_quantity:
          description: Quantity executed so far, in the same units as `quantity`.
          type: string
          example: '2'
        limit_price:
          $ref: '#/components/schemas/Price'
          description: Limit price, when applicable. Omitted for market orders.
          example: '66290'
        trigger_price:
          $ref: '#/components/schemas/Price'
          description: Trigger price, when applicable.
          example: '65000'
        notional:
          description: >-
            Total value executed so far for the order, in the instrument's quote
            asset and excluding fees. For partially filled orders, includes only
            the filled quantity.


            The calculation includes the instrument's `contract_size`, which
            specifies how much of the base asset each contract represents. For
            example, 2 contracts of 0.01 BTC each, filled at USD 80,000 per BTC,
            have a notional value of USD 1,600.


            **US offering:** Historical orders use the current contract size.


            Omitted when unavailable.
          type: string
          minLength: 1
          maxLength: 256
          pattern: ^[0-9]+(\.[0-9]+)?$
          example: '1325.8'
        fee:
          description: >-
            Total fees across all fills of the order so far, in the instrument's
            quote asset. Excludes funding payments. A negative value is a
            rebate. Omitted when unavailable.
          type: string
          example: '2.10'
        time_in_force:
          $ref: '#/components/schemas/TradingOrders_TimeInForce'
          description: >-
            Execution and duration policy. For the International/EEA offering,
            non-market orders return `gtc`; market orders omit this field.
          example: gtc
        created_at:
          description: Time the order was created.
          type: string
          format: date-time
          example: '2026-08-03T10:00:00Z'
        updated_at:
          description: Time the order was last updated.
          type: string
          format: date-time
          example: '2026-08-03T10:00:02Z'
        expire_time:
          description: |-
            **Available only for the US offering.**

            Scheduled expiry time for a `gtd` order, when available.
          type: string
          format: date-time
          example: '2027-06-30T16:00:00Z'
        close_reason:
          description: >-
            Explanation of why the order was closed. Returned when an order is
            filled, canceled, expires, is rejected, or trigger activation fails.
            Omitted while the order is active.
          type: string
          example: Order closed
        average_execution_price:
          $ref: '#/components/schemas/Price'
          description: >-
            Volume-weighted average execution price of the filled quantity,
            excluding fees. Omitted when nothing has filled or the price is
            unavailable.
          example: '66290'
        closed_at:
          description: >-
            Order closing time. Omitted while the order is active or when
            unavailable.
          type: string
          format: date-time
          example: '2026-08-03T10:00:02Z'
        reduce_only:
          $ref: '#/components/schemas/TradingOrders_OrderReduceOnly'
        post_only:
          $ref: '#/components/schemas/TradingOrders_OrderPostOnly'
    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
    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
    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
    TradingOrders_AssetType:
      description: Classification of the trading instrument.
      type: string
      enum:
        - perpetual
    TradingOrders_ClientOrderId:
      description: Partner-provided reference for tracking an order.
      type: string
      format: uuid
      example: 550e8400-e29b-41d4-a716-446655440000
    TradingOrders_OrderSide:
      description: Direction of the order.
      type: string
      enum:
        - buy
        - sell
    TradingOrders_OrderType:
      description: Order type.
      type: string
      enum:
        - market
        - limit
        - stop_loss
        - take_profit
        - liquidation
        - unknown
    TradingOrders_OrderStatus:
      description: >-
        Current order status. A `closed` order is not necessarily fully filled;
        compare `filled_quantity` with `quantity`. A `cancelled` order may have
        been partially filled.
      type: string
      enum:
        - pending
        - open
        - pending_cancel
        - cancelled
        - expired
        - closed
    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]+)?$
    TradingOrders_TimeInForce:
      description: Execution and duration policy returned for an order.
      type: string
      enum:
        - gtc
        - gtd
        - ioc
        - fok
        - day
        - day_extended
        - unknown
    TradingOrders_OrderReduceOnly:
      description: >-
        **Available only for the International/EEA offering.**


        Whether execution is restricted to reducing an existing position. When
        enabled, the order cannot open or increase a position.


        An order larger than the open position may be accepted with a reduced
        quantity. The excess quantity will not execute or open a position in the
        opposite direction.
      type: boolean
      example: true
    TradingOrders_OrderPostOnly:
      description: >-
        **Available only for the International/EEA offering.**


        Whether the order is restricted to adding liquidity. When enabled, the
        order is rejected at submission if it would execute immediately.
      type: boolean
      example: true
    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
    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:
    spot-derivatives-unauthenticated:
      summary: Authentication required
      value:
        error:
          type: derivatives_error
          status: 401
          instance: 4bf92f3577b34da6a3ce929d0e0e4736
          code: unauthenticated
    spot-derivatives-gateway-unauthenticated:
      summary: Gateway authentication failed
      value:
        error:
          type: service_error
          status: 401
          instance: 4bf92f3577b34da6a3ce929d0e0e4736
          code: gateway
    spot-derivatives-forbidden:
      summary: Access denied
      value:
        error:
          type: derivatives_error
          status: 403
          instance: 4bf92f3577b34da6a3ce929d0e0e4736
          code: forbidden
    spot-derivatives-gateway-forbidden:
      summary: Gateway access denied
      value:
        error:
          type: service_error
          status: 403
          instance: 4bf92f3577b34da6a3ce929d0e0e4736
          code: gateway
    spot-derivatives-resource-exhausted:
      summary: Rate limit exceeded
      value:
        error:
          type: derivatives_error
          status: 429
          instance: 4bf92f3577b34da6a3ce929d0e0e4736
          code: resource_exhausted
    spot-derivatives-internal:
      summary: Internal service error
      value:
        error:
          type: derivatives_error
          status: 500
          instance: 4bf92f3577b34da6a3ce929d0e0e4736
          code: internal
    spot-derivatives-unavailable:
      summary: Service unavailable
      value:
        error:
          type: derivatives_error
          status: 503
          instance: 4bf92f3577b34da6a3ce929d0e0e4736
          code: unavailable
    spot-derivatives-deadline-exceeded:
      summary: Request deadline exceeded
      value:
        error:
          type: derivatives_error
          status: 504
          instance: 4bf92f3577b34da6a3ce929d0e0e4736
          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 API secret.
    ApiTimestamp:
      type: apiKey
      in: header
      name: API-Timestamp
      description: >-
        Time the request was signed, as Unix milliseconds. Included in the
        request signature. Requests signed too far from the server's time are
        rejected.

````