Webhook in SandBox environment always returns 504

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.

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? :slightly_smiling_face:

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!

If your testing have you tried using webhooks.site? :slightly_smiling_face:

I think the problem is ngrok. I’ve tried Localtunnel ~ Expose yourself to the world and i can receive webhook from square.