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

# Edit Order Preview

> Preview an edit order request with a specified new `size`, or new `price`.



## OpenAPI

````yaml POST /api/v3/brokerage/orders/edit_preview
openapi: 3.0.0
info:
  title: Coinbase Advanced Trade API
  version: '0.1'
servers:
  - url: https://api.coinbase.com
security:
  - apiKeyAuth: []
paths:
  /api/v3/brokerage/orders/edit_preview:
    post:
      tags:
        - Orders
      summary: Edit Order Preview
      description: >-
        Preview an edit order request with a specified new `size`, or new
        `price`.
      operationId: RetailBrokerageApi_PreviewEditOrder
      requestBody:
        $ref: >-
          #/components/requestBodies/coinbase.public_api.authed.retail_brokerage_api.EditOrderRequest
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.PreviewEditOrderResponse
            text/event-stream:
              schema:
                $ref: >-
                  #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.PreviewEditOrderResponse
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/grpc.gateway.runtime.Error'
            text/event-stream:
              schema:
                $ref: '#/components/schemas/grpc.gateway.runtime.Error'
components:
  requestBodies:
    coinbase.public_api.authed.retail_brokerage_api.EditOrderRequest:
      content:
        application/json:
          schema:
            $ref: >-
              #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.EditOrderRequest
      required: true
  schemas:
    coinbase.public_api.authed.retail_brokerage_api.PreviewEditOrderResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: >-
              #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.EditOrderError
          required:
            - errors
        slippage:
          type: string
        order_total:
          type: string
        commission_total:
          type: string
        quote_size:
          type: string
          example: 10
          description: >-
            The amount of the second Asset in the Trading Pair. For example, on
            the BTC/USD Order Book, USD is the Quote Asset.
        base_size:
          type: string
          example: 0.001
          description: >-
            The amount of the first Asset in the Trading Pair. For example, on
            the BTC-USD Order Book, BTC is the Base Asset.
        best_bid:
          type: string
        best_ask:
          type: string
        average_filled_price:
          type: string
        order_margin_total:
          type: string
        commission_detail_total:
          description: Breakdown of commission charges for the order
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.CommissionDetailTotal
        pnl_configuration:
          description: >-
            Expected PNL of an order. This value is an estimate and does not
            take into account fees and slippage.
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.PnlConfiguration
      required:
        - errors
    grpc.gateway.runtime.Error:
      type: object
      properties:
        error:
          type: string
        code:
          type: integer
          format: int32
        message:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/google.protobuf.Any'
    coinbase.public_api.authed.retail_brokerage_api.EditOrderRequest:
      type: object
      properties:
        order_id:
          type: string
          description: The ID of the order.
          required:
            - order_id
        price:
          type: string
          example: '19000.00'
          description: The update price of the order.
          required:
            - price
        size:
          type: string
          example: '0.001'
          description: The updated size of the order.
          required:
            - size
        attached_order_configuration:
          description: >-
            The configuration of the attached order. Only TriggerBracketGtc,
            LimitLimitGtc or StopLimitStopLimitGtc are eligible.
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.OrderConfiguration
        cancel_attached_order:
          type: boolean
          example: 'true'
          description: Drops both the legs of TP/SL, order becomes a simple limit order.
        stop_price:
          type: string
          example: '17000.00'
          description: >-
            The updated stop price of the order. Only applicable for editing
            TP/SL or SL orders.
        average_entry_price:
          type: string
          example: '18000.00'
          description: The average entry price of the position. Used for estimated PnL
      required:
        - order_id
        - price
        - size
    coinbase.public_api.authed.retail_brokerage_api.EditOrderError:
      type: object
      properties:
        edit_failure_reason:
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.EditOrderFailureReason
        preview_failure_reason:
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.PreviewFailureReason
    coinbase.public_api.authed.retail_brokerage_api.CommissionDetailTotal:
      type: object
      properties:
        total_commission:
          type: string
          title: |-
            Total commission amount charged for the order
            This is the sum of all commission charged on the order
        gst_commission:
          type: string
          title: Goods and Services Tax (GST) portion of the commission
        withholding_commission:
          type: string
          title: Tax withholding portion of the commission
        client_commission:
          type: string
          title: Client commission on the trade
        venue_commission:
          type: string
          title: Venue Commission
        regulatory_commission:
          type: string
          title: Regulatory Commission
        clearing_commission:
          type: string
          title: Clearing Commission
      title: >-
        CommissionDetailTotal contains the breakdown of commission charges for
        an order
    coinbase.public_api.authed.retail_brokerage_api.PnlConfiguration:
      type: object
      properties:
        trigger_bracket_pnl:
          description: PNL configuration for a bracket order.
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.TriggerBracketPnl
    google.protobuf.Any:
      type: object
      properties:
        type_url:
          type: string
          description: >-
            A URL/resource name that uniquely identifies the type of the
            serialized

            protocol buffer message. This string must contain at least

            one "/" character. The last segment of the URL's path must represent

            the fully qualified name of the type (as in

            `path/google.protobuf.Duration`). The name should be in a canonical
            form

            (e.g., leading "." is not accepted).


            In practice, teams usually precompile into the binary all types that
            they

            expect it to use in the context of Any. However, for URLs which use
            the

            scheme `http`, `https`, or no scheme, one can optionally set up a
            type

            server that maps type URLs to message definitions as follows:


            * If no scheme is provided, `https` is assumed.

            * An HTTP GET on the URL must yield a [google.protobuf.Type][]
              value in binary format, or produce an error.
            * Applications are allowed to cache lookup results based on the
              URL, or have them precompiled into a binary to avoid any
              lookup. Therefore, binary compatibility needs to be preserved
              on changes to types. (Use versioned type names to manage
              breaking changes.)

            Note: this functionality is not currently available in the official

            protobuf release, and it is not used for type URLs beginning with

            type.googleapis.com. As of May 2023, there are no widely used type
            server

            implementations and no plans to implement one.


            Schemes other than `http`, `https` (or the empty scheme) might be

            used with implementation specific semantics.
        value:
          type: string
          format: byte
          description: >-
            Must be a valid serialized protocol buffer of the above specified
            type.
      description: >-
        `Any` contains an arbitrary serialized protocol buffer message along
        with a

        URL that describes the type of the serialized message.


        Protobuf library provides support to pack/unpack Any values in the form

        of utility functions or additional generated methods of the Any type.


        Example 1: Pack and unpack a message in C++.

            Foo foo = ...;
            Any any;
            any.PackFrom(foo);
            ...
            if (any.UnpackTo(&foo)) {
              ...
            }

        Example 2: Pack and unpack a message in Java.

            Foo foo = ...;
            Any any = Any.pack(foo);
            ...
            if (any.is(Foo.class)) {
              foo = any.unpack(Foo.class);
            }
            // or ...
            if (any.isSameTypeAs(Foo.getDefaultInstance())) {
              foo = any.unpack(Foo.getDefaultInstance());
            }

         Example 3: Pack and unpack a message in Python.

            foo = Foo(...)
            any = Any()
            any.Pack(foo)
            ...
            if any.Is(Foo.DESCRIPTOR):
              any.Unpack(foo)
              ...

         Example 4: Pack and unpack a message in Go

             foo := &pb.Foo{...}
             any, err := anypb.New(foo)
             if err != nil {
               ...
             }
             ...
             foo := &pb.Foo{}
             if err := any.UnmarshalTo(foo); err != nil {
               ...
             }

        The pack methods provided by protobuf library will by default use

        'type.googleapis.com/full.type.name' as the type URL and the unpack

        methods only use the fully qualified type name after the last '/'

        in the type URL, for example "foo.bar.com/x/y.z" will yield type

        name "y.z".


        JSON

        ====

        The JSON representation of an `Any` value uses the regular

        representation of the deserialized, embedded message, with an

        additional field `@type` which contains the type URL. Example:

            package google.profile;
            message Person {
              string first_name = 1;
              string last_name = 2;
            }

            {
              "@type": "type.googleapis.com/google.profile.Person",
              "firstName": <string>,
              "lastName": <string>
            }

        If the embedded message type is well-known and has a custom JSON

        representation, that representation will be embedded adding a field

        `value` which holds the custom JSON in addition to the `@type`

        field. Example (for message [google.protobuf.Duration][]):

            {
              "@type": "type.googleapis.com/google.protobuf.Duration",
              "value": "1.212s"
            }
    coinbase.public_api.authed.retail_brokerage_api.OrderConfiguration:
      type: object
      properties:
        market_market_ioc:
          description: >-
            Buy or sell a specified quantity of an Asset at the current best
            available market price. [Read more on Market
            Orders](https://help.coinbase.com/en/coinbase/trading-and-funding/advanced-trade/order-types#market-order) 
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.MarketMarketIoc
        market_market_fok:
          description: >-
            Buy or sell a specified quantity of an Asset at the current best
            available market price. The Order will only post to the Order Book
            if it is to immediately and completely Fill. [Read more on Market
            Orders](https://help.coinbase.com/en/coinbase/trading-and-funding/advanced-trade/order-types#market-order)
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.MarketMarketFok
        sor_limit_ioc:
          description: >-
            Buy or sell a specified quantity of an Asset at a specified price.
            The Order will only post to the Order Book if it will immediately
            Fill; any remaining quantity is canceled. [Read more on Limit
            Orders.](https://help.coinbase.com/en/coinbase/trading-and-funding/advanced-trade/order-types#limit-order)
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.SorLimitIoc
        limit_limit_gtc:
          description: >-
            Buy or sell a specified quantity of an Asset at a specified price.
            If posted, the Order will remain on the Order Book until canceled.
            [Read more on Limit
            Orders.](https://help.coinbase.com/en/coinbase/trading-and-funding/advanced-trade/order-types#limit-order)
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.LimitLimitGtc
        limit_limit_gtd:
          description: >-
            Buy or sell a specified quantity of an Asset at a specified price.
            If posted, the Order will remain on the Order Book until a certain
            time is reached or the Order is canceled. [Read more on Limit
            Orders.](https://help.coinbase.com/en/coinbase/trading-and-funding/advanced-trade/order-types#limit-order)
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.LimitLimitGtd
        limit_limit_fok:
          description: >-
            Buy or sell a specified quantity of an Asset at a specified price.
            The Order will only post to the Order Book if it is to immediately
            and completely Fill. [Read more on Limit
            Orders.](https://help.coinbase.com/en/coinbase/trading-and-funding/advanced-trade/order-types#limit-order)
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.LimitLimitFok
        twap_limit_gtd:
          description: >-
            A time-weighted average price (TWAP) order type that calculates the
            average price of a product to programmatically execute an order over
            a specified duration.
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.TwapLimitGtd
        stop_limit_stop_limit_gtc:
          description: >-
            Posts an Order to buy or sell a specified quantity of an Asset, but
            only if and when the last trade price on the Order Book equals or
            surpasses the Stop Price. If posted, the Order will remain on the
            Order Book until canceled. [Read more on Stop-Limit
            Orders.](https://help.coinbase.com/en/coinbase/trading-and-funding/advanced-trade/order-types#stop-limit-order)
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.StopLimitStopLimitGtc
        stop_limit_stop_limit_gtd:
          description: >-
            Posts an Order to buy or sell a specified quantity of an Asset, but
            only if and when the last trade price on the Order Book equals or
            surpasses the Stop Price. If posted, the Order will remain on the
            Order Book until a certain time is reached or the Order.  [Read more
            on Stop-Limit
            Orders.](https://help.coinbase.com/en/coinbase/trading-and-funding/advanced-trade/order-types#stop-limit-order)
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.StopLimitStopLimitGtd
        trigger_bracket_gtc:
          description: >-
            A Limit Order to buy or sell a specified quantity of an Asset at a
            specified price, with stop limit order parameters embedded in the
            order. If posted, the Order will remain on the Order Book until
            canceled. [Read more on Bracket
            Orders.](https://help.coinbase.com/en/coinbase/trading-and-funding/advanced-trade/order-types#bracket-order)
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.TriggerBracketGtc
        trigger_bracket_gtd:
          description: >-
            A Limit Order to buy or sell a specified quantity of an Asset at a
            specified price, with stop limit order parameters embedded in the
            order. If posted, the Order will remain on the Order Book until a
            certain time is reached or the Order is canceled. [Read more on
            Bracket
            Orders.](https://help.coinbase.com/en/coinbase/trading-and-funding/advanced-trade/order-types#bracket-order)
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.TriggerBracketGtd
        scaled_limit_gtc:
          description: >-
            A scaled order enables users to divide a large order into multiple
            smaller limit orders, which are placed incrementally across a
            user-defined price range. [Read more on Limit
            Orders.](https://help.coinbase.com/en/coinbase/trading-and-funding/advanced-trade/order-types#limit-order)
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.ScaledLimitGtc
    coinbase.public_api.authed.retail_brokerage_api.EditOrderFailureReason:
      type: string
      enum:
        - UNKNOWN_EDIT_ORDER_FAILURE_REASON
        - COMMANDER_REJECTED_EDIT_ORDER
        - CANNOT_EDIT_TO_BELOW_FILLED_SIZE
        - ORDER_NOT_FOUND
        - CALLER_ID_MISMATCH
        - ONLY_LIMIT_ORDER_EDITS_SUPPORTED
        - INVALID_EDITED_SIZE
        - INVALID_EDITED_PRICE
        - INVALID_ORIGINAL_SIZE
        - INVALID_ORIGINAL_PRICE
        - EDIT_REQUEST_EQUAL_TO_ORIGINAL_REQUEST
        - ONLY_OPEN_ORDERS_CAN_BE_EDITED
        - SIZE_IN_QUOTE_EDITS_NOT_ALLOWED
        - ORDER_IS_ALREADY_BEING_REPLACED
        - PORTFOLIO_NOT_ALLOWED_FOR_EDITS
        - STRATEGY_NOT_SUPPORTED
        - FIELD_STOPPRICE_NOT_SUPPORTED
        - FIELD_DISPLAYSIZE_NOT_SUPPORTED
        - FIELD_ENDTIME_NOT_SUPPORTED
        - INVALID_ORIGINAL_TIME
        - INVALID_NEW_ENDTIME
        - NOT_STARTED
        - CANNOT_EDIT_FUTURES_ORDER
        - FUTURES_VENUE_ORDER_NOT_FOUND
        - CANNOT_EDIT_STOP_PRICE_FOR_TRIGGERED_ORDER
        - CANNOT_EDIT_ORDER_PENDING_CANCEL
        - INSUFFICIENT_TIME_TO_EDIT
        - EXCEEDED_MAX_ALLOWED_EDIT_REQUEST_COUNT
        - CANNOT_CANCEL_ACTIVE_ATTACHED_ORDER
        - ORDER_EDIT_INVALID_ATTACHED_ORDER_REQUEST
        - ORDER_EDIT_ORDER_TYPE_NOT_SUPPORTED
        - CANNOT_EDIT_TRIGGERED_ORDER
        - INVALID_EDITED_STOP_PRICE
        - INVALID_EDITED_STOP_LIMIT_PRICE
        - INVALID_ORIGINAL_STOP_PRICE
        - INVALID_ORIGINAL_STOP_LIMIT_PRICE
        - INVALID_ORIGINAL_ATTACHED_ORDER_CONFIG
        - CANNOT_EDIT_ATTACHED_ORDER_CONFIGURATION_AFTER_CREATION
        - CANNOT_CONVERT_SIZE_ASSET
        - CANNOT_CONVERT_DISPLAY_SIZE_ASSET
        - CANNOT_EDIT_ATTACHED_ORDER_SIZE_WITH_OPEN_ORIGINATING_ORDER
        - INVALID_EDITED_TAKE_PROFIT_PRICE
        - INVALID_EDITED_STOP_LOSS_PRICE
        - INVALID_EDITED_ATTACHED_ORDER_CONFIGURATION
        - CANNOT_EDIT_ATTACHED_SL_ORDER_PRICE
        - CANNOT_ADD_ATTACHED_ORDER_TO_ORDER_TYPE
        - CANNOT_CHANGE_SIDE_OF_ORDER
        - CANNOT_CHANGE_ORDER_TYPE_OF_ORDER
        - CANNOT_CHANGE_PRODUCT_ID_OF_ORDER
        - PREV_CLIENT_ORDER_ID_REQUIRED_WHEN_CLIENT_ORDER_ID_PROVIDED
        - CLIENT_ORDER_ID_REQUIRED_WHEN_PREV_CLIENT_ORDER_ID_PROVIDED
        - CLIENT_ORDER_ID_MUST_BE_DIFFERENT_FROM_PREV_CLIENT_ORDER_ID
        - PREV_CLIENT_ORDER_ID_MUST_MATCH_CURRENT_CLIENT_ORDER_ID
        - CANNOT_MODIFY_ATTACHED_CONFIG_OF_NON_NEW_ORDER
        - INVALID_EDITED_ATTACHED_ORDER_CONFIGURATION_NON_MODIFIABLE_VALUE_EDIT
        - ATTACHED_CONFIGURATION_IS_EQUAL
        - CANNOT_ADD_LEG_TO_TPSL_ORDER
        - CANNOT_REMOVE_LEG_FROM_TPSL_ORDER
        - SINGLE_LEGGED_BRACKET_ORDER_NOT_ALLOWED
        - SINGLE_LEGGED_ATTACHED_ORDER_CONFIGURATION_NOT_ALLOWED
      default: UNKNOWN_EDIT_ORDER_FAILURE_REASON
      description: >-
        Used to provide detailed error information when an order modification
        request fails.

        This helps clients understand exactly why their edit operation was
        unsuccessful

        and what corrective action might be needed.
    coinbase.public_api.authed.retail_brokerage_api.PreviewFailureReason:
      type: string
      enum:
        - UNKNOWN_PREVIEW_FAILURE_REASON
        - PREVIEW_MISSING_COMMISSION_RATE
        - PREVIEW_INVALID_SIDE
        - PREVIEW_INVALID_ORDER_CONFIG
        - PREVIEW_INVALID_PRODUCT_ID
        - PREVIEW_INVALID_SIZE_PRECISION
        - PREVIEW_INVALID_PRICE_PRECISION
        - PREVIEW_MISSING_PRODUCT_PRICE_BOOK
        - PREVIEW_INVALID_LEDGER_BALANCE
        - PREVIEW_INSUFFICIENT_LEDGER_BALANCE
        - PREVIEW_INVALID_LIMIT_PRICE_POST_ONLY
        - PREVIEW_INVALID_LIMIT_PRICE
        - PREVIEW_INVALID_NO_LIQUIDITY
        - PREVIEW_INSUFFICIENT_FUND
        - PREVIEW_INVALID_COMMISSION_CONFIGURATION
        - PREVIEW_INVALID_STOP_PRICE
        - PREVIEW_INVALID_BASE_SIZE_TOO_LARGE
        - PREVIEW_INVALID_BASE_SIZE_TOO_SMALL
        - PREVIEW_INVALID_QUOTE_SIZE_PRECISION
        - PREVIEW_INVALID_QUOTE_SIZE_TOO_LARGE
        - PREVIEW_INVALID_PRICE_TOO_LARGE
        - PREVIEW_INVALID_QUOTE_SIZE_TOO_SMALL
        - PREVIEW_INSUFFICIENT_FUNDS_FOR_FUTURES
        - PREVIEW_BREACHED_PRICE_LIMIT
        - PREVIEW_BREACHED_ACCOUNT_POSITION_LIMIT
        - PREVIEW_BREACHED_COMPANY_POSITION_LIMIT
        - PREVIEW_INVALID_MARGIN_HEALTH
        - PREVIEW_RISK_PROXY_FAILURE
        - PREVIEW_UNTRADABLE_FCM_ACCOUNT_STATUS
        - PREVIEW_IN_LIQUIDATION
        - PREVIEW_INVALID_MARGIN_TYPE
        - PREVIEW_INVALID_LEVERAGE
        - PREVIEW_UNTRADABLE_PRODUCT
        - PREVIEW_INVALID_FCM_TRADING_SESSION
        - PREVIEW_NOT_ALLOWED_BY_MARKET_STATE
        - PREVIEW_BREACHED_OPEN_INTEREST_LIMIT
        - PREVIEW_GEOFENCING_RESTRICTION
        - PREVIEW_INVALID_END_TIME
        - PREVIEW_OPPOSITE_MARGIN_TYPE_EXISTS
        - PREVIEW_QUOTE_SIZE_NOT_ALLOWED_FOR_BRACKET
        - PREVIEW_INVALID_BRACKET_PRICES
        - PREVIEW_MISSING_MARKET_TRADE_DATA
        - PREVIEW_INVALID_BRACKET_LIMIT_PRICE
        - PREVIEW_INVALID_BRACKET_STOP_TRIGGER_PRICE
        - PREVIEW_BRACKET_LIMIT_PRICE_OUT_OF_BOUNDS
        - PREVIEW_STOP_TRIGGER_PRICE_OUT_OF_BOUNDS
        - PREVIEW_BRACKET_ORDER_NOT_SUPPORTED
        - PREVIEW_INVALID_STOP_PRICE_PRECISION
        - PREVIEW_STOP_PRICE_ABOVE_LIMIT_PRICE
        - PREVIEW_STOP_PRICE_BELOW_LIMIT_PRICE
        - PREVIEW_STOP_PRICE_ABOVE_LAST_TRADE_PRICE
        - PREVIEW_STOP_PRICE_BELOW_LAST_TRADE_PRICE
        - PREVIEW_FOK_DISABLED
        - PREVIEW_FOK_ONLY_ALLOWED_ON_LIMIT_ORDERS
        - PREVIEW_POST_ONLY_NOT_ALLOWED_WITH_FOK
        - PREVIEW_UBO_HIGH_LEVERAGE_QUANTITY_BREACHED
        - PREVIEW_ECOSYSTEM_LEVERAGE_UTILIZATION_BREACHED
        - PREVIEW_CLOSE_ONLY_FAILURE
        - PREVIEW_UBO_HIGH_LEVERAGE_NOTIONAL_BREACHED
        - PREVIEW_END_TIME_TOO_FAR_IN_FUTURE
        - PREVIEW_LIMIT_PRICE_TOO_FAR_FROM_MARKET
        - PREVIEW_FUTURES_AFTER_HOUR_INVALID_ORDER_TYPE
        - PREVIEW_FUTURES_AFTER_HOUR_INVALID_TIME_IN_FORCE
        - PREVIEW_INVALID_ATTACHED_TAKE_PROFIT_PRICE
        - PREVIEW_INVALID_ATTACHED_STOP_LOSS_PRICE
        - PREVIEW_INVALID_ATTACHED_TAKE_PROFIT_PRICE_PRECISION
        - PREVIEW_INVALID_ATTACHED_STOP_LOSS_PRICE_PRECISION
        - PREVIEW_INVALID_ATTACHED_TAKE_PROFIT_PRICE_OUT_OF_BOUNDS
        - PREVIEW_INVALID_ATTACHED_STOP_LOSS_PRICE_OUT_OF_BOUNDS
        - PREVIEW_INVALID_BRACKET_ORDER_SIDE
        - PREVIEW_BRACKET_ORDER_SIZE_EXCEEDS_POSITION
        - PREVIEW_ORDER_SIZE_EXCEEDS_BRACKETED_POSITION
        - PREVIEW_INVALID_LIMIT_PRICE_PRECISION
        - PREVIEW_INVALID_STOP_TRIGGER_PRICE_PRECISION
        - >-
          PREVIEW_INVALID_ATTACHED_TAKE_PROFIT_PRICE_EXCEEDS_MAX_DISTANCE_FROM_ORIGINATING_PRICE
        - PREVIEW_INVALID_ATTACHED_TAKE_PROFIT_SIZE_BELOW_MIN
        - PREVIEW_ATTACHED_ORDER_SIZE_MUST_BE_NIL
        - PREVIEW_BELOW_MIN_SIZE_FOR_DURATION
        - PREVIEW_MAX_DAILY_VOLUME_NOTIONAL_BREACHED
        - PREVIEW_INVALID_SETTLEMENT_CURRENCY
        - PREVIEW_DURATION_TOO_SMALL
        - PREVIEW_INTX_FOK_ONLY_ALLOWED_ON_LIMIT_AND_MARKET_ORDERS
        - PREVIEW_BUCKET_SIZE_SMALLER_THAN_QUOTE_MIN
        - PREVIEW_BUCKET_SIZE_SMALLER_THAN_BASE_MIN
        - PREVIEW_END_TIME_AFTER_CONTRACT_EXPIRATION
        - PREVIEW_START_TIME_MUST_BE_SPECIFIED
        - PREVIEW_ICEBERG_ORDERS_NOT_SUPPORTED
        - PREVIEW_END_TIME_IS_IN_THE_PAST
        - PREVIEW_GTD_ORDERS_MUST_HAVE_END_TIME
        - PREVIEW_ATTACHED_ORDER_MUST_HAVE_POSITIVE_PRICES
        - PREVIEW_INVALID_ORDER_SIDE_FOR_ATTACHED_TPSL
        - PREVIEW_ATTACHED_ORDERS_ONLY_ALLOWED_ON_MARKET_LIMIT
        - PREVIEW_INVALID_ORDER_TYPE_FOR_ATTACHED
        - PREVIEW_PRICE_NOT_ALLOWED_FOR_MARKET_ORDERS
        - PREVIEW_REDUCE_ONLY_NOT_ALLOWED_ON_VENUE
        - PREVIEW_NON_NUMERIC_ORDER_SIZE
        - PREVIEW_INVALID_INTX_CLIENT_ORDER_ID
        - PREVIEW_DURATION_TOO_LARGE
        - PREVIEW_REDUCE_ONLY_NOT_ALLOWED_ON_SPOT_PRODUCTS
        - PREVIEW_LIMIT_ORDER_PRICE_EXCEEDS_PRICE_BAND_ON_BUY
        - PREVIEW_LIMIT_ORDER_PRICE_EXCEEDS_PRICE_BAND_ON_SELL
        - >-
          PREVIEW_INVALID_ATTACHED_TAKE_PROFIT_PRICE_OUT_OF_BOUNDS_ON_AGGRESSIVE_ORDER
        - >-
          PREVIEW_INVALID_ATTACHED_STOP_LOSS_PRICE_OUT_OF_BOUNDS_ON_AGGRESSIVE_ORDER
        - PREVIEW_STOP_TRIGGERED
        - PREVIEW_REPLACE_NOT_SUPPORTED
        - PREVIEW_ORDER_IS_PENDING_CANCEL
        - PREVIEW_POSITION_SIZE_INCREASE_REJECT
        - PREVIEW_ASSET_BALANCE_INCREASE_REJECT
        - PREVIEW_TOO_MANY_PENDING_REPLACES
        - PREVIEW_INVALID_RFQ_BASE_SIZE_TOO_SMALL
        - PREVIEW_INVALID_RFQ_BASE_SIZE_TOO_LARGE
        - PREVIEW_INVALID_RFQ_QUOTE_SIZE_TOO_SMALL
        - PREVIEW_INVALID_RFQ_QUOTE_SIZE_TOO_LARGE
        - PREVIEW_REDUCE_ONLY_INCREASED_POSITION_SIZE
        - PREVIEW_COMPLIANCE_PURCHASE_LIMIT_EXCEEDED
        - PREVIEW_SCALED_PARAM_INFEASIBLE
        - PREVIEW_SCALED_MIN_ORDER_VIOLATION
        - PREVIEW_SCALED_MAX_ORDER_VIOLATION
        - PREVIEW_POST_ONLY_NOT_ALLOWED_WITH_PEG
        - PREVIEW_INVALID_PEG_OFFSET
        - PREVIEW_INVALID_PEG_WIG_LEVEL
        - PREVIEW_INVALID_PEG_VENUE_OPTIONS
        - PREVIEW_PEG_INVALID_ORDER_TYPE
        - PREVIEW_SINGLE_LEGGED_TPSL_NOT_ALLOWED
        - PREVIEW_FRACTIONAL_ORDERS_NOT_ALLOWED_FOR_PRODUCT
        - PREVIEW_QUOTE_ORDERS_NOT_ALLOWED_FOR_PRODUCT
        - PREVIEW_NBBO_NOT_PROVIDED
        - PREVIEW_INVALID_NBBO_BID_PRICE
        - PREVIEW_INVALID_NBBO_ASK_PRICE
        - PREVIEW_NOTIONAL_SIZE_BREACHES_FRACTIONAL_MINIMUM
        - PREVIEW_MARKET_ORDERS_PROHIBITED_DURING_NON_CORE_SESSION
        - PREVIEW_NOTIONAL_ORDERS_PROHIBITED_DURING_NON_CORE_SESSION
        - PREVIEW_MAX_NOTIONAL_PER_ORDER_BREACHED_15C35_CHECK
        - PREVIEW_MAX_SHARES_PER_ORDER_BREACHED_15C35_CHECK
        - PREVIEW_INVALID_EQUITY_TRADING_SESSION
        - PREVIEW_PRODUCT_TRADING_HALTED
        - PREVIEW_TRADING_DISABLED
        - PREVIEW_INVALID_BRACKET_LIMIT_PRICE_PRECISION
        - PREVIEW_SCALED_PARAM_DISCREPANCY
        - PREVIEW_STOP_LOSS_PRICE_TOO_LOW
        - PREVIEW_PREDICTIONS_QUOTE_SIZE_BELOW_MIN_CONTRACT_PRICE
        - PREVIEW_PREDICTIONS_HIGH_PRICE_CONTRACTS_BLOCKED
        - PREVIEW_ATTACHED_STOP_LOSS_PRICE_TOO_LOW
        - PREVIEW_BREACHED_RISK_LIMIT
        - PREVIEW_STOP_LOSS_PRICE_TOO_HIGH
        - PREVIEW_ATTACHED_STOP_LOSS_PRICE_TOO_HIGH
        - PREVIEW_TAKE_PROFIT_PRICE_TOO_HIGH
        - PREVIEW_ATTACHED_TAKE_PROFIT_PRICE_TOO_HIGH
        - PREVIEW_TAKE_PROFIT_PRICE_TOO_LOW
        - PREVIEW_ATTACHED_TAKE_PROFIT_PRICE_TOO_LOW
      default: UNKNOWN_PREVIEW_FAILURE_REASON
    coinbase.public_api.authed.retail_brokerage_api.TriggerBracketPnl:
      type: object
      properties:
        take_profit_pnl:
          type: string
          description: PNL if an attached order fills at the take profit price.
        stop_loss_pnl:
          type: string
          description: PNL if an attached order fills at the stop loss price
      title: PNL Configurations
    coinbase.public_api.authed.retail_brokerage_api.MarketMarketIoc:
      type: object
      properties:
        quote_size:
          type: string
          example: '10.00'
          description: >-
            The amount of the second Asset in the Trading Pair. For example, on
            the BTC/USD Order Book, USD is the Quote Asset.
        base_size:
          type: string
          example: '0.001'
          description: >-
            The amount of the first Asset in the Trading Pair. For example, on
            the BTC-USD Order Book, BTC is the Base Asset.
        rfq_disabled:
          type: boolean
          description: >-
            If true, or if the user is a non-EU region user, this order will be
            attempted to be routed to the exchange CLOB.
      title: Order entry configurations
    coinbase.public_api.authed.retail_brokerage_api.MarketMarketFok:
      type: object
      properties:
        quote_size:
          type: string
          example: '10.00'
          description: >-
            The amount of the second Asset in the Trading Pair. For example, on
            the BTC/USD Order Book, USD is the Quote Asset.
        base_size:
          type: string
          example: '0.001'
          description: >-
            The amount of the first Asset in the Trading Pair. For example, on
            the BTC-USD Order Book, BTC is the Base Asset.
        rfq_disabled:
          type: boolean
          description: >-
            If true, or if the user is a non-EU region user, this order will be
            attempted to be routed to the exchange CLOB.
    coinbase.public_api.authed.retail_brokerage_api.SorLimitIoc:
      type: object
      properties:
        quote_size:
          type: string
          example: '10.00'
          description: >-
            The amount of the second Asset in the Trading Pair. For example, on
            the BTC/USD Order Book, USD is the Quote Asset.
        base_size:
          type: string
          example: '0.001'
          description: >-
            The amount of the first Asset in the Trading Pair. For example, on
            the BTC-USD Order Book, BTC is the Base Asset.
        limit_price:
          type: string
          example: '10000.00'
          description: >-
            The specified price, or better, that the Order should be executed
            at. A Buy Order will execute at or lower than the limit price. A
            Sell Order will execute at or higher than the limit price.
        rfq_disabled:
          type: boolean
          description: >-
            If true, or if the user is a non-EU region user, this order will be
            attempted to be routed to the exchange CLOB.
    coinbase.public_api.authed.retail_brokerage_api.LimitLimitGtc:
      type: object
      properties:
        quote_size:
          type: string
          example: '10.00'
          description: >-
            The amount of the second Asset in the Trading Pair. For example, on
            the BTC/USD Order Book, USD is the Quote Asset.
        base_size:
          type: string
          example: '0.001'
          description: >-
            The amount of the first Asset in the Trading Pair. For example, on
            the BTC-USD Order Book, BTC is the Base Asset.
        limit_price:
          type: string
          example: '10000.00'
          description: >-
            The specified price, or better, that the Order should be executed
            at. A Buy Order will execute at or lower than the limit price. A
            Sell Order will execute at or higher than the limit price.
        post_only:
          type: boolean
          example: false
          description: >-
            Enable or disable Post-only Mode. When enabled, only Maker Orders
            will be posted to the Order Book. Orders that will be posted as a
            Taker Order will be rejected.
        rfq_disabled:
          type: boolean
          description: >-
            If true, or if the user is a non-EU region user, this order will be
            attempted to be routed to the exchange CLOB.
    coinbase.public_api.authed.retail_brokerage_api.LimitLimitGtd:
      type: object
      properties:
        quote_size:
          type: string
          example: '10.00'
          description: >-
            The amount of the second Asset in the Trading Pair. For example, on
            the BTC/USD Order Book, USD is the Quote Asset.
        base_size:
          type: string
          example: '0.001'
          description: >-
            The amount of the first Asset in the Trading Pair. For example, on
            the BTC-USD Order Book, BTC is the Base Asset.
        limit_price:
          type: string
          example: '10000.00'
          description: >-
            The specified price, or better, that the Order should be executed
            at. A Buy Order will execute at or lower than the limit price. A
            Sell Order will execute at or higher than the limit price.
        end_time:
          type: string
          format: RFC3339 Timestamp
          example: '2021-05-31T09:59:59.000Z'
          description: The time at which the order will be cancelled if it is not Filled.
        post_only:
          type: boolean
          example: false
          description: >-
            Enable or disable Post-only Mode. When enabled, only Maker Orders
            will be posted to the Order Book. Orders that will be posted as a
            Taker Order will be rejected.
    coinbase.public_api.authed.retail_brokerage_api.LimitLimitFok:
      type: object
      properties:
        quote_size:
          type: string
          example: '10.00'
          description: >-
            The amount of the second Asset in the Trading Pair. For example, on
            the BTC/USD Order Book, USD is the Quote Asset.
        base_size:
          type: string
          example: '0.001'
          description: >-
            The amount of the first Asset in the Trading Pair. For example, on
            the BTC-USD Order Book, BTC is the Base Asset.
        limit_price:
          type: string
          example: '10000.00'
          description: >-
            The specified price, or better, that the Order should be executed
            at. A Buy Order will execute at or lower than the limit price. A
            Sell Order will execute at or higher than the limit price.
        rfq_disabled:
          type: boolean
          description: >-
            If true, or if the user is a non-EU region user, this order will be
            attempted to be routed to the exchange CLOB.
    coinbase.public_api.authed.retail_brokerage_api.TwapLimitGtd:
      type: object
      properties:
        quote_size:
          type: string
          example: '10.00'
          description: >-
            The amount of the second Asset in the Trading Pair. For example, on
            the BTC/USD Order Book, USD is the Quote Asset.
        base_size:
          type: string
          example: '0.001'
          description: >-
            The amount of the first Asset in the Trading Pair. For example, on
            the BTC-USD Order Book, BTC is the Base Asset.
        start_time:
          type: string
          format: RFC3339 Timestamp
          example: '2021-05-31T07:59:59.000Z'
          description: Time at which the order should begin executing.
        end_time:
          type: string
          format: RFC3339 Timestamp
          example: '2021-05-31T09:59:59.000Z'
          description: The time at which the order will be cancelled if it is not Filled.
        limit_price:
          type: string
          example: '10000.00'
          description: >-
            The specified price, or better, that the Order should be executed
            at. A Buy Order will execute at or lower than the limit price. A
            Sell Order will execute at or higher than the limit price.
        number_buckets:
          type: string
          example: '5'
          description: >-
            The number of smaller buckets/suborders over which the entire order
            will be broken into. Each suborder will be executed over a duration
            calculated based on the end_time
        bucket_size:
          type: string
          example: '2.00'
          description: >-
            The size of each suborder. bucket_size multiplied by number_buckets
            should match the size of the entire twap order)
        bucket_duration:
          type: string
          example: 300s
          description: The duration over which each sub order was executed
    coinbase.public_api.authed.retail_brokerage_api.StopLimitStopLimitGtc:
      type: object
      properties:
        base_size:
          type: string
          example: '0.001'
          description: >-
            The amount of the first Asset in the Trading Pair. For example, on
            the BTC-USD Order Book, BTC is the Base Asset.
        limit_price:
          type: string
          example: '10000.00'
          description: >-
            The specified price, or better, that the Order should be executed
            at. A Buy Order will execute at or lower than the limit price. A
            Sell Order will execute at or higher than the limit price.
        stop_price:
          type: string
          example: '20000.00'
          description: The specified price that will trigger the placement of the Order.
        stop_direction:
          example: '20000.00'
          description: >-
            The direction of the stop limit Order. If Up, then the Order will
            trigger when the last trade price goes above the stop_price. If
            Down, then the Order will trigger when the last trade price goes
            below the stop_price.
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.StopPriceDirection
    coinbase.public_api.authed.retail_brokerage_api.StopLimitStopLimitGtd:
      type: object
      properties:
        base_size:
          type: string
          example: 0.001
          description: >-
            The amount of the first Asset in the Trading Pair. For example, on
            the BTC-USD Order Book, BTC is the Base Asset.
        limit_price:
          type: string
          example: '10000.00'
          description: >-
            The specified price, or better, that the Order should be executed
            at. A Buy Order will execute at or lower than the limit price. A
            Sell Order will execute at or higher than the limit price.
        stop_price:
          type: string
          example: '20000.00'
          description: The specified price that will trigger the placement of the Order.
        end_time:
          type: string
          format: RFC3339 Timestamp
          example: '2021-05-31T09:59:59.000Z'
          description: The time at which the order will be cancelled if it is not Filled.
        stop_direction:
          example: '20000.00'
          description: >-
            The direction of the stop limit Order. If Up, then the Order will
            trigger when the last trade price goes above the stop_price. If
            Down, then the Order will trigger when the last trade price goes
            below the stop_price.
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.StopPriceDirection
    coinbase.public_api.authed.retail_brokerage_api.TriggerBracketGtc:
      type: object
      properties:
        base_size:
          type: string
          example: 0.001
          description: >-
            The amount of the first Asset in the Trading Pair. For example, on
            the BTC-USD Order Book, BTC is the Base Asset.
        limit_price:
          type: string
          example: '10000.00'
          description: >-
            The specified price, or better, that the Order should be executed
            at. A Buy Order will execute at or lower than the limit price. A
            Sell Order will execute at or higher than the limit price.
        stop_trigger_price:
          type: string
          example: '20000.00'
          description: >-
            The price level (in quote currency) where the position will be
            exited. When triggered, a stop limit order is automatically placed
            with a limit price 5% higher for BUYS and 5% lower for SELLS.
    coinbase.public_api.authed.retail_brokerage_api.TriggerBracketGtd:
      type: object
      properties:
        base_size:
          type: string
          example: 0.001
          description: >-
            The amount of the first Asset in the Trading Pair. For example, on
            the BTC-USD Order Book, BTC is the Base Asset.
        limit_price:
          type: string
          example: '10000.00'
          description: >-
            The specified price, or better, that the Order should be executed
            at. A Buy Order will execute at or lower than the limit price. A
            Sell Order will execute at or higher than the limit price.
        stop_trigger_price:
          type: string
          example: '20000.00'
          description: >-
            The price level (in quote currency) where the position will be
            exited. When triggered, a stop limit order is automatically placed
            with a limit price 5% higher for BUYS and 5% lower for SELLS.
        end_time:
          type: string
          format: RFC3339 Timestamp
          example: '2021-05-31T09:59:59.000Z'
          description: The time at which the order will be cancelled if it is not Filled.
    coinbase.public_api.authed.retail_brokerage_api.ScaledLimitGtc:
      type: object
      properties:
        orders:
          type: array
          items:
            $ref: >-
              #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.LimitLimitGtc
        quote_size:
          type: string
        base_size:
          type: string
        num_orders:
          type: integer
          format: int32
        min_price:
          type: string
          title: >-
            infer the start / end price of the scaled orders based on the min /
            max price + distribution
        max_price:
          type: string
        price_distribution:
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.ScaledPriceDistribution
        size_distribution:
          description: 'Size distribution across the child orders. '
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.ScaledSizeDistribution
        size_diff:
          type: string
        size_ratio:
          type: string
      title: >-
        scaled limit order allows user to specify the order size and price on
        the child
    coinbase.public_api.authed.retail_brokerage_api.StopPriceDirection:
      type: string
      enum:
        - STOP_DIRECTION_STOP_UP
        - STOP_DIRECTION_STOP_DOWN
      default: ''
      title: >-
        - STOP_DIRECTION_STOP_UP: Order will trigger if the last trade price
        goes above the stop price
         - STOP_DIRECTION_STOP_DOWN: Order will trigger if the last trade price goes below the stop price
    coinbase.public_api.authed.retail_brokerage_api.ScaledPriceDistribution:
      type: string
      enum:
        - FLAT
        - LINEAR_INCREASING
        - LINEAR_DECREASING
        - CUSTOM_PRICE_DISTRIBUTION
      default: FLAT
      title: Defines the distribution of prices for scaled orders
    coinbase.public_api.authed.retail_brokerage_api.ScaledSizeDistribution:
      type: string
      enum:
        - UNKNOWN_DISTRIBUTION
        - INCREASING
        - DECREASING
        - EVENLY_SPLIT
        - CUSTOM_SIZE_DISTRIBUTION
      default: UNKNOWN_DISTRIBUTION
      title: Defines the distribution of sizes for scaled orders
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        A JWT signed using your CDP API Key Secret, encoded in base64. Refer to
        the [Creating API
        Keys](/coinbase-app/authentication-authorization/api-key-authentication)
        section of our Coinbase App Authentication docs for information on how
        to generate your Bearer Token.

````