Skip to main content

Checkout Sessions

Ikawaari Checkout combines an authenticated checkout session route family with a public checkout route family used by the hosted checkout experience.

Implemented route families

Authenticated routes:

  • POST /api/v1/checkout/sessions
  • GET /api/v1/checkout/sessions/{id}

Public checkout routes used by the hosted page:

  • GET /api/checkout/{sessionId}
  • POST /api/checkout/{sessionId}/pay

Create a checkout session

POST /api/v1/checkout/sessions

Authentication:

  • ApiKey or AppToken
  • write scope for payments

Example:

curl -X POST https://api.ikawaari.com/api/v1/checkout/sessions \
-H "Authorization: Bearer ik_test_or_app_token" \
-H "Content-Type: application/json" \
-d '{
"line_items": [
{
"name": "Premium Plan",
"amount": 50000,
"currency": "XOF",
"quantity": 1
}
],
"mode": "payment",
"success_url": "https://yoursite.com/success?session_id={CHECKOUT_SESSION_ID}",
"cancel_url": "https://yoursite.com/cancel"
}'

Retrieve a checkout session

GET /api/v1/checkout/sessions/{id}

Use this route to retrieve the authoritative session object after creation.

Public hosted checkout flow

The checkout frontend uses public routes under api/checkout.

Get session details for the hosted page

GET /api/checkout/{sessionId}

Submit payment from the hosted page

POST /api/checkout/{sessionId}/pay

This route is public because it is consumed by the checkout page itself, not by merchant backends.

Typical response

{
"id": "cs_abc123",
"url": "https://checkout.ikawaari.com/cs_abc123",
"status": "open",
"payment_intent": "pi_xyz789",
"expires_at": 1708387200
}

Redirect the customer to url to complete the payment.

Integration note

Do not document checkout as only /v1/checkout/sessions.

The implemented experience uses both:

  • authenticated merchant creation and retrieval via api/v1/checkout/sessions
  • public hosted checkout operations via api/checkout/*

Checkout modes

ModeDescription
paymentOne-time payment
subscriptionRecurring subscription