Developer Reference
Technical details for developers integrating with or debugging the plugin. Store owners don’t need anything on this page — see Configuration instead.The plugin does not currently expose PHP action or filter hooks. The
extension points are the JavaScript API and the webhook endpoint below.
Environments & API URL
The plugin selects its API host from the Environment setting:- Live:
https://api.khaime.com/api/v1 - Sandbox:
https://api.khaimedev.com/api/v1
KHAIME_API_URL constant in
wp-config.php:
Diagnostics Panel
A live diagnostics panel (geolocation detection, active-currency resolution, exchange-rate inspection, currency simulation, and a Flush All Caches button) is available on the settings page — but only in developer mode: it appears whenKHAIME_API_URL points at a local host (localhost, 127.0.0.1,
*.local, *.test). It is never shown on production stores.
JavaScript API
The client-side price converter exposes a public API onwindow.KhaimePriceConverter:
Webhook Endpoint
The plugin registers a REST endpoint to receive events from Khaime:Security
Every request is verified before processing:- Signature — HMAC-SHA256 over the raw body using the webhook secret, from the
X-Khaime-Signatureheader - Deduplication — each event’s
X-Khaime-Event-Idis checked against a 48-hour replay window - Payload validation — required fields are checked before processing
Handled events
Logging
Webhook events log to WooCommerce → Status → Logs under thekhaime-webhooks
source; API/currency activity logs under khaimepay.