Skip to main content

Webhook API Versioning

Intro

Khaime uses date-based versioning for webhook payloads, pinned per API key, so a change to the payload shape never breaks an integration that isn’t ready for it. The current version is 2026-03-28.

Context

The version travels with every delivery — in the envelope’s api_version field and in the X-Khaime-Api-Version header (see Webhooks Overview) — so your handler can always tell which schema shape it’s looking at, even if you’re running multiple integrations against keys created at different times. This page explains what counts as a breaking change and walks through the last major payload migration; for the event types and fields themselves, see Events.

Hows

How versions work

  • api_version is a date string (e.g., "2026-03-28") stored on each API key record.
  • The version is included in the webhook body (api_version field) and the X-Khaime-Api-Version response header.
  • New API keys are assigned the current version (2026-03-28) at creation time.
  • Existing keys keep the version they were created with — every subsequent delivery on that key uses the same payload shape, indefinitely.
There is currently no self-serve endpoint to change the api_version on an existing key. If you need a key upgraded to the latest schema, create a new API key (sandbox or live) — new keys always start on the current version.

What triggers a new version

Adding new optional fields or new event types is non-breaking — your integration should handle unknown fields gracefully.

Migration guide: legacy payloads to 2026-03-28

The 2026-03-28 version is the first date-versioned webhook schema. It introduced structured multi-currency amounts, an explicit envelope (api_version, event_id, business_id), and expanded event coverage beyond the original flat payment/subscription events. If you’re integrating fresh today, every new API key already uses this version — this section exists for reference if you’re working from an older integration built against the pre-versioning payload shape.

Key changes

Event mapping

Example: payment.succeeded

Whys

Versioning is per-key and date-based, rather than a global cutover, so a payload restructuring never breaks an integration mid-flight — a key minted a year ago keeps receiving the shape it was built against until you deliberately move to a new key. Dates (rather than v1/v2) were chosen so the version string itself tells you when the schema was frozen, without needing to cross-reference a separate changelog to know what it contains. The bar for a “new version” is deliberately narrow — additive changes (new optional fields, new event types) never require one — because if every addition forced a version bump, partners would be stuck perpetually behind the latest event coverage just to avoid unrelated breaking changes elsewhere in the schema.

Why nots

This isn’t a live API changelog — it documents the versioning model and the one payload migration that has happened so far, not a running log of every field ever added. Check Events for the current, authoritative payload shape regardless of which version you’re on; additive fields and new event types show up there without a corresponding entry here. Versioning also doesn’t cover delivery mechanics (timeouts, retries, signing) — a version change never affects headers, the signing algorithm, or the retry policy. Those are stable across every api_version and documented in Webhooks Overview and Signature Verification.