Documentation Index
Fetch the complete documentation index at: https://docs.khaime.com/llms.txt
Use this file to discover all available pages before exploring further.
Webhooks
Khaime sends HTTP POST requests to your webhook URL when events occur across the full lifecycle of payments, subscriptions, wallet operations, settlements, disputes, and physical order fulfillment. This is the most reliable way to track transaction state — don’t rely solely on redirect callbacks.Setup
- Go to Khaime Dashboard → Settings → API
- Set your Webhook URL (e.g.,
https://yoursite.com/webhooks/khaime) - Copy your Webhook Secret (
whsec_...)
Envelope Structure
Every webhook delivery shares the same outer envelope regardless of event type:| Field | Type | Description |
|---|---|---|
api_version | string | Date-versioned schema (e.g., "2026-03-27") |
event_id | string | Globally unique ID (evt_{uuid4}) — use for idempotency |
event_type | string | Dot-notation event name (e.g., payment.succeeded) |
occurred_at | string | ISO 8601 UTC timestamp |
is_live | boolean | false for sandbox/test events |
business_id | string | Merchant’s platform ID |
data | object | Event-specific payload (see Events) |
The
event_id is the idempotency key. You must store processed event_id values and skip duplicates — retries reuse the same event_id.Webhook Headers
Every webhook request includes these headers:| Header | Description |
|---|---|
X-Khaime-Event | Event type (e.g., payment.succeeded) |
X-Khaime-Event-Id | Unique event ID (matches event_id in the body) |
X-Khaime-Signature | HMAC-SHA256 signature for verification |
X-Khaime-Api-Version | API version for this delivery (e.g., 2026-03-27) |
Content-Type | application/json |
Delivery
| Property | Value |
|---|---|
| Timeout | 10 seconds |
| Retries | 3 attempts |
| Retry delay | 2 seconds between attempts |
| Success | Any HTTP 2xx response |
Shared Data Types
These types appear across multiple event payloads.MoneyAmount
All monetary values are in the smallest currency unit (cents for USD, kobo for NGN). Never floats.MulticurrencyBreakdown
Present on payment and order events. Provides a full breakdown of amounts, fees, and currency conversion.conversion is omitted and customer_paid equals merchant_gross.
Customer
id field is present only if the customer has a platform account.
