Payments
Create Payment Intent
Create a payment intent for embedded checkout (Stripe Payment Element / Paystack).
POST
Create Payment Intent
Create a payment intent tied to a product in your Khaime catalog. Returns aclient_secret (Stripe) or authorization_url (Paystack) for an embedded checkout on your own page, plus a ready-made payment_url to Khaime’s hosted checkout page if you’d rather redirect instead of embedding.
Use this endpoint (or its
/payments/intents alias) when you want a product-based checkout with Stripe Payment Element or Paystack’s inline popup embedded on your own page. If you don’t have the product in Khaime’s catalog — e.g. WooCommerce/custom platforms where the product lives elsewhere — use Create Charge instead.Request Body
ID of an existing, published Khaime product owned by your business. Must match your API key’s environment (a sandbox key can only resolve sandbox products, a live key only live products) — otherwise
404.The Joi schema also accepts
product_name as a fallback lookup field, but the controller currently rejects any request missing product_id before that fallback runs — product_name-only requests always fail with a “Missing required fields” error today. Always pass product_id.3-letter ISO currency code the customer pays in.
Override amount in smallest currency unit. If omitted, the product’s catalog price is used.
Force a specific gateway instead of Khaime’s automatic currency-based routing. Only
stripe or paystack are accepted — you cannot force startbutton or flutterwave through this field.Set to make this a recurring payment (e.g.
monthly, yearly). Presence of this field (or subscription_plan_key) is what makes the intent a subscription — there is no separate boolean flag.Recurring billing here is handled by Khaime’s own billing cron, not Stripe Subscriptions —
stripe_subscription_id in the response is always null.Alternative to
subscription_frequency_key when the product has named plans configured. If the plan has exactly one frequency option, it’s auto-selected.Where the customer lands after paying via Paystack’s redirect flow. Threaded into Paystack’s
callback_url so the buyer returns to your confirmation page directly.Redirect URL if the customer abandons a Paystack redirect payment.
Custom key-value pairs. No scalar-type enforcement is applied server-side — unlike Create Charge, you can pass nested values here, but avoid it: nested metadata can still fail downstream if the selected gateway’s API rejects non-string values.
Response
client_secret + publishable_key to mount Stripe Payment Element on your own page. For Paystack, use authorization_url (present instead of client_secret when payment_gateway resolves to paystack). Or simply redirect the customer to payment_url — Khaime’s own hosted checkout page — if you don’t want to embed anything.
Response Fields
Error Codes
Checking Payment Status
There is currently no working polling endpoint for intents created through this route — see Get Session for why. Use webhooks (payment.succeeded / payment.failed) to confirm payment status.
