A developer's tour of the Khlaspay REST API

The Khlaspay API is intentionally small. There are three resources you really need to know — payments, refunds, and accounts — and a handful of webhooks.

Creating a payment

POST a payment with an amount, a currency, a return URL and an idempotency key. We respond with a checkout URL you can redirect or embed. Most teams ship their first integration in an afternoon.

Webhooks you'll actually use

payment.completed and payment.failed cover 90% of integrations. Subscribe, verify the signature header, and update your order in your own database. We retry with exponential backoff for up to 24 hours.

Idempotency, please

Always send an idempotency key on writes. Network retries are a fact of life and this single header will save you from creating duplicate payments after a flaky connection.

Sandbox first

Every account starts with a sandbox. You can simulate successful payments, declined ones, and slow banks to test your edge cases before you ever charge a real customer.

Next
Next

Why we built Khlaspay and what we want payments to feel like