How to evolve a contract without breaking clients.
API Versioning Strategies: how to evolve a contract without breaking clients
turn boundaries into contracts
Maintaining many versions is costly — keep two at most.
Public APIs need versioning so clients can rely on a contract. Common schemes: URL path (/v1), Accept header (application/vnd.acme+json; version=1), or content negotiation. Each has tradeoffs.
URL versioning is the most discoverable and the most common.
Header versioning keeps URLs stable but requires client cooperation.
Backward-compatible changes (additive) shouldn't bump version. Breaking (rename, remove, semantic change) must.
Plan deprecation: announce, dual-run, sunset, remove. Months, not days.
Adding a required field 'currency' to /orders.