Guides
How the spec stays true
Documentation drifts. This spec is checked against Safaricom's sandbox every night, and it records when each operation last passed.
x-daraja-verified
Every operation carries x-daraja-verified: the date its contract test last passed against the sandbox, or null until it has. The API reference shows it on each page.
The nightly run
A GitHub Actions workflow calls the sandbox every night and validates each response against the spec. If Daraja behaves differently, the workflow opens a spec-drift issue the same day, with Daraja's answer scrubbed of phone numbers and tokens.
Everything else is checked against the spec
- The TypeScript types are generated from the spec, and CI fails if the spec changes without them.
- The mock's responses and callbacks are validated against the spec's schemas in its tests.
- Every SDK runs its tests against the mock on every pull request: TypeScript, Python 3.10 and 3.13, PHP 8.1 and 8.4, Kotlin and Swift.
Found a difference?
If Daraja does something the spec doesn't describe, please open an issue with the operation, what you sent and what came back. Remove phone numbers and credentials first.