Get single order always returns an empty list

I’m trying to get a single order using a valid order_id but the API always returns an empty list. I double checked the order_id is valid too. Get single order

Hello @khancode, thank you for taking interest in using Coinbase APIs. May I ask what process did you use to check if the order ID is valid? Also, you may try to use the get all orders endpoint to check if the order ID is in the response. If the order ID is still not found, please provide us a screenshot of both endpoint responses (get all orders and get a single order) for us to check with our team. We will get back to you once we have more information. Keep in touch!

@camille.decastro Hi, here’s the process I used:

  1. Get all orders response:
[
  {
    "id": "aae5ff28-60a0-456d-a724-5487792c41be",
    "product_id": "BTC-USD",
    "profile_id": "4fbd8a11-5016-47af-9c82-31cfb1e41492",
    "side": "buy",
    "funds": "0.9940357800000000",
    "specified_funds": "1.0000000000000000",
    "type": "market",
    "post_only": false,
    "created_at": "2022-05-14T18:40:56.690482Z",
    "done_at": "2022-05-14T18:40:56.690482Z",
    "done_reason": "filled",
    "fill_fees": "0.0059639152482000",
    "filled_size": "0.00003367",
    "executed_value": "0.9939858747000000",
    "status": "done",
    "settled": true
  },
  ...
]
  1. Using order id aae5ff28-60a0-456d-a724-5487792c41be from get all orders response, I call get single order with path: /orders?order_id=aae5ff28-60a0-456d-a724-5487792c41be
    Response is an empty list:
[]

Hi @khancode , thank you for providing us the needed information to further investigate this issue and we apologize for the inconvenience this may have caused you. Upon checking, the path you provided us when getting a single order was using a query param “?order_id={order_id}”. Referencing from the documentation, can you try to use the path param “/{order_id}” for this specific endpoint? Please let us know if the issue still transpires.

3 Likes

@camille.decastro I switched it to being a path param and it works now! Thanks a lot! :blush:

4 Likes

Hello @khancode , it’s great knowing that the issue has been resolved. Thank you for your patience and support with Coinbase, we’ll continue to improve to give you better service. Let us know if there is anything we can help.

2 Likes