Versioning
/v1 and additive changes
Section titled “/v1 and additive changes”Every path starts with /v1. Within /v1, changes are additive:
- new endpoints
- new fields in responses
- new query parameters
- new enum values (a new lifecycle status, price kind, event type or error code)
- new keys in an event’s
data.detail
None of these needs a new version, so they can appear at any time.
Renaming or removing a field, or changing what one means, is a breaking change. That needs a new version: a new path for the API, or a new payload version for an event type (below).
What your client must do
Section titled “What your client must do”- Ignore fields you don’t know. Don’t fail on them, and don’t use a strict schema that rejects them.
- Handle enum values you don’t know. Have a default branch: treat an unknown lifecycle status like
unknown, skip an event type you don’t handle, act on an unknown errorcodeby its HTTP status. - Don’t depend on the order of fields in an object, or of keys in
detail. - Check
entitledon field groups, rather than assuming a group’s fields are there. See Plans and field groups.
Event payload versions
Section titled “Event payload versions”Each change event has a version: its type’s payload version, 1 for every type today. If a type’s data ever has to change in a breaking way, that type moves to version: 2, and the type name stays the same, so your type= filters and subscriptions keep working. GET /v1/event-types lists each type’s current version.
Which version is running
Section titled “Which version is running”- The spec’s own version is
info.versioninGET /v1/openapi.yaml(semver,0.16.0today). Generate a client from it. GET /v1/healthreturnsversion, the build that answered (a short commit ID such as0241463). It changes with every release.
A changelog of API changes is planned.