Developers

Integrate Khlas Pay your way

A small REST API, signed webhooks and a sandbox for every account on our own Khlas Pay solution. Or a ready-made plugin for your shop. Our integration team works with you, whatever your system.

  • A sandbox for every account
  • Idempotent writes
  • Signed webhooks
Create a payment
POST /v1/payments
Idempotency-Key: 6f1c2a…
{
  "amount": 149.90,
  "currency": "MAD",
  "return_url": "https://shop.example/thanks"
}

// 201 Created
{
  "id": "pay_…",
  "status": "pending",
  "checkout_url": "https://…"
}

Illustrative example. The full reference comes with your sandbox access.

Three resources to know

The API is intentionally small. Most teams ship their first integration in an afternoon.

The Khlas Pay API is for merchants on our own Khlas Pay solution; if we connect you with another provider, you integrate with that provider and our integration team helps.

Khlas Pay connects you with the right licensed provider or, where it fits, boards you directly onto its own Khlas Pay solution. We will always tell you which route we are recommending: a licensed partner or our own Khlas Pay solution.

  • payments

    Payments

    Send an amount, a currency, a return address and an idempotency key. We reply with a checkout address to redirect to or embed.

  • refunds

    Refunds

    Give money back to a customer from a payment, from your own system.

  • accounts

    Accounts

    Read the details of your account.

A developer’s tour of the Khlas Pay REST API

Webhooks you will actually use

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

Idempotency, always

Send an idempotency key on every write. Network retries happen, and this one header stops a flaky connection from creating the same payment twice.

Sandbox first

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

No developers? Use a plugin

Ready-made plugins connect the most popular e-commerce platforms.

  • WooCommerce
  • PrestaShop
  • Shopify

Using another platform? Ask us. Talk to the integration team

One team for every kind of integration

Website, app, shop, counter or invoice: tell us how you sell and our integration team sets it up with you.

Contact Us

Talk to an expert

For any information request about Khlas Pay, do not hesitate to contact us!