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

# Get Order

> Get a single order by order ID.



## OpenAPI

````yaml GET  /api/v3/brokerage/orders/historical/{order_id}
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/historical/{order_id}:
    get:
      tags:
        - Orders
      summary: Get Order
      description: Get a single order by order ID.
      operationId: RetailBrokerageApi_GetHistoricalOrder
      parameters:
        - name: order_id
          description: The ID of the order.
          in: path
          required: true
          schema:
            type: string
        - name: client_order_id
          description: '**(Deprecated)** Client Order ID to fetch the order with.'
          in: query
          required: false
          schema:
            type: string
        - name: user_native_currency
          description: >-
            **(Deprecated)**  Native currency to fetch order with. Default is
            `USD`.
          in: query
          required: false
          schema:
            type: string
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.GetHistoricalOrderResponse
            text/event-stream:
              schema:
                $ref: >-
                  #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.GetHistoricalOrderResponse
        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:
  schemas:
    coinbase.public_api.authed.retail_brokerage_api.GetHistoricalOrderResponse:
      type: object
      properties:
        order:
          description: The retrieved order.
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.Order
    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.Order:
      type: object
      properties:
        order_id:
          type: string
          example: 0000-000000-000000
          description: The ID of the order.
          required:
            - order_id
        product_id:
          type: string
          example: BTC-USD
          description: The trading pair (e.g. 'BTC-USD').
          required:
            - product_id
        user_id:
          type: string
          example: 2222-000000-000000
          description: The id of the User owning this Order
          required:
            - user_id
        order_configuration:
          description: The configuration of the order (e.g. the order type, size, etc).
          required:
            - order_configuration
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.OrderConfiguration
        side:
          description: The side of the market that the order is on (e.g. 'BUY', 'SELL').
          required:
            - side
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.OrderSide
        client_order_id:
          type: string
          example: 11111-000000-000000
          description: >-
            The unique ID provided for the order (used for identification
            purposes).
          required:
            - client_order_id
        status:
          description: The current state of the order
          required:
            - status
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.OrderExecutionStatus
        time_in_force:
          description: The client specified window for which the order can remain active
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.TimeInForceType
        created_time:
          type: string
          format: RFC3339 Timestamp
          example: '2021-05-31T09:59:59.000Z'
          description: Timestamp for when the order was created
          required:
            - created_time
        completion_percentage:
          type: string
          example: '50'
          description: The percent of total order amount that has been filled
          required:
            - completion_percentage
        filled_size:
          type: string
          example: '0.001'
          description: >-
            The portion (in base currency) of total order amount that has been
            filled
        average_filled_price:
          type: string
          example: '50'
          description: The average of all prices of fills for this order
          required:
            - average_filled_price
        fee:
          type: string
          description: '**(Deprecated)**  Commission amount'
        number_of_fills:
          type: string
          example: '2'
          description: Number of fills that have been posted for this order
          required:
            - number_of_fills
        filled_value:
          type: string
          example: '10000'
          description: >-
            The portion (in quote current) of total order amount that has been
            filled
        pending_cancel:
          type: boolean
          example: true
          description: >-
            Whether a cancel request has been initiated for the order, and not
            yet completed
          required:
            - pending_cancel
        size_in_quote:
          type: boolean
          example: false
          description: Whether the order was placed with quote currency
          required:
            - size_in_quote
        total_fees:
          type: string
          example: '5.00'
          description: The total fees for the order
          required:
            - total_fees
        size_inclusive_of_fees:
          type: boolean
          example: false
          description: Whether the order size includes fees
          required:
            - size_inclusive_of_fees
        total_value_after_fees:
          type: string
          description: >-
            derived field: filled_value + total_fees for buy orders and
            filled_value - total_fees for sell orders.
          required:
            - total_value_after_fees
        trigger_status:
          description: The trigger status of the order, with respect to stop price.
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.StopTriggerStatus
        order_type:
          description: Type of the order
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.OrderType
        reject_reason:
          description: Reason the order was rejected.
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.RejectReason
        settled:
          type: boolean
          description: True if the order is fully filled, false otherwise.
        product_type:
          description: The type of order, i.e. Spot or Future
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.ProductType
        reject_message:
          type: string
          description: Message stating why the order was rejected.
        cancel_message:
          type: string
          description: Message stating why the order was canceled.
        order_placement_source:
          description: Message stating which source an order was placed from.
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.OrderPlacementSource
        outstanding_hold_amount:
          type: string
          description: >-
            The remaining hold amount (holdAmount - holdAmountReleased). [value
            is 0 if holdReleased is true]
        is_liquidation:
          type: boolean
          description: True if order is of liquidation type.
        last_fill_time:
          type: string
          format: RFC3339 Timestamp
          description: Time of the most recent fill for this order
        edit_history:
          type: array
          items:
            $ref: >-
              #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.Edit
          description: An array of the latest 5 edits per order
        leverage:
          type: string
          description: The amount of leverage for the order (default is 1.0).
        margin_type:
          description: Margin Type for this order (default is CROSS).
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.MarginType
        retail_portfolio_id:
          type: string
          example: b87a2d3f-8a1e-49b3-a4ea-402d8c389aca
          description: The ID of the portfolio this order is associated with.
        originating_order_id:
          type: string
          example: b87a2d3f-8a1e-49b3-a4ea-402d8c389aca
          description: The ID of the parent order of an attached order.
        attached_order_id:
          type: string
          example: b87a2d3f-8a1e-49b3-a4ea-402d8c389aca
          description: The ID of the attached order of a parent order.
        attached_order_configuration:
          description: >-
            The configuration of the attached order. Only TriggerBracketGtc is
            eligible. Size field must be omitted as the size of the attached
            order is the same as that of the originating or parent order.
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.OrderConfiguration
        current_pending_replace:
          description: Price/Size of the current edit
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.Edit
        commission_detail_total:
          description: Breakdown of commission charges for the order
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.CommissionDetailTotal
        workable_size:
          type: string
          example: '3'
          description: The size of order in the originating order which is filled.
        workable_size_completion_pct:
          type: string
          example: '50'
          description: Percentage of the originating order which is filled
        product_details:
          description: Product-specific details, the oneof corresponds to the ProductType
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.ProductDetails
        cost_basis_method:
          description: The cost basis method for the order
          allOf:
            - $ref: '#/components/schemas/coinbase.positions.CostBasisMethod'
        displayed_order_config:
          description: >-
            Indicates how an order configuration is displayed to the user by the
            front end
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.DisplayedOrderConfig
        equity_trading_session:
          description: Trading session for equity orders
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.EquityTradingSession
        prediction_side:
          description: Direction of the prediction market order (YES or NO)
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.PredictionSide
        last_update_time:
          type: string
          format: RFC3339 Timestamp
          description: >-
            Time of the latest update to this order. It is defined as the time
            of the most recent fill if the order has any fills. Else this
            timestamp will be the order creation time.
      required:
        - order_id
        - product_id
        - side
        - created_time
        - status
        - user_id
        - order_configuration
        - client_order_id
        - completion_percentage
        - average_filled_price
        - number_of_fills
        - pending_cancel
        - size_in_quote
        - total_fees
        - size_inclusive_of_fees
        - total_value_after_fees
    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.OrderSide:
      type: string
      enum:
        - BUY
        - SELL
      default: ''
    coinbase.public_api.authed.retail_brokerage_api.OrderExecutionStatus:
      type: string
      enum:
        - PENDING
        - OPEN
        - FILLED
        - CANCELLED
        - EXPIRED
        - FAILED
        - UNKNOWN_ORDER_STATUS
        - QUEUED
        - CANCEL_QUEUED
        - EDIT_QUEUED
      default: PENDING
    coinbase.public_api.authed.retail_brokerage_api.TimeInForceType:
      type: string
      enum:
        - UNKNOWN_TIME_IN_FORCE
        - GOOD_UNTIL_DATE_TIME
        - GOOD_UNTIL_CANCELLED
        - IMMEDIATE_OR_CANCEL
        - FILL_OR_KILL
      default: UNKNOWN_TIME_IN_FORCE
      title: |-
        - GOOD_UNTIL_DATE_TIME: GTD
         - GOOD_UNTIL_CANCELLED: GTC: on the books virtually forever
         - IMMEDIATE_OR_CANCEL: IOC: fill what you can now, cancel the rest
         - FILL_OR_KILL: FOK: all or nothing, right now
    coinbase.public_api.authed.retail_brokerage_api.StopTriggerStatus:
      type: string
      enum:
        - UNKNOWN_TRIGGER_STATUS
        - INVALID_ORDER_TYPE
        - STOP_PENDING
        - STOP_TRIGGERED
      default: UNKNOWN_TRIGGER_STATUS
    coinbase.public_api.authed.retail_brokerage_api.OrderType:
      type: string
      enum:
        - UNKNOWN_ORDER_TYPE
        - MARKET
        - LIMIT
        - STOP
        - STOP_LIMIT
        - BRACKET
        - TWAP
        - ROLL_OPEN
        - ROLL_CLOSE
        - LIQUIDATION
        - SCALED
      default: UNKNOWN_ORDER_TYPE
      title: >-
        - MARKET: A [market
        order](https://en.wikipedia.org/wiki/Order_(exchange)#Market_order)
         - LIMIT: A [limit order](https://en.wikipedia.org/wiki/Order_(exchange)#Limit_order)
         - STOP: A stop order is an order that becomes a market order when triggered
         - STOP_LIMIT: A stop order is a limit order that doesn't go on the book until it hits the stop price
         - BRACKET: A bracket order is a way to mitigate potential losses in volatile markets, consisting of a limit price leg and a stop trigger price.
         - TWAP: TWAP order is a way to split large buy/sell orders to smaller chunks to reduce market impact
         - ROLL_OPEN: ROLL_OPEN order is the open step order of a contract roll
         - ROLL_CLOSE: ROLL_CLOSE is the close step order in a contract roll
         - LIQUIDATION: LIQUIDATION is a special order type that is used to liquidate a position
         - SCALED: SCALED order is an order that is split into multiple child orders at incrementally increasing or decreasing prices
    coinbase.public_api.authed.retail_brokerage_api.RejectReason:
      type: string
      enum:
        - REJECT_REASON_UNSPECIFIED
        - HOLD_FAILURE
        - TOO_MANY_OPEN_ORDERS
        - REJECT_REASON_INSUFFICIENT_FUNDS
        - RATE_LIMIT_EXCEEDED
      default: REJECT_REASON_UNSPECIFIED
    coinbase.public_api.authed.retail_brokerage_api.ProductType:
      type: string
      enum:
        - UNKNOWN_PRODUCT_TYPE
        - SPOT
        - FUTURE
      default: UNKNOWN_PRODUCT_TYPE
      description: Defines the type of a product.
    coinbase.public_api.authed.retail_brokerage_api.OrderPlacementSource:
      type: string
      enum:
        - UNKNOWN_PLACEMENT_SOURCE
        - RETAIL_SIMPLE
        - RETAIL_ADVANCED
      default: UNKNOWN_PLACEMENT_SOURCE
      title: OrderPlacementSource reflects which source an order was placed from
    coinbase.public_api.authed.retail_brokerage_api.Edit:
      type: object
      properties:
        price:
          type: string
          example: '19000.00'
          description: The update price of the order.
        size:
          type: string
          example: '0.001'
          description: The updated size of the order.
        replace_accept_timestamp:
          type: string
          format: RFC3339 Timestamp
    coinbase.public_api.authed.retail_brokerage_api.MarginType:
      type: string
      enum:
        - CROSS
        - ISOLATED
      default: ''
      description: >-
        - CROSS: Cross margin applies margin to the position of the entire
        portfolio
         - ISOLATED: Isolated margin applies margin to a single position
      title: >-
        MarginType reflects the margin type of an order, used for Intx Perps
        trades
    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.ProductDetails:
      type: object
      properties:
        equity_details:
          allOf:
            - $ref: >-
                #/components/schemas/coinbase.public_api.authed.retail_brokerage_api.EquityOrderProductDetails
      title: |-
        Product details, where the oneof corresponds to the ProductType
        Currently skipping FutureProductDetails as it's not used
    coinbase.positions.CostBasisMethod:
      type: string
      enum:
        - COST_BASIS_METHOD_UNSPECIFIED
        - COST_BASIS_METHOD_HIFO
        - COST_BASIS_METHOD_LIFO
        - COST_BASIS_METHOD_FIFO
      default: COST_BASIS_METHOD_UNSPECIFIED
      description: CostBasisMethod specifies the cost basis method for tax lot matching.
    coinbase.public_api.authed.retail_brokerage_api.DisplayedOrderConfig:
      type: string
      enum:
        - UNKNOWN_DISPLAYED_ORDER_CONFIG
        - INSTANT_GFD
        - LIMIT_GFD
        - LIMIT_GTC
      default: UNKNOWN_DISPLAYED_ORDER_CONFIG
      title: >-
        DisplayedOrderConfig indicates how an order configuration is displayed
        to the user by the front end
    coinbase.public_api.authed.retail_brokerage_api.EquityTradingSession:
      type: string
      enum:
        - UNKNOWN_EQUITY_TRADING_SESSION
        - EQUITY_TRADING_SESSION_NORMAL
        - EQUITY_TRADING_SESSION_AFTER_HOURS
        - EQUITY_TRADING_SESSION_MULTI_SESSION
        - EQUITY_TRADING_SESSION_OVERNIGHT
        - EQUITY_TRADING_SESSION_PRE_MARKET
      default: UNKNOWN_EQUITY_TRADING_SESSION
    coinbase.public_api.authed.retail_brokerage_api.PredictionSide:
      type: string
      enum:
        - PREDICTION_SIDE_UNKNOWN
        - PREDICTION_SIDE_YES
        - PREDICTION_SIDE_NO
      default: PREDICTION_SIDE_UNKNOWN
      description: >-
        Prediction market orders can be either a YES or NO.


        Under the hood, there is only a YES order book; NO orders are
        technically

        short positions on the YES order book.
    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.EquityOrderProductDetails:
      type: object
      properties:
        base_cbrn:
          type: string
        ticker:
          type: string
        quote_id:
          type: string
      title: Equity-specific product details
    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.

````