Not authorized for device_id

Hi, I am creating a custom app for myself (NOT TO SELL). After reading the docs and asking questions here I was able to get the app running in the sandbox successfully. Since my tests were good, i bought a terminal to connect to it via the Terminal API.

From my custom app, i can call the CreateDeviceCode api and create a code and use it to login to my terminal. The terminal accepted the code and it is now paired. I have verified this with the GetDeviceCode api call. I also see the terminal connected and paired in my square account.

When i try to use the API to create a checkout ( CreateTerminalCheckout, i get the following error:

  "errors": [
      "code": "BAD_REQUEST",
      "detail": "Merchant not authorized for device_id=DEVICE_ID_HERE",
      "category": "INVALID_REQUEST_ERROR"

Can someone point me to why I am getting this error. I believe as per the docs and the responses i got here, i do not need to request permission via OAUTH since this app is not for sale or in the app market. Any advice? Thank you.

What’s your location_id and where are you testing? :slightly_smiling_face:

Default location. Do u need me to post the actual id here?

Yes, please. Also are you physically in one of our supported regions? :slightly_smiling_face:

my location_id is LQC8J7MVVD0P9 and yes, i am physically in a supported region.

It looks like everything is good with the account. The device_id that your passing in does it look something like 952CS108A6002588? :slightly_smiling_face:

No, i basically created a new code via the api CreateDeviceCode and the new device id is N#######

That’s not a device_id. You’ll need to get the actual device_id after it’s paired. That looks like the id of the generated device_code. The checkout is expecting the device_id. :slightly_smiling_face: