Status code 400
{“errors”: [{“code”: “BAD_REQUEST”,“detail”: “Merchant not authorized for device_id=device:id”,“category”: “INVALID_REQUEST_ERROR”}]}
Hi, I keep running into the error above, even after generating a device code, and calling the checkout API with the same access token. Anyone else run into this commonly?
I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:
If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.
This error typically occurs when the device_id you’re using in your request doesn’t match any of the device codes associated with your merchant account. Make sure that the device_id you’re using is the same as the one you generated for your device. Also, ensure that you’re using the correct access token that corresponds to the merchant account associated with the device. If the problem persists, you might want to try generating a new device code and ensure that it’s correctly associated with your merchant account.
Hi Bryan, thanks for the response. Yes I believe it was.
1st I ran the create device code API call, and used the resulting code to sign into the terminal.
Then I ran the /v2/terminals/checkouts to initiate a checkout, and that’s when I get the error. I am working with the same prod access token for all the calls.
No, the device_id isn’t in that endpoint. If you ListDeviceCodes it will have the code you’ll pass in CreateTerminalCheckout. For example here’s on from my account: