Developer Documentation

Build payments into any app, anywhere in the Caribbean.

LuniPay gives Caribbean businesses a Stripe-class developer experience: prefixed API keys, signed webhooks, cursor-paginated REST, JavaScript and Python SDKs, and a hosted checkout that feels like the rest of your product.

If you have integrated Stripe before, this will feel familiar. You generate keys, create a checkout session, redirect your customer to a hosted page, and receive a signed webhook when they pay. The API surface is deliberately small — three concepts, not thirty.

// npm install lunipay
import LuniPay from 'lunipay';

const lunipay = new LuniPay(process.env.LUNIPAY_SECRET_KEY);

const session = await lunipay.checkout.sessions.create({
  amount: 5000,
  currency: 'usd',
  success_url: 'https://example.com/thanks',
});

console.log(session.url);

The three concepts

Almost everything you will build on LuniPay is a composition of three resources. Learn these and you have the API.

How a payment flows

A successful payment always follows the same path, no matter whether it comes from a checkout session, an invoice, or a payment link:

  1. Your backend creates a resource with a secret key — a checkout_session, an invoice, or a payment_link.
  2. You redirect or share the returned hosted URL with your customer.
  3. Your customer pays on LuniPay-hosted infrastructure (3DS, receipts, and refunds all handled).
  4. LuniPay writes a signed event to your account and POSTs it to every registered webhook endpoint.
  5. Your backend verifies the signature and fulfills the order — ship the goods, flip the flag in your database, whatever.

Webhooks are the source of truth

Never mark an order as paid based on the URL redirect alone. The success URL is a UX cue. The signed webhook is the contract.