Calling List Orders vs. using the User Channel

i noticed that there are two ways to monitor open orders:

(1) calling /api/v3/brokerage/orders/historical/batch?order_status=OPEN (this one is limited to 1000 open orders)

(2) subscribe to the ‘user’ channel

i prefer using option #2, but i noticed when i subscribe to the user channel, the response is missing the productId associated with the order:

{
  "channel": "user",
  "client_id": "",
  "timestamp": "2022-12-14T15:09:09.170869186Z",
  "sequence_num": 3,
  "events": [
    {
      "type": "update",
      "orders": [
        {
          "order_id": "xxxxxxxxxxx",
          "client_order_id": "yyyyyyyyyyyyyyy",
          "cumulative_quantity": "0",
          "leaves_quantity": "202",
          "avg_price": "0",
          "total_fees": "0",
          "status": "OPEN"
        }
      ]
    }
  ]
}

productId is important piece of information as it identifies the currencyPair (i.e., BTC-USD) that this order is associated with.

i can obtain that by making a 2nd call to the /api/v3/brokerage/orders/historical/{order_id} endpoint to figure out the productId. is that the recommended way of doing it?

1 Like

Hello @unk1911! Thank you for taking an interest in trying out Coinbase APIs. For the details regarding your concern, we will check on this for you with our team. We will get back to you once we have more information. Keep in touch!

3 Likes

Hi @unk1911! We appreciate your patience as we look into this.

We wish to inform you that we’ve logged your feedback about including the product_id in the List Orders and User Channel response data with our internal teams so we can continue improving our user experience. Most new features and improvements to our products come directly from feedback like yours, so it’s very valuable to us. While we can’t offer any specific timeline for adding features, we are constantly working to improve and build products our customers will love.

In the meantime, we advise that you stick with the workaround you are utilizing that involves calling for the Get Orders endpoint to figure out the product_id of the currency pair that the order is associated with.

We hope we are able to give clarity to your concern. Thank you and have a great day!

4 Likes

I noticed that the following four fields were added to user channel for order/fill on Dec 20, 2022:

        'order_side',
        'order_type',
        'creation_time',
        'product_id',

Thanks to the team. This is very helpful!

3 Likes

Hi @dpkw! Thank you for flagging this update in the documentation. Please note that this has already been reflected in the Changelog section of the Coinbase Cloud documentation. Looping you in @unk1911 :wave:

Have a great day!

4 Likes