Skip to main content
POST
/
payments
/
sessions
curl -X POST https://api.khaime.com/api/v1/partner/payments/sessions \
  -H "X-API-Key: pk_sandbox_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 5000,
    "currency": "USD",
    "product_name": "Premium Plan",
    "customer": {
      "email": "jane@example.com"
    },
    "success_url": "https://example.com/success",
    "cancel_url": "https://example.com/cancel"
  }'

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.

Create Payment Session

Create a payment session that redirects customers to Stripe’s hosted checkout page. Best for merchants who want a fully hosted payment experience.
For embedded payments (Stripe Payment Element on your own page), use Create Charge instead.

Request Body

amount
integer
required
Amount in smallest currency unit.
currency
string
required
3-letter ISO currency code.
product_id
integer
Khaime product ID. Required if product_name is not provided.
product_name
string
Product name for display. Required if product_id is not provided.
customer
object
required
success_url
string
Redirect URL after successful payment.
cancel_url
string
Redirect URL if customer cancels.
subscription_frequency_key
string
For subscriptions: monthly, yearly, quarterly, etc.
metadata
object
Custom key-value pairs. Values must be scalar.

Response

{
  "success": true,
  "data": {
    "session_id": "sess_a1b2c3d4-e5f6-g7h8-i9j0",
    "stripe_session_id": "cs_live_a1b2...",
    "payment_url": "https://checkout.stripe.com/c/pay/cs_live_...",
    "expires_at": "2026-01-16T22:00:00.000Z",
    "amount": 5320,
    "currency": "USD",
    "status": "pending",
    "mode": "sandbox",
    "payment_type": "one_time",
    "fee_details": {
      "base_product_price": 5000,
      "transaction_fee": 320,
      "total_amount": 5320,
      "customer_pays_fees": true
    }
  }
}
Redirect the customer to payment_url to complete payment on Stripe’s hosted page.
curl -X POST https://api.khaime.com/api/v1/partner/payments/sessions \
  -H "X-API-Key: pk_sandbox_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 5000,
    "currency": "USD",
    "product_name": "Premium Plan",
    "customer": {
      "email": "jane@example.com"
    },
    "success_url": "https://example.com/success",
    "cancel_url": "https://example.com/cancel"
  }'