Drop-in checkout

<script src="https://pay.qwikipay.com/qwikipay.js"></script>
<button id="pay">Pay UGX 50,000</button>
<script>
  document.getElementById('pay').onclick = () => QwikiPay.checkout({
    publicKey: 'qp_pk_live_...',
    businessId: 'qp_biz_test_...',
    reference: 'order-1001',          // your order number, unique per payment
    amount: '50000',
    currency: 'UGX',
    customer: { email: '[email protected]', name: 'Amina Nakato' },
    description: 'Leather bag',
    onSuccess: (payment) => confirmOnServer(payment.reference),
    onClose: () => {},
  })
</script>

The page must be on your business's domain (or localhost with test keys). The script creates a checkout session with your public key and opens QwikiPay's payment page in a window over your site.

onSuccess only tells you the customer finished. Anyone can call your JavaScript, so before you deliver, your server must confirm the payment with your secret key.

What the script sends

POST /v1/checkout-sessions with your public key. The answer:

{ "id": "qp_ch_8c1f...", "reference": "order-1001", "checkout_url": "https://pay.qwikipay.com/pay/s/qp_ch_8c1f...?embed=1", "expires_at": "2026-12-04T18:00:00Z" }

A session expires after an hour.