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.
Pay Button
The fastest way to sell a single product. Drop<khaime-pay-button> onto your page, point it at a product ID, and the SDK handles everything — creating a checkout session, opening the payment modal, and reporting the result.
Use this when you have a single product per button (a digital download, a subscription plan, an event ticket, a course). For multi-item baskets, see Storefront + Cart.
1. Load the SDK
2. Initialize
3. Render the button
- HTML attribute
- Programmatic
4. Handle the result
What happens under the hood
Click
The customer clicks the button. The SDK calls
POST /api/v1/sdk/checkout/initialize with { product_id, quantity, currency? } and receives a session token.Modal opens
The SDK lazy-loads the checkout modal and fetches
GET /api/v1/sdk/checkout/session/{sessionToken} to get the payment gateway credentials.Payment
The modal renders Stripe Elements (USD, EUR, GBP, etc.) or Paystack inline (NGN, GHS, ZAR) based on the transaction currency.
Full example
Attributes reference
| Attribute | Type | Required | Description |
|---|---|---|---|
merchant-id | string / number | yes | Your Khaime merchant ID. |
product-id | string / number | yes | The product the customer is buying. |
label | string | no | Button text. Defaults to the product’s configured CTA. |
variant | primary | secondary | outline | no | Visual style. Defaults to primary. |
sandbox | boolean attribute | no | Forces sandbox mode on this component. |
Next steps
- Listen for richer events — see the events reference.
- Need a cart with multiple items? Move to Storefront + Cart.
- Creating sessions from your backend (e.g. WordPress)? See Programmatic checkout.
