# I keep running into "merchant is not authorized for device ID" when attempting to call the terminal checkout API

**URL:** <https://developer.squareup.com/forums/t/i-keep-running-into-merchant-is-not-authorized-for-device-id-when-attempting-to-call-the-terminal-checkout-api/21964>\
**Category:** Questions\
**Tags:** terminal-api, checkout-api\
**Created:** [April 15, 2025, 10:04pm UTC](https://developer.squareup.com/forums/t/i-keep-running-into-merchant-is-not-authorized-for-device-id-when-attempting-to-call-the-terminal-checkout-api/21964 "2025-04-15T22:04:23Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![paljm](https://avatars.discourse-cdn.com/v4/letter/p/5f9b8f/32.png) [@paljm](https://developer.squareup.com/forums/u/paljm)\
**Post date:** [April 15, 2025, 10:04pm UTC](https://developer.squareup.com/forums/t/i-keep-running-into-merchant-is-not-authorized-for-device-id-when-attempting-to-call-the-terminal-checkout-api/21964/1 "2025-04-15T22:04:24Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Square-Dev-AI](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/square-dev-ai/32/2513_2.png) [@Square-Dev-AI](https://developer.squareup.com/forums/u/Square-Dev-AI)\
**Post date:** [April 15, 2025, 10:04pm UTC](https://developer.squareup.com/forums/t/i-keep-running-into-merchant-is-not-authorized-for-device-id-when-attempting-to-call-the-terminal-checkout-api/21964/2 "2025-04-15T22:04:34Z")

</div>

👋 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:

> **[Build with the Mobile Authorization API](https://developer.squareup.com/docs/mobile-authz/build-with-mobile-authz)**
>
> Build with the Mobile Authorization API to request authorization tokens to initialize Square mobile solutions like the Reader SDK.

> **[Troubleshoot In-App Payments SDK Problems](https://developer.squareup.com/docs/in-app-payments-sdk/troubleshooting)**
>
> Troubleshoot problems with the Square In-App Payments SDK.

> **Additional Documentation**
>
> [Handling Errors](https://developer.squareup.com/docs/build-basics/handling-errors)  
> [Troubleshoot the Payments API](https://developer.squareup.com/docs/payments-api/error-codes)  
> [Handling Errors](https://developer.squareup.com/docs/build-basics/general-considerations/handling-errors)

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.

---

<div class="post-metadata">

**Author:** ![Square-Dev-AI](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/square-dev-ai/32/2513_2.png) [@Square-Dev-AI](https://developer.squareup.com/forums/u/Square-Dev-AI)\
**Post date:** [April 15, 2025, 10:35pm UTC](https://developer.squareup.com/forums/t/i-keep-running-into-merchant-is-not-authorized-for-device-id-when-attempting-to-call-the-terminal-checkout-api/21964/3 "2025-04-15T22:35:08Z")

</div>

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.

_This answer was reviewed by @Bryan-Square._

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [April 15, 2025, 10:35pm UTC](https://developer.squareup.com/forums/t/i-keep-running-into-merchant-is-not-authorized-for-device-id-when-attempting-to-call-the-terminal-checkout-api/21964/4 "2025-04-15T22:35:13Z")

</div>

Was the device correctly paired prior to creating the checkout? 🙂

---

<div class="post-metadata">

**Author:** ![paljm](https://avatars.discourse-cdn.com/v4/letter/p/5f9b8f/32.png) [@paljm](https://developer.squareup.com/forums/u/paljm)\
**Post date:** [April 15, 2025, 10:39pm UTC](https://developer.squareup.com/forums/t/i-keep-running-into-merchant-is-not-authorized-for-device-id-when-attempting-to-call-the-terminal-checkout-api/21964/5 "2025-04-15T22:39:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [April 15, 2025, 10:41pm UTC](https://developer.squareup.com/forums/t/i-keep-running-into-merchant-is-not-authorized-for-device-id-when-attempting-to-call-the-terminal-checkout-api/21964/6 "2025-04-15T22:41:25Z")

</div>

What did you pass in as the `device_id`? Was it the value you got after it was successfully paired? 🙂

---

<div class="post-metadata">

**Author:** ![paljm](https://avatars.discourse-cdn.com/v4/letter/p/5f9b8f/32.png) [@paljm](https://developer.squareup.com/forums/u/paljm)\
**Post date:** [April 15, 2025, 10:42pm UTC](https://developer.squareup.com/forums/t/i-keep-running-into-merchant-is-not-authorized-for-device-id-when-attempting-to-call-the-terminal-checkout-api/21964/7 "2025-04-15T22:42:34Z")

</div>

I pass in “device:xyz” after it was successfully paired yes.

I also tried this in the api explorer where I just used the dropdown to select the correct device, and got the same error.

---

<div class="post-metadata">

**Author:** ![paljm](https://avatars.discourse-cdn.com/v4/letter/p/5f9b8f/32.png) [@paljm](https://developer.squareup.com/forums/u/paljm)\
**Post date:** [April 15, 2025, 11:12pm UTC](https://developer.squareup.com/forums/t/i-keep-running-into-merchant-is-not-authorized-for-device-id-when-attempting-to-call-the-terminal-checkout-api/21964/8 "2025-04-15T23:12:12Z")

</div>

I do see the device listed when I run /v2/devices?location\_id…

If it shows up here I should be able to send a checkout to it right?

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [April 15, 2025, 11:17pm UTC](https://developer.squareup.com/forums/t/i-keep-running-into-merchant-is-not-authorized-for-device-id-when-attempting-to-call-the-terminal-checkout-api/21964/9 "2025-04-15T23:17:36Z")

</div>

No, the device\_id isn’t in that endpoint. If you [ListDeviceCodes](https://developer.squareup.com/reference/square/devices-api/list-device-codes) it will have the code you’ll pass in `CreateTerminalCheckout`. For example here’s on from my account:

```auto
{
            "id": "GCD5B7H6ZPTKR",
            "name": "Counter 2",
            "code": "DBQPCC",
            "device_id": "952CS108A6002588",
            "product_type": "TERMINAL_API",
            "location_id": "3Z4V4WHQK64X9",
            "created_at": "2024-12-12T17:49:24.000Z",
            "status": "PAIRED",
            "status_changed_at": "2024-12-12T17:49:43.000Z",
            "paired_at": "2024-12-12T17:49:43.000Z"
        }

```

The `device_id` I’ll then pass in the API call to the Terminal is: 952CS108A6002588 🙂

---

<div class="post-metadata">

**Author:** ![paljm](https://avatars.discourse-cdn.com/v4/letter/p/5f9b8f/32.png) [@paljm](https://developer.squareup.com/forums/u/paljm)\
**Post date:** [April 15, 2025, 11:21pm UTC](https://developer.squareup.com/forums/t/i-keep-running-into-merchant-is-not-authorized-for-device-id-when-attempting-to-call-the-terminal-checkout-api/21964/10 "2025-04-15T23:21:56Z")

</div>

That worked! Thanks.
