API Design · Middle · Question 10 of 75
Why should error codes in the body be stable and documented?
- 1HTTP requires numeric codes in the body
- ✓Correct answer: Clients branch on them (e.g.
card_declinedvsinsufficient_funds); changing them breaks client logic even if the HTTP status stays the same - 3Error codes are only for logs
Explanation
Messages can change and be translated; codes are the contract.