I am trying to handle partially_filled limit orders. I can’t seem simulate them in testnet, because there isn’t enough open sells with small qty. on coins to figure this out.

So lets say I have a limit order for 1 btc. And it gets partially filled with 0.5 btc.
Now, let’s say I’d like to cancel that unfilled portion of the partially filled order after some amount of time. So I use the orderid and cancel. What will the response be? Will the response status be “CANCELLED”?
And presumably the same orderid will be used to access the filled portion, so I can still query the status of the order with the same orderId? And the next time I query the status of the order it will say filled?

And final part, lets say I sell the filled portion. The rest of the unfilled part of the order, the response of querying that orderId will still say partially_filled?

Or am I missing something? I cannot find the answers to these questions on the entirety of the internet. I searched the whole thing. Not there.

When you cancel a partially filled order, the order status will change to CANCELED with executedQty > 0.
Here is an example:

    "symbol": "BNBUSDT",
    "orderId": *****,
    "orderListId": -1,
    "clientOrderId": "*****",
    "price": "*****",
    "origQty": "10.00000000",
    "executedQty": "0.03000000",
    "cummulativeQuoteQty": "*****",
    "status": "CANCELED",
    "timeInForce": "GTC",
    "type": "LIMIT",
    "side": "SELL",
    "stopPrice": "0.00000000",
    "icebergQty": "0.00000000",
    "time": 1630549329359,
    "updateTime": 1630549352771,
    "isWorking": true,
    "origQuoteOrderQty": "0.00000000"

Once an order is canceled, the status cannot be changed to filled anymore.