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

> Create an order for a specific account.

The user must complete derivatives onboarding before placing orders.

Stop-loss and take-profit orders are standalone orders and are not linked to a position or to each other. They can remain active after a position closes and may open a new position if triggered. Cancel any remaining orders when they are no longer needed.

A successful response confirms that the order was created, not that it has been filled or will stay open. The order can still be canceled afterward, for example if the account does not have enough funds. Use _Get order_ to check its status.

If the request times out or the connection is interrupted before you receive a response, the order may still have been created. Check _List orders_ for both open and closed orders before submitting another request. Resubmitting can create a duplicate order.



## OpenAPI

````yaml https://d2588n1sy4m36o.cloudfront.net/uat/merged/openapi.json?mintlify-view=derivatives post /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'
    post:
      tags:
        - Derivatives orders
      summary: Create order
      description: >-
        Create an order for a specific account.


        The user must complete derivatives onboarding before placing orders.


        Stop-loss and take-profit orders are standalone orders and are not
        linked to a position or to each other. They can remain active after a
        position closes and may open a new position if triggered. Cancel any
        remaining orders when they are no longer needed.


        A successful response confirms that the order was created, not that it
        has been filled or will stay open. The order can still be canceled
        afterward, for example if the account does not have enough funds. Use
        _Get order_ to check its status.


        If the request times out or the connection is interrupted before you
        receive a response, the order may still have been created. Check _List
        orders_ for both open and closed orders before submitting another
        request. Resubmitting can create a duplicate order.
      operationId: createOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TradingOrders_CreateOrderParameters'
            examples:
              us-derivatives-market-buy:
                value:
                  asset_type: perpetual
                  type: market
                  symbol: PBTCUCZ0.BTNL
                  side: buy
                  quantity: '2'
              international-eea-derivatives-market-buy:
                value:
                  asset_type: perpetual
                  type: market
                  symbol: PF_XBTUSD
                  side: buy
                  quantity: '0.001'
              us-derivatives-limit-sell:
                value:
                  asset_type: perpetual
                  type: limit
                  symbol: PBTCUCZ0.BTNL
                  side: sell
                  quantity: '1'
                  limit_price: '90000'
                  time_in_force: gtd
                  expire_time: '2027-06-30T16:00:00Z'
              international-eea-derivatives-limit-sell:
                value:
                  asset_type: perpetual
                  type: limit
                  symbol: PF_XBTUSD
                  side: sell
                  quantity: '0.001'
                  limit_price: '90000'
                  time_in_force: gtc
                  reduce_only: true
                  post_only: true
              us-derivatives-stop-loss-sell:
                value:
                  asset_type: perpetual
                  type: stop_loss
                  symbol: PBTCUCZ0.BTNL
                  side: sell
                  quantity: '1'
                  trigger_price: '80000'
                  time_in_force: gtc
              international-eea-derivatives-stop-loss-sell:
                value:
                  asset_type: perpetual
                  type: stop_loss
                  symbol: PF_XBTUSD
                  side: sell
                  quantity: '0.001'
                  trigger_price: '80000'
                  time_in_force: gtc
              us-derivatives-take-profit-sell:
                value:
                  asset_type: perpetual
                  type: take_profit
                  symbol: PBTCUCZ0.BTNL
                  side: sell
                  quantity: '1'
                  trigger_price: '90000'
                  time_in_force: gtc
              international-eea-derivatives-take-profit-sell:
                value:
                  asset_type: perpetual
                  type: take_profit
                  symbol: PF_XBTUSD
                  side: sell
                  quantity: '0.001'
                  trigger_price: '90000'
                  time_in_force: gtc
      responses:
        '201':
          description: The order request was processed.
          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/TradingOrders_CreateOrderResult'
              examples:
                us-derivatives:
                  value:
                    data:
                      id: FOPCDC6-PQIPJ-JLEIRY
                international-eea-derivatives:
                  value:
                    data:
                      id: 08aa2287-3586-492e-ae9d-d01a4dbac03a
        '400':
          description: The account, asset type, or order parameters 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-symbol:
                  value:
                    error:
                      type: derivatives_error
                      status: 400
                      instance: 4bf92f3577b34da6a3ce929d0e0e4736
                      code: bad_request
                      causes:
                        - field: symbol
                          message: >-
                            The symbol is not available for the selected asset
                            type.
                us-derivatives-fractional-quantity:
                  value:
                    error:
                      type: derivatives_error
                      status: 400
                      instance: 4bf92f3577b34da6a3ce929d0e0e4736
                      code: bad_request
                      causes:
                        - field: quantity
                          message: >-
                            The quantity must be positive and valid for the
                            selected instrument.
                us-and-international-eea-price-not-aligned:
                  value:
                    error:
                      type: derivatives_error
                      status: 400
                      instance: 4bf92f3577b34da6a3ce929d0e0e4736
                      code: bad_request
                      causes:
                        - field: limit_price
                          message: >-
                            The price 81296 must be a multiple of the instrument
                            tick size 5.
                us-derivatives-missing-expiry:
                  value:
                    error:
                      type: derivatives_error
                      status: 400
                      instance: 4bf92f3577b34da6a3ce929d0e0e4736
                      code: bad_request
                      causes:
                        - field: expire_time
                          message: >-
                            An expiration time is required when time in force is
                            gtd.
                invalid-client-order-id:
                  summary: Client order ID is not a valid UUID.
                  value:
                    error:
                      type: derivatives_error
                      status: 400
                      instance: 4bf92f3577b34da6a3ce929d0e0e4736
                      code: bad_request
                      causes:
                        - field: client_order_id
                          message: must be a valid UUID
                unsupported-international-eea-time-in-force:
                  value:
                    error:
                      type: derivatives_error
                      status: 400
                      instance: 4bf92f3577b34da6a3ce929d0e0e4736
                      code: bad_request
                      causes:
                        - field: time_in_force
                          message: Invalid value
        '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: >
            Order placement is not permitted. Possible reasons include:


            - The caller lacks account access or permission to place orders.

            - The user has not completed derivatives onboarding or is not
            eligible to trade.

            - Trading has been suspended for the account.
          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/TradingOrders_AccountTradingSuspendedError
              examples:
                access-denied:
                  $ref: '#/components/examples/spot-derivatives-forbidden'
                gateway-access-denied:
                  $ref: '#/components/examples/spot-derivatives-gateway-forbidden'
                us-derivatives-trading-suspended:
                  value:
                    error:
                      type: derivatives_error
                      status: 403
                      instance: 4bf92f3577b34da6a3ce929d0e0e4736
                      code: account_trading_suspended
                      causes:
                        - field: account_id
                          message: Order entry is suspended for the selected account.
        '409':
          description: The order request was rejected.
          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/TradingOrders_OrderInsufficientFundsError
                  - $ref: >-
                      #/components/schemas/TradingOrders_OrderMustReducePositionError
                  - $ref: >-
                      #/components/schemas/TradingOrders_MarketOrderPriceUnavailableError
                  - $ref: >-
                      #/components/schemas/TradingOrders_MarketOrderPriceProtectionError
                  - $ref: >-
                      #/components/schemas/TradingOrders_OrderRequestRejectedError
              examples:
                us-and-international-eea-insufficient-funds:
                  value:
                    error:
                      type: derivatives_error
                      status: 409
                      instance: 4bf92f3577b34da6a3ce929d0e0e4736
                      code: order_insufficient_funds
                      causes:
                        - field: quantity
                          message: >-
                            The selected account does not have sufficient
                            available funds to place this order.
                us-and-international-eea-must-reduce-position:
                  value:
                    error:
                      type: derivatives_error
                      status: 409
                      instance: 4bf92f3577b34da6a3ce929d0e0e4736
                      code: order_must_reduce_position
                      causes:
                        - field: side
                          message: The order must reduce an existing position.
                us-and-international-eea-market-price-unavailable:
                  value:
                    error:
                      type: derivatives_error
                      status: 409
                      instance: 4bf92f3577b34da6a3ce929d0e0e4736
                      code: market_order_price_unavailable
                      causes:
                        - field: type
                          message: >-
                            No executable market price is currently available.
                            Retry later or use a limit order.
                us-derivatives-market-price-protection:
                  value:
                    error:
                      type: derivatives_error
                      status: 409
                      instance: 4bf92f3577b34da6a3ce929d0e0e4736
                      code: market_order_price_protection
                      causes:
                        - field: type
                          message: >-
                            The market order would breach price protection
                            limits. Retry later or use a limit order.
                international-eea-post-only-would-execute:
                  value:
                    error:
                      type: derivatives_error
                      status: 409
                      instance: 4bf92f3577b34da6a3ce929d0e0e4736
                      code: order_request_rejected
                      causes:
                        - field: post_only
                          message: The post-only order would execute immediately.
                international-eea-market-post-only:
                  value:
                    error:
                      type: derivatives_error
                      status: 409
                      instance: 4bf92f3577b34da6a3ce929d0e0e4736
                      code: order_request_rejected
                      causes:
                        - field: symbol
                          message: >-
                            The instrument currently accepts only orders that
                            add liquidity.
                client-order-id-in-use:
                  value:
                    error:
                      type: derivatives_error
                      status: 409
                      instance: 4bf92f3577b34da6a3ce929d0e0e4736
                      code: order_request_rejected
                      causes:
                        - field: client_order_id
                          message: >-
                            is already in use by an active order or pending
                            trigger.
                us-and-international-eea-order-rejected:
                  value:
                    error:
                      type: derivatives_error
                      status: 409
                      instance: 4bf92f3577b34da6a3ce929d0e0e4736
                      code: order_request_rejected
        '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 request was not submitted for processing.
          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/TradingOrders_OrderRequestNotSubmittedError
              examples:
                order-not-submitted:
                  value:
                    error:
                      type: derivatives_error
                      status: 503
                      instance: 4bf92f3577b34da6a3ce929d0e0e4736
                      code: order_request_not_submitted
        '504':
          description: The request expired before submission, or its outcome is unknown.
          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/TradingOrders_RequestExpiredBeforeSubmissionError
                    title: Request expired before submission
                  - $ref: >-
                      #/components/schemas/TradingOrders_OrderOutcomeUnknownError
                    title: Order outcome unknown
              examples:
                expired-before-submission:
                  value:
                    error:
                      type: derivatives_error
                      status: 504
                      instance: 4bf92f3577b34da6a3ce929d0e0e4736
                      code: request_expired_before_submission
                outcome-unknown:
                  value:
                    error:
                      type: derivatives_error
                      status: 504
                      instance: 4bf92f3577b34da6a3ce929d0e0e4736
                      code: order_outcome_unknown
      security:
        - ApiKey: []
          ApiSign: []
          ApiTimestamp: []
      x-codeSamples:
        - lang: bash
          label: 'US offering: Market buy'
          source: |
            curl --request POST \
              --url 'https://api.sandbox.services.payward.com/v1/accounts/WVSD33HRMGSZUBM7/orders' \
              --header "API-Key: $PWS_API_KEY" \
              --header "API-Timestamp: $PWS_API_TIMESTAMP" \
              --header "API-Sign: $PWS_API_SIGN" \
              --header 'Content-Type: application/json' \
              --data '{"asset_type":"perpetual","type":"market","symbol":"PBTCUCZ0.BTNL","side":"buy","quantity":"2"}'
        - lang: bash
          label: 'International/EEA offering: Market buy'
          source: |
            curl --request POST \
              --url 'https://api.sandbox.services.payward.com/v1/accounts/WVSD33HRMGSZUBM7/orders' \
              --header "API-Key: $PWS_API_KEY" \
              --header "API-Timestamp: $PWS_API_TIMESTAMP" \
              --header "API-Sign: $PWS_API_SIGN" \
              --header 'Content-Type: application/json' \
              --data '{"asset_type":"perpetual","type":"market","symbol":"PF_XBTUSD","side":"buy","quantity":"0.001"}'
        - lang: bash
          label: 'US offering: Limit sell'
          source: |
            curl --request POST \
              --url 'https://api.sandbox.services.payward.com/v1/accounts/WVSD33HRMGSZUBM7/orders' \
              --header "API-Key: $PWS_API_KEY" \
              --header "API-Timestamp: $PWS_API_TIMESTAMP" \
              --header "API-Sign: $PWS_API_SIGN" \
              --header 'Content-Type: application/json' \
              --data '{"asset_type":"perpetual","type":"limit","symbol":"PBTCUCZ0.BTNL","side":"sell","quantity":"1","limit_price":"90000","time_in_force":"gtd","expire_time":"2027-06-30T16:00:00Z"}'
        - lang: bash
          label: 'International/EEA offering: Limit sell'
          source: |
            curl --request POST \
              --url 'https://api.sandbox.services.payward.com/v1/accounts/WVSD33HRMGSZUBM7/orders' \
              --header "API-Key: $PWS_API_KEY" \
              --header "API-Timestamp: $PWS_API_TIMESTAMP" \
              --header "API-Sign: $PWS_API_SIGN" \
              --header 'Content-Type: application/json' \
              --data '{"asset_type":"perpetual","type":"limit","symbol":"PF_XBTUSD","side":"sell","quantity":"0.001","limit_price":"90000","time_in_force":"gtc","reduce_only":true,"post_only":true}'
        - lang: bash
          label: 'US offering: Stop-loss sell'
          source: |
            curl --request POST \
              --url 'https://api.sandbox.services.payward.com/v1/accounts/WVSD33HRMGSZUBM7/orders' \
              --header "API-Key: $PWS_API_KEY" \
              --header "API-Timestamp: $PWS_API_TIMESTAMP" \
              --header "API-Sign: $PWS_API_SIGN" \
              --header 'Content-Type: application/json' \
              --data '{"asset_type":"perpetual","type":"stop_loss","symbol":"PBTCUCZ0.BTNL","side":"sell","quantity":"1","trigger_price":"80000","time_in_force":"gtc"}'
        - lang: bash
          label: 'International/EEA offering: Stop-loss sell'
          source: |
            curl --request POST \
              --url 'https://api.sandbox.services.payward.com/v1/accounts/WVSD33HRMGSZUBM7/orders' \
              --header "API-Key: $PWS_API_KEY" \
              --header "API-Timestamp: $PWS_API_TIMESTAMP" \
              --header "API-Sign: $PWS_API_SIGN" \
              --header 'Content-Type: application/json' \
              --data '{"asset_type":"perpetual","type":"stop_loss","symbol":"PF_XBTUSD","side":"sell","quantity":"0.001","trigger_price":"80000","time_in_force":"gtc"}'
        - lang: bash
          label: 'US offering: Take-profit sell'
          source: |
            curl --request POST \
              --url 'https://api.sandbox.services.payward.com/v1/accounts/WVSD33HRMGSZUBM7/orders' \
              --header "API-Key: $PWS_API_KEY" \
              --header "API-Timestamp: $PWS_API_TIMESTAMP" \
              --header "API-Sign: $PWS_API_SIGN" \
              --header 'Content-Type: application/json' \
              --data '{"asset_type":"perpetual","type":"take_profit","symbol":"PBTCUCZ0.BTNL","side":"sell","quantity":"1","trigger_price":"90000","time_in_force":"gtc"}'
        - lang: bash
          label: 'International/EEA offering: Take-profit sell'
          source: |
            curl --request POST \
              --url 'https://api.sandbox.services.payward.com/v1/accounts/WVSD33HRMGSZUBM7/orders' \
              --header "API-Key: $PWS_API_KEY" \
              --header "API-Timestamp: $PWS_API_TIMESTAMP" \
              --header "API-Sign: $PWS_API_SIGN" \
              --header 'Content-Type: application/json' \
              --data '{"asset_type":"perpetual","type":"take_profit","symbol":"PF_XBTUSD","side":"sell","quantity":"0.001","trigger_price":"90000","time_in_force":"gtc"}'
components:
  parameters:
    AccountId:
      name: account_id
      in: path
      required: true
      example: WVSD33HRMGSZUBM7
      schema:
        $ref: '#/components/schemas/AccountId'
  schemas:
    TradingOrders_CreateOrderParameters:
      description: Parameters for an order in the selected asset type.
      oneOf:
        - $ref: '#/components/schemas/TradingOrders_MarketOrderDefinition'
          title: Market order
        - $ref: '#/components/schemas/TradingOrders_LimitOrderDefinition'
          title: Limit order
        - $ref: '#/components/schemas/TradingOrders_StopLossOrderDefinition'
          title: Stop-loss order
        - $ref: '#/components/schemas/TradingOrders_TakeProfitOrderDefinition'
          title: Take-profit order
      discriminator:
        propertyName: type
        mapping:
          market: '#/components/schemas/TradingOrders_MarketOrderDefinition'
          limit: '#/components/schemas/TradingOrders_LimitOrderDefinition'
          stop_loss: '#/components/schemas/TradingOrders_StopLossOrderDefinition'
          take_profit: '#/components/schemas/TradingOrders_TakeProfitOrderDefinition'
    TradingOrders_CreateOrderResult:
      description: Result returned after processing a create request.
      type: object
      required:
        - id
      properties:
        id:
          description: Server-issued order identifier.
          type: string
          minLength: 1
          maxLength: 64
          example: FOPCDC6-PQIPJ-JLEIRY
        client_order_id:
          description: |-
            **Available for the International/EEA offering.**

            Order reference supplied in the request. Omitted when not supplied.
          type: string
          example: 550e8400-e29b-41d4-a716-446655440000
    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
    TradingOrders_AccountTradingSuspendedError:
      title: Account trading suspended
      description: Trading has been suspended for the account.
      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: 403
                    code:
                      type: string
                      enum:
                        - account_trading_suspended
                    causes:
                      type: array
                      minItems: 1
                      maxItems: 1
                      items:
                        $ref: >-
                          #/components/schemas/TradingOrders_DerivativesErrorCause
    TradingOrders_OrderInsufficientFundsError:
      title: Order insufficient funds
      description: >-
        The selected account does not have sufficient available funds to place
        the order.
      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:
                        - order_insufficient_funds
                    causes:
                      type: array
                      minItems: 1
                      maxItems: 1
                      items:
                        $ref: >-
                          #/components/schemas/TradingOrders_DerivativesErrorCause
    TradingOrders_OrderMustReducePositionError:
      title: Order must reduce position
      description: The order would not reduce an existing position.
      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:
                        - order_must_reduce_position
                    causes:
                      type: array
                      minItems: 1
                      maxItems: 1
                      items:
                        $ref: >-
                          #/components/schemas/TradingOrders_DerivativesErrorCause
    TradingOrders_MarketOrderPriceUnavailableError:
      title: Market order price unavailable
      description: No executable market price is currently available for the market order.
      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:
                        - market_order_price_unavailable
                    causes:
                      type: array
                      minItems: 1
                      maxItems: 1
                      items:
                        $ref: >-
                          #/components/schemas/TradingOrders_DerivativesErrorCause
    TradingOrders_MarketOrderPriceProtectionError:
      title: Market order price protection
      description: >-
        The market order was rejected because its expected execution price
        breached price protection limits.
      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:
                        - market_order_price_protection
                    causes:
                      type: array
                      minItems: 1
                      maxItems: 1
                      items:
                        $ref: >-
                          #/components/schemas/TradingOrders_DerivativesErrorCause
    TradingOrders_OrderRequestRejectedError:
      title: Order request rejected
      description: The requested order operation was definitively rejected.
      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:
                        - order_request_rejected
    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
    TradingOrders_OrderRequestNotSubmittedError:
      description: The requested order operation was not submitted for processing.
      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:
                        - order_request_not_submitted
    TradingOrders_RequestExpiredBeforeSubmissionError:
      description: The request expired before the order operation was 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: 504
                    code:
                      type: string
                      enum:
                        - request_expired_before_submission
    TradingOrders_OrderOutcomeUnknownError:
      description: The order operation may have been processed; do not automatically retry.
      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:
                        - order_outcome_unknown
    AccountId:
      description: Globally unique public identifier for an account.
      type: string
      minLength: 14
      maxLength: 42
    TradingOrders_MarketOrderDefinition:
      description: Market order parameters.
      type: object
      required:
        - type
        - symbol
        - side
        - quantity
      properties:
        asset_type:
          $ref: '#/components/schemas/TradingOrders_AssetType'
          default: perpetual
          example: perpetual
        type:
          description: Order type.
          type: string
          enum:
            - market
        symbol:
          description: Instrument symbol.
          type: string
          minLength: 1
          maxLength: 64
          pattern: ^\S+$
          example: PBTCUCZ0.BTNL
        side:
          $ref: '#/components/schemas/TradingOrders_OrderSide'
          example: buy
        quantity:
          description: >-
            Quantity to trade, in contracts. The US offering requires whole
            numbers. Must align with the instrument's `quantity_precision`.
          type: string
          minLength: 1
          maxLength: 256
          pattern: ^(?:[0-9]*[1-9][0-9]*(?:\.[0-9]+)?|0+\.[0-9]*[1-9][0-9]*)$
          example: '2'
        client_order_id:
          $ref: '#/components/schemas/TradingOrders_ClientOrderId'
          description: >-
            **Available for the International/EEA offering.**


            Optional partner-provided reference for tracking the order. Use a
            lowercase, hyphenated UUID.


            Two active orders or pending triggers in the same account cannot use
            the same ID. Reusing an ID that is still in use returns `409`.


            Once the original order or trigger is no longer active, the ID can
            be reused. A retry with that ID can then create another order. This
            is not an idempotency key.
        reduce_only:
          $ref: '#/components/schemas/TradingOrders_OrderReduceOnly'
          default: false
    TradingOrders_LimitOrderDefinition:
      description: Limit order parameters.
      type: object
      required:
        - type
        - symbol
        - side
        - quantity
        - limit_price
      properties:
        asset_type:
          $ref: '#/components/schemas/TradingOrders_AssetType'
          default: perpetual
          example: perpetual
        type:
          description: Order type.
          type: string
          enum:
            - limit
        symbol:
          description: Instrument symbol.
          type: string
          minLength: 1
          maxLength: 64
          pattern: ^\S+$
          example: PBTCUCZ0.BTNL
        side:
          $ref: '#/components/schemas/TradingOrders_OrderSide'
          example: buy
        quantity:
          description: >-
            Quantity to trade, in contracts. The US offering requires whole
            numbers. Must align with the instrument's `quantity_precision`.
          type: string
          minLength: 1
          maxLength: 256
          pattern: ^(?:[0-9]*[1-9][0-9]*(?:\.[0-9]+)?|0+\.[0-9]*[1-9][0-9]*)$
          example: '2'
        client_order_id:
          $ref: '#/components/schemas/TradingOrders_ClientOrderId'
          description: >-
            **Available for the International/EEA offering.**


            Optional partner-provided reference for tracking the order. Use a
            lowercase, hyphenated UUID.


            Two active orders or pending triggers in the same account cannot use
            the same ID. Reusing an ID that is still in use returns `409`.


            Once the original order or trigger is no longer active, the ID can
            be reused. A retry with that ID can then create another order. This
            is not an idempotency key.
        limit_price:
          $ref: '#/components/schemas/Price'
          description: >-
            Limit price. Must be positive and align with the instrument's
            `tick_size`.
          example: '90000'
        time_in_force:
          $ref: '#/components/schemas/TradingOrders_CreateOrderTimeInForce'
        expire_time:
          description: >-
            **Available only for the US offering.**


            Expiry time for a `gtd` order. Required for `gtd`; omit for other
            policies. Must use whole-second precision.
          type: string
          format: date-time
          example: '2027-06-30T16:00:00Z'
        reduce_only:
          $ref: '#/components/schemas/TradingOrders_OrderReduceOnly'
          default: false
        post_only:
          $ref: '#/components/schemas/TradingOrders_OrderPostOnly'
          default: false
    TradingOrders_StopLossOrderDefinition:
      description: Stop-loss market order parameters.
      type: object
      required:
        - type
        - symbol
        - side
        - quantity
        - trigger_price
      properties:
        asset_type:
          $ref: '#/components/schemas/TradingOrders_AssetType'
          default: perpetual
          example: perpetual
        type:
          description: Order type.
          type: string
          enum:
            - stop_loss
        symbol:
          description: Instrument symbol.
          type: string
          minLength: 1
          maxLength: 64
          pattern: ^\S+$
          example: PBTCUCZ0.BTNL
        side:
          $ref: '#/components/schemas/TradingOrders_OrderSide'
          example: buy
        quantity:
          description: >-
            Quantity to trade, in contracts. The US offering requires whole
            numbers. Must align with the instrument's `quantity_precision`.
          type: string
          minLength: 1
          maxLength: 256
          pattern: ^(?:[0-9]*[1-9][0-9]*(?:\.[0-9]+)?|0+\.[0-9]*[1-9][0-9]*)$
          example: '2'
        client_order_id:
          $ref: '#/components/schemas/TradingOrders_ClientOrderId'
          description: >-
            **Available for the International/EEA offering.**


            Optional partner-provided reference for tracking the order. Use a
            lowercase, hyphenated UUID.


            Two active orders or pending triggers in the same account cannot use
            the same ID. Reusing an ID that is still in use returns `409`.


            Once the original order or trigger is no longer active, the ID can
            be reused. A retry with that ID can then create another order. This
            is not an idempotency key.
        trigger_price:
          $ref: '#/components/schemas/Price'
          description: >-
            **US offering:** Triggers when either the last traded price or best
            bid/ask reaches or crosses this price, whichever happens first.


            **International/EEA offering:** Triggers on the last traded price,
            reported as `last_price` in the ticker.


            Must be positive and align with the instrument's `tick_size`.
          example: '80000'
        time_in_force:
          $ref: '#/components/schemas/TradingOrders_ConditionalOrderTimeInForce'
        expire_time:
          description: >-
            **Available only for the US offering.**


            Expiry time for a `gtd` order. Required for `gtd`; omit for other
            policies. Must use whole-second precision.
          type: string
          format: date-time
          example: '2027-06-30T16:00:00Z'
        reduce_only:
          $ref: '#/components/schemas/TradingOrders_OrderReduceOnly'
          default: false
    TradingOrders_TakeProfitOrderDefinition:
      description: Take-profit market order parameters.
      type: object
      required:
        - type
        - symbol
        - side
        - quantity
        - trigger_price
      properties:
        asset_type:
          $ref: '#/components/schemas/TradingOrders_AssetType'
          default: perpetual
          example: perpetual
        type:
          description: Order type.
          type: string
          enum:
            - take_profit
        symbol:
          description: Instrument symbol.
          type: string
          minLength: 1
          maxLength: 64
          pattern: ^\S+$
          example: PBTCUCZ0.BTNL
        side:
          $ref: '#/components/schemas/TradingOrders_OrderSide'
          example: buy
        quantity:
          description: >-
            Quantity to trade, in contracts. The US offering requires whole
            numbers. Must align with the instrument's `quantity_precision`.
          type: string
          minLength: 1
          maxLength: 256
          pattern: ^(?:[0-9]*[1-9][0-9]*(?:\.[0-9]+)?|0+\.[0-9]*[1-9][0-9]*)$
          example: '2'
        client_order_id:
          $ref: '#/components/schemas/TradingOrders_ClientOrderId'
          description: >-
            **Available for the International/EEA offering.**


            Optional partner-provided reference for tracking the order. Use a
            lowercase, hyphenated UUID.


            Two active orders or pending triggers in the same account cannot use
            the same ID. Reusing an ID that is still in use returns `409`.


            Once the original order or trigger is no longer active, the ID can
            be reused. A retry with that ID can then create another order. This
            is not an idempotency key.
        trigger_price:
          $ref: '#/components/schemas/Price'
          description: >-
            **US offering:** Triggers when the best bid/ask reaches or crosses
            this price.


            **International/EEA offering:** Triggers on the last traded price,
            reported as `last_price` in the ticker.


            Must be positive and align with the instrument's `tick_size`.
          example: '80000'
        time_in_force:
          $ref: '#/components/schemas/TradingOrders_ConditionalOrderTimeInForce'
        expire_time:
          description: >-
            **Available only for the US offering.**


            Expiry time for a `gtd` order. Required for `gtd`; omit for other
            policies. Must use whole-second precision.
          type: string
          format: date-time
          example: '2027-06-30T16:00:00Z'
        reduce_only:
          $ref: '#/components/schemas/TradingOrders_OrderReduceOnly'
          default: false
    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
    TradingOrders_DerivativesErrorCause:
      description: One client-actionable detail for a derivatives error.
      type: object
      required:
        - field
        - message
      properties:
        field:
          description: Dot-notation path to the affected request or resource field.
          type: string
        message:
          description: >-
            Human-readable explanation of the condition and safe client
            response.
          type: string
    TradingOrders_AssetType:
      description: Classification of the trading instrument.
      type: string
      enum:
        - perpetual
    TradingOrders_OrderSide:
      description: Direction of the order.
      type: string
      enum:
        - buy
        - sell
    TradingOrders_ClientOrderId:
      description: Partner-provided reference for tracking an order.
      type: string
      format: uuid
      example: 550e8400-e29b-41d4-a716-446655440000
    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
    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_CreateOrderTimeInForce:
      description: >-
        **The US offering supports all listed policies; the International/EEA
        offering supports only `gtc`.**


        Execution and duration policy for a limit order. `gtc` remains active
        until filled or canceled; `gtd` expires at `expire_time`; `day` expires
        at the end of the trading session. `ioc` cancels any quantity not filled
        immediately; `fok` fills the entire quantity immediately or cancels the
        order.
      type: string
      enum:
        - gtc
        - gtd
        - ioc
        - fok
        - day
      default: gtc
    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
    TradingOrders_ConditionalOrderTimeInForce:
      description: >-
        **The US offering supports all listed policies; the International/EEA
        offering supports only `gtc`.**


        Duration policy before a stop-loss or take-profit order triggers. `gtc`
        remains active until triggered or canceled; `gtd` expires at
        `expire_time`; `day` expires at the end of the trading session.
      type: string
      enum:
        - gtc
        - gtd
        - day
      default: gtc
    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
  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.

````