PATCH order not going through

I am working in Scala to wrap the API and I can get everything to work in the Orders API except for PATCH. I am using a library sttp to make the API calls and even though it may not be familiar I am sure the code is intuitive and my request is structured as follows

basicRequest.headers(Info.header).body(request_body).patch(uri"${Info.orders_endpoint}/$order_id")

I use the exact same structure for all my requests and they all work except in this case I use .patch and it does not and I get a error code of 422. The String I pass in as request_body would look something like this

{"qty":7,"time_in_force":"day","limit_price":"100"}

Anyone have any idea why I am getting code 422

Is the original order a limit order? How about trying with one parameter chane such as qty?

BTW I love the Scala-ish style of builder pattern.

Yeah, I figured it out. It was the weekend and I was just playing around trying to get things to work, but an order can’t be patched unless it’s sent to an exchange. When I tried it on a weekday it worked. Thanks!

1 Like

Make sense.

I really wish we had better way of testing in the night and weekend.