# Webhook in SandBox environment always returns 504

**URL:** <https://developer.squareup.com/forums/t/webhook-in-sandbox-environment-always-returns-504/14489>\
**Category:** Questions\
**Tags:** webhooks-api\
**Created:** [April 11, 2024, 7:57am UTC](https://developer.squareup.com/forums/t/webhook-in-sandbox-environment-always-returns-504/14489 "2024-04-11T07:57:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![type-wolf](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/type-wolf/32/4303_2.png) [@type-wolf](https://developer.squareup.com/forums/u/type-wolf)\
**Post date:** [April 11, 2024, 7:57am UTC](https://developer.squareup.com/forums/t/webhook-in-sandbox-environment-always-returns-504/14489/1 "2024-04-11T07:57:09Z")

</div>

I am receiving `payment.create` in AppRoute in Next.js14, but just recently I stopped receiving it!

We are creating an environment to receive webhooks with `ngrok` Pro plan.

Also, when I send a request via curl or Postman, the endpoint is reached, but when I do a test POST from Square’s Develop dashboard, the request does not seem to reach the specified endpoint.  
I checked on ngrok’s Dashboard.

I also ran the test POST again with all the webhook endpoint processing commented out and the immediately to see if the response time could be the problem, but there was no improvement.

Square’s Log has 504 recorded!

I would appreciate a solution.

---

<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 11, 2024, 4:24pm UTC](https://developer.squareup.com/forums/t/webhook-in-sandbox-environment-always-returns-504/14489/2 "2024-04-11T16:24:51Z")

</div>

The `504` is what were getting from your server. Are you responding to the webhook event delivery within 10 seconds with a `2xx`? Also what webhook event are you trying to trigger from Dashboard and what’s your application ID? 🙂

---

<div class="post-metadata">

**Author:** ![type-wolf](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/type-wolf/32/4303_2.png) [@type-wolf](https://developer.squareup.com/forums/u/type-wolf)\
**Post date:** [April 13, 2024, 4:36am UTC](https://developer.squareup.com/forums/t/webhook-in-sandbox-environment-always-returns-504/14489/3 "2024-04-13T04:36:07Z")

</div>

Thank you.

applicationId: sq0idp-rxsJmjx5t4PbzrU67wA6UA

webhook event: payment.updated

> Are you responding to the webhook event delivery within 10 seconds with a 2xx?

Yes, I verified it by making the first line of the APIEndpoint code in the webhook respond 204, but 504 was generated.

I was using `ngrok` to verify webhooks (I did this by looking at the setup article)

No requests from webhooks were registered in the `ngrok` logs for the registered endpoints on the dashboard.

Also, a request from a postman to a registered endpoint on the dashboard successfully responded 204

We believe it is possible that the problem could be caused by `ngrok`!

---

<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, 2024, 4:20pm UTC](https://developer.squareup.com/forums/t/webhook-in-sandbox-environment-always-returns-504/14489/4 "2024-04-15T16:20:50Z")

</div>

If your testing have you tried using `webhooks.site`? 🙂

---

<div class="post-metadata">

**Author:** ![vuduytu](https://avatars.discourse-cdn.com/v4/letter/v/67e7ee/32.png) [@vuduytu](https://developer.squareup.com/forums/u/vuduytu)\
**Post date:** [April 16, 2024, 2:23am UTC](https://developer.squareup.com/forums/t/webhook-in-sandbox-environment-always-returns-504/14489/5 "2024-04-16T02:23:21Z")

</div>

I think the problem is ngrok. I’ve tried [Localtunnel ~ Expose yourself to the world](https://localtunnel.github.io/www/) and i can receive webhook from square.
