# Payment API returning an empty response

**URL:** <https://developer.squareup.com/forums/t/payment-api-returning-an-empty-response/24016>\
**Category:** Questions\
**Tags:** payments-api\
**Created:** [September 18, 2025, 6:49pm UTC](https://developer.squareup.com/forums/t/payment-api-returning-an-empty-response/24016 "2025-09-18T18:49:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bpickle](https://avatars.discourse-cdn.com/v4/letter/b/ee7513/32.png) [@bpickle](https://developer.squareup.com/forums/u/bpickle)\
**Post date:** [September 18, 2025, 6:49pm UTC](https://developer.squareup.com/forums/t/payment-api-returning-an-empty-response/24016/1 "2025-09-18T18:49:39Z")

</div>

Greetings.

I’ve been with Square for awhile, and don’t remember having this problem before. Curl calls to the payment API via PHP are returning an empty response.

I’ve called square twice today, and have talked to six people, two of them being just now. The reason I called back is I wondering if the IP address of my website was being blocked. The gentleman said it wasn’t.

My second question was, Under what circumstances will Square return an empty response from its payments API? The fellow suggested that I ask that question here.

Again, my question is, What would cause Square to return no response at all?

Everything was working. The PHP code can write test files before and after the curl function, and so the curl function isn’t causing a fatal error. But the file written that should contain the response is empty, even after changing to the most recent version, even when using a new access token, and even when using the sandbox. I can ping the production and sandbox access points just fine.

The one suspicious thing is that a few weeks ago I had to work on my site in order to upgrade my USPS interface, because somehow I wasn’t allowed to upgrade by January 25. But that part of the site is working just fine.

My cart is proprietary. I made it myself.

The response is supposed to be a string, right?

---

<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:** [September 18, 2025, 6:50pm UTC](https://developer.squareup.com/forums/t/payment-api-returning-an-empty-response/24016/2 "2025-09-18T18:50:11Z")

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

> **[Test in the Sandbox](https://developer.squareup.com/docs/devtools/sandbox/testing)**
>
> A quick reference for walkthroughs for various Square APIs that use the Sandbox for testing.

> **[Using the REST API](https://developer.squareup.com/docs/build-basics/using-rest-api)**
>
> Learn how to use the Square API (REST). You manage the resources of a Square account by making HTTPS requests to URLs that represent those resources.

> **Additional Documentation**
>
> [Make your First API Call](https://developer.squareup.com/docs/get-started/make-api-request)  
> [Test Authorization with Web Server](https://developer.squareup.com/docs/oauth-api/build-with-oauth)  
> [Develop for Japan](https://developer.squareup.com/docs/international-development/japan)

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:** ![bpickle](https://avatars.discourse-cdn.com/v4/letter/b/ee7513/32.png) [@bpickle](https://developer.squareup.com/forums/u/bpickle)\
**Post date:** [September 18, 2025, 7:19pm UTC](https://developer.squareup.com/forums/t/payment-api-returning-an-empty-response/24016/3 "2025-09-18T19:19:32Z")

</div>

Do these guides tell me under what circumstances an empty response gets returned? If they don’t, then they’re not going to help.

Everything was working. Now it’s not, and the response returned is entirely empty, 0 bytes long.

Or maybe it should be said that no response is returned. I don’t know.

It was working fine, and now it’s not. What could have happened?

---

<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:** [September 18, 2025, 10:27pm UTC](https://developer.squareup.com/forums/t/payment-api-returning-an-empty-response/24016/4 "2025-09-18T22:27:32Z")

</div>

Were payments taken for the timeframe and location you looking at? If so whats your application ID and `location_id`? 🙂

---

<div class="post-metadata">

**Author:** ![bpickle](https://avatars.discourse-cdn.com/v4/letter/b/ee7513/32.png) [@bpickle](https://developer.squareup.com/forums/u/bpickle)\
**Post date:** [September 18, 2025, 11:09pm UTC](https://developer.squareup.com/forums/t/payment-api-returning-an-empty-response/24016/5 "2025-09-18T23:09:10Z")

</div>

Thanks for your reply, Bryan.

Things were fine until sometime between July 23 and September 15. I don’t have a way to narrow it down further than that.

I don’t feel right about posting the location\_id and application\_id. But do you think those could have changed?

---

<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:** [September 22, 2025, 4:36pm UTC](https://developer.squareup.com/forums/t/payment-api-returning-an-empty-response/24016/6 "2025-09-22T16:36:51Z")

</div>

We don’t update those on the backend. Also the `location_id` and application ID are okay to share publicly. Only the access token should never be shared publicly since they’re secret. 🙂

---

<div class="post-metadata">

**Author:** ![bpickle](https://avatars.discourse-cdn.com/v4/letter/b/ee7513/32.png) [@bpickle](https://developer.squareup.com/forums/u/bpickle)\
**Post date:** [September 22, 2025, 5:32pm UTC](https://developer.squareup.com/forums/t/payment-api-returning-an-empty-response/24016/7 "2025-09-22T17:32:06Z")

</div>

Thank you Bryan. I have in the meantime found the problem. While it isn’t back up and running yet, I will be able to troubleshoot it further. If I have further difficulties, I will post again, which may take a little while.
