Cannot get orders by order_id but is returned via contract_id

An example of an order I have placed is:

{
	"contract_id": "35969169",
	"market_id": "10256720",
	"price": 5814,
	"quantity": 2000,
	"side": "buy",
	"type": "keep_in_play"
}

This places successfully & gives me the response of:

{
    "available_balance": "40.46",
    "available_quantity": 0,
    "contract_id": "35969169",
    "executed_avg_price": null,
    "exposure": "-0.12",
    "market_id": "10256720",
    "order_id": "202814786933026819",
    "orig_price": null,
    "price": 5814,
    "quantity": 2000,
    "side": "buy",
    "total_executed_quantity": 0
}

I deliberately posted an order that wouldn’t get matched immediately. When I try to do a GET request to /v3/orders/, I use the order_id which is specified in the docs. My request is: https://api.smarkets.com/v3/orders/id=202814786933026819

When I do this request, no orders get returned. However, if I use the contract_id so my request is: https://api.smarkets.com/v3/orders/contract_id=35969169, an order is returned.

This is not a massive inconvenience at the moment as I can use other criteria to get my order but I am wondering why this is not working.

Thank you :slight_smile:

Hey Will,

GET request to /v3/orders/ is limited to a maximum of 20 orders by default so if you have a bunch of bets your most recent orders might not get returned. Try calling it with a higher limit and see if that helps.