401 access denied in /order/placeorder

EDITED

I had a similar error which was pretty baffling.

Error: 401 Access Denied
When placing and order in LIVE mode.
When I run the EXACT same code in demo it placed the order without error.

The only difference between code was the URL.

It worked in Demo… Failed Live.

I traced this back to a device-id being incorrect. Apparently demo is not concerned with ensuring that the device id is correct… and live enforces it.

I hope this helps someone.

Developer note:

  1. Demo behavior should always match Live/Prod. Perhaps fix demo to enforce the device-id?
  2. Why is id device id required only for orders after allowing login, quotes, and a number of other endpoints to function?
  3. Thank goodness the API was still functioning during non-market hours (denying/allowing orders but not sending them)…or I would have wasted money sending orders into the live market just to test/debug this.
3 Likes