Developer platform

Integrate Zenso payments with a server-first Hosted Checkout flow

Use API keys to create checkout sessions, redirect customers to Zenso, and fulfill orders from signed webhooks. Provider details stay behind stable Zenso objects.

Create a checkout session

Send from your backend with bearer auth and an Idempotency-Key.

POST /api/v1/checkout/sessions/

bash

curl -X POST "https://api.zenso.lk/api/v1/checkout/sessions/" \
  -H "Authorization: Bearer $ZENSO_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order_123" \
  -d '{
  "amount": 3000,
  "currency": "LKR",
  "description": "Invoice 1001",
  "success_url": "https://example.com/success",
  "cancel_url": "https://example.com/cancel",
  "metadata": {
    "order_id": "order_123"
  }
}'

Accept a payment with Hosted Checkout

Create a checkout session from your server and redirect the customer to Zenso.

Use signed webhooks for fulfillment

Treat redirects as customer experience and verified webhooks as payment proof.

Debug with logs and retries

Inspect API request logs, webhook deliveries, manual retries, refunds, and reconciliation in Dashboard.

Go live with standard keys

Create test keys immediately and switch to live keys after payment approval.

Response shape

Return only the checkout_url to your browser. Keep the secret key on your server.

Checkout session

json

{
  "id": "cs_...",
  "object": "checkout_session",
  "status": "open",
  "payment_status": "unpaid",
  "checkout_url": "https://pay.zenso.lk/cs/cs_..."
}

Production checklist

  • Create a test key and a checkout session.
  • Send an Idempotency-Key for every order.
  • Verify signed webhooks from the raw request body.
  • Confirm success redirects and webhook fulfillment.
  • Use API logs, webhook delivery logs, refunds, and reconciliation before going live.
View testing guide