504 Gateway Timeout

Upstream did not answer in time.

Status code
504
Reason phrase
Gateway Timeout
Class
5xx Server errors

What does 504 Gateway Timeout mean?

A gateway or proxy timed out waiting for the application server.

Common causes

How to fix it

504 and webhooks

Typical when the handler does heavy work before answering — return 200 first, process later.

Test how your client handles 504

In the webhook tester you can add a response rule that answers 504 — useful to check retries, error handling and alerts before production.

FAQ

What does HTTP 504 mean?

Upstream did not answer in time. A gateway or proxy timed out waiting for the application server.

Is 504 an error?

Yes — a server error: the request may succeed if retried later.

Other 5xx codes

500 Internal Server Error · 501 Not Implemented · 502 Bad Gateway · 503 Service Unavailable · 505 HTTP Version Not Supported · 507 Insufficient Storage · 508 Loop Detected · 511 Network Authentication Required · 520 Web Server Returned an Unknown Error · 521 Web Server Is Down · 522 Connection Timed Out · 523 Origin Is Unreachable · 524 A Timeout Occurred · 525 SSL Handshake Failed · 526 Invalid SSL Certificate

← 503   All status codes   505 →

About HTTP 504

The status line “HTTP/1.1 504 Gateway Timeout” belongs to the 5xx family — server errors, where the request may be fine but the server failed.

A 504 is usually safe to retry with exponential backoff; most payment providers retry webhooks that got a 504.

In monitoring, alert on the rate of 504 responses rather than single events, and split by endpoint to find the source.