# bad_gateway

> An upstream service gave an invalid answer.

Source: https://tickwire.io/docs/errors/bad_gateway/

HTTP 502. Unknown: it may have executed. Resolve it with the same idempotency key before acting.

**Likely cause:** A service between our API and the terminal failed.

**What to do:** Reads: retry. Mutations: repeat only with the same Idempotency-Key.

**Retry:** Only with the same `Idempotency-Key` (or `clientId`). The first attempt may have executed; never resend a trade blindly.

Listed under [Outages and timeouts](https://tickwire.io/docs/errors/#outages-and-timeouts) in [Errors](https://tickwire.io/docs/errors/). Send the error's `requestId` to support and we can find the request.
