beginner · errors

Design the Error Response

Design the error response for a payments API. What does a client need to see when a request fails?

Practical scenario

A checkout integration shows shoppers a generic “payment failed” for declines, timeouts, and validation errors alike, and support can't match complaints to logs.

What it tests

  • • Whether errors are treated as contract, not afterthought
  • • Machine-readable vs human-readable separation
  • • Support and debugging workflow awareness