# Error On getting the Merchant back

**URL:** <https://developer.squareup.com/forums/t/error-on-getting-the-merchant-back/24167>\
**Category:** Questions\
**Tags:** merchants-api\
**Created:** [October 6, 2025, 6:22pm UTC](https://developer.squareup.com/forums/t/error-on-getting-the-merchant-back/24167 "2025-10-06T18:22:12Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcrone](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/jcrone/32/1020_2.png) [@jcrone](https://developer.squareup.com/forums/u/jcrone)\
**Post date:** [October 6, 2025, 6:22pm UTC](https://developer.squareup.com/forums/t/error-on-getting-the-merchant-back/24167/1 "2025-10-06T18:22:12Z")

</div>

My production had a bunch of errors this morning that I have never seen before. The problem does not seem to be happening anymore. But my users were getting errors this morning. They were getting a nil value back.

Just wondering if this was a known issue that happened this morning and was fixed or if I need to dig into this more. Its the same code I have used for the last three years to call the merchant api.

```ruby
     merchant = square_api_client.merchants.retrieve_merchant(
        merchant_id: current_account.square_merchant_id
      )

```

```ruby
module SquareApiHelper
    def square_api_client
      # Create an instance of the API Client and initialize it with the credentials
      # for the Square account whose assets you want to manage.
      if Rails.env != 'production'
        this_environment = 'sandbox'
      else
        this_environment = 'production'  
      end 

      @api_client ||= Square::Client.new(
        access_token: current_account.square_access_token,
        environment: this_environment
      )
    end
end

```

EDIT: Found the error in my logs, says Rate Limit.

I did not know there was a Rate Limit on the Merchant api. What is the solution here

```json
{
  "errors": [
    {
      "code": "RATE_LIMITED",
      "detail": "This request was rate limited. Please retry later.",
      "category": "RATE_LIMIT_ERROR"
    }
  ]
}

```

---

<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:** [October 6, 2025, 6:22pm UTC](https://developer.squareup.com/forums/t/error-on-getting-the-merchant-back/24167/2 "2025-10-06T18:22:21Z")

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

> **[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.

> **[Merchant APIs](https://developer.squareup.com/docs/merchant-details)**
>
> Use Square merchant APIs to configure and access account details that support merchant services across many locations.

> **Additional Documentation**
>
> [Develop for Japan](https://developer.squareup.com/docs/international-development/japan)  
> [Develop for Japan](https://developer.squareup.com/docs/international-development/regional-differences)  
> [Merchants API](https://developer.squareup.com/docs/merchants-api)

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:** ![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:** [October 6, 2025, 6:32pm UTC](https://developer.squareup.com/forums/t/error-on-getting-the-merchant-back/24167/3 "2025-10-06T18:32:00Z")

</div>

Were you calling the endpoint more then usual? All our endpoints have rate limits. 🙂

---

<div class="post-metadata">

**Author:** ![jcrone](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/jcrone/32/1020_2.png) [@jcrone](https://developer.squareup.com/forums/u/jcrone)\
**Post date:** [October 6, 2025, 6:40pm UTC](https://developer.squareup.com/forums/t/error-on-getting-the-merchant-back/24167/4 "2025-10-06T18:40:56Z")

</div>

Not today, but its the busy season, so over the weekend they were calling more. Its working fine now. I call devices every time I call merchants, plus I call devices on other pages as well, but did not have an issue with devices

---

<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:** [October 6, 2025, 6:52pm UTC](https://developer.squareup.com/forums/t/error-on-getting-the-merchant-back/24167/5 "2025-10-06T18:52:40Z")

</div>

Okay, I’m not familiar with your flow but do you need to be calling merchant a lot? 🙂

---

<div class="post-metadata">

**Author:** ![jcrone](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/jcrone/32/1020_2.png) [@jcrone](https://developer.squareup.com/forums/u/jcrone)\
**Post date:** [October 6, 2025, 6:58pm UTC](https://developer.squareup.com/forums/t/error-on-getting-the-merchant-back/24167/6 "2025-10-06T18:58:53Z")

</div>

> [@Bryan-Square](#):
>
> Were you calling the endpoint more then usual? All our endpoints have rate limits. 🙂

From 9/29/2025 until now, I called that end point 502 times

---

<div class="post-metadata">

**Author:** ![jcrone](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/jcrone/32/1020_2.png) [@jcrone](https://developer.squareup.com/forums/u/jcrone)\
**Post date:** [October 6, 2025, 7:05pm UTC](https://developer.squareup.com/forums/t/error-on-getting-the-merchant-back/24167/7 "2025-10-06T19:05:08Z")

</div>

Possibly another concern, is the terminal checkout api. If this has a limit it could cause payment issue on the application. Does the terminal checkout create also have a limit?

---

<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:** [October 6, 2025, 7:30pm UTC](https://developer.squareup.com/forums/t/error-on-getting-the-merchant-back/24167/8 "2025-10-06T19:30:08Z")

</div>

Yes, all of our endpoints have rate limits. They do differ based on endpoint because some have higher traffic then others. 🙂

---

<div class="post-metadata">

**Author:** ![jcrone](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/jcrone/32/1020_2.png) [@jcrone](https://developer.squareup.com/forums/u/jcrone)\
**Post date:** [October 6, 2025, 7:36pm UTC](https://developer.squareup.com/forums/t/error-on-getting-the-merchant-back/24167/9 "2025-10-06T19:36:12Z")

</div>

Are terminal rates based off of rates per second, per min, per day. It looks like you don’t disclose the rate limits, but can we figure out how to have an idea of when a limit is getting close or avoid

---

<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:** [October 6, 2025, 10:11pm UTC](https://developer.squareup.com/forums/t/error-on-getting-the-merchant-back/24167/10 "2025-10-06T22:11:24Z")

</div>

They’re based on QPS. 🙂
