Square Webhook: 504 Error in Production

Hello, I’m currently experiencing an issue with webhooks. Square seems to have difficulty reaching my Ngrok URLs when I’m in production, I always receive 504 error, but everything works fine in sandbox. In sandbox, with the same URL I am receiving status code 200.My ngrok supports “https” and I am sending a response as 200 for any incoming webhook. I am using the globally available Nodejs SDK.

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

Additional Documentation

Square Sandbox
Square Developer Tools
Troubleshoot In-App Payments SDK Problems

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.

Have you tried separating sandbox from production rather then having both configured to help debug?

Hi Bryan

At any point of time, either my sandbox is connected or my production. Both of them are not active at the same time.
My sandbox webhooks are working perfectly fine but my production webhooks return only 504 error code.

Hello I have similar issue. I was using ngrok a long time and everything works correctly, but right now it always returned 504. Last time when I was using it without issues was 26 of March 2024. I tried to used it again about 1 week ago and I received 504 error. I thought that was temporary issue ,but it still not working correctly. It’s occurs on Sandbox account, but working correctly on Production. My application sandbox id: sandbox-sq0idb-Gew5SznXXgHw_dhNPusbtQ