1. Idempotent HTTP Method
- Only POST: un-idempotency.
- Other method: idempotency.
2. API naming:
- Resources: /orders, /orders/42
- Sub-resource: /orders/42/cancel
3. Some API components
- Versioning: offset page, cursor pagination.
- Cursor pagination.
- Idempotency
- Store log in 1 hour/1 day
- Filtering: /orders?status=shipped.
- Sorting: /orders?sort=-created_at.
- Error responses
4. Question
🔴 "A client reports duplicate charges. Your API returns 201 for POST /payments. Walk me through what's happening and how to fix it."