Skip to content

Quick Start

Accept your first payment in under 5 minutes.

Prerequisites

  • A ZevPay Checkout account — sign up here
  • An API key pair (secret + public) from the dashboard

Step 1: Get your API keys

  1. Log in to the ZevPay Checkout Dashboard
  2. Go to Developers > API Keys
  3. Create a new key pair. You'll get:
    • Secret key (sk_test_...) — used on your server, never expose to the client
    • Public key (pk_test_...) — used in the frontend SDK (and for inline checkout initialization)

Step 2: Collect payment

Choose your integration method:

The inline SDK handles everything client-side using your public key. No server is needed to initialize the session.

html
<script src="https://js.zevpaycheckout.com/v1/inline.js"></script>

<button id="pay-btn">Pay ₦5,000</button>

<script>
  document.getElementById('pay-btn').addEventListener('click', function() {
    var checkout = new ZevPay.ZevPayCheckout();
    checkout.checkout({
      apiKey: 'pk_test_your_public_key',
      email: 'customer@example.com',
      amount: 500000, // ₦5,000 in kobo
      currency: 'NGN',
      reference: 'ORDER-12345',
      firstName: 'John',
      lastName: 'Doe',
      onSuccess: function(reference) {
        // Payment successful — verify on your server
        alert('Payment complete! Ref: ' + reference);
      },
      onClose: function() {
        console.log('Payment modal closed');
      },
    });
  });
</script>

How it works

The inline SDK uses your public key to create a checkout session directly from the browser. If you've configured allowedDomains on your API key, the request origin is validated automatically. See Domain Whitelisting for details.

Option B: Standard Checkout (redirect — requires backend)

Initialize a session from your server using your secret key, then redirect the customer to the hosted checkout page.

Step 2a: Create a session (server-side)

bash
curl -X POST https://api.zevpaycheckout.com/v1/checkout/session/initialize \
  -H "Content-Type: application/json" \
  -H "x-api-key: sk_test_your_secret_key" \
  -d '{
    "amount": 500000,
    "email": "customer@example.com",
    "customer_name": "John Doe",
    "currency": "NGN",
    "reference": "ORDER-12345",
    "callback_url": "https://yoursite.com/payment/callback",
    "metadata": {
      "order_id": "12345",
      "plan": "premium"
    }
  }'
javascript
const response = await fetch(
  "https://api.zevpaycheckout.com/v1/checkout/session/initialize",
  {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "x-api-key": "sk_test_your_secret_key",
    },
    body: JSON.stringify({
      amount: 500000, // 5,000 NGN in kobo
      email: "customer@example.com",
      customer_name: "John Doe",
      currency: "NGN",
      reference: "ORDER-12345",
      callback_url: "https://yoursite.com/payment/callback",
    }),
  }
);

const { data } = await response.json();
console.log(data.session_id);    // "abc-123-def"
console.log(data.checkout_url);  // "https://secure.zevpaycheckout.com/abc-123-def"
python
import requests

response = requests.post(
    "https://api.zevpaycheckout.com/v1/checkout/session/initialize",
    headers={
        "Content-Type": "application/json",
        "x-api-key": "sk_test_your_secret_key",
    },
    json={
        "amount": 500000,  # 5,000 NGN in kobo
        "email": "customer@example.com",
        "customer_name": "John Doe",
        "currency": "NGN",
        "reference": "ORDER-12345",
        "callback_url": "https://yoursite.com/payment/callback",
    },
)

data = response.json()["data"]
print(data["session_id"])
print(data["checkout_url"])

Amount is in kobo

All amounts are in kobo (minor currency units). NGN 5,000 = 500,000 kobo.

Step 2b: Redirect the customer

javascript
// After creating the session on your server
window.location.href = data.checkout_url;
// e.g. "https://secure.zevpaycheckout.com/abc-123-def"

After payment, the customer is redirected to your callback_url with query parameters:

https://yoursite.com/payment/callback?status=success&reference=ZVP-CKO-S-123456

Step 4: Verify payment (server-side)

Always verify the payment on your server before fulfilling the order:

bash
curl https://api.zevpaycheckout.com/v1/checkout/session/{session_id}/verify \
  -H "x-api-key: sk_test_your_secret_key"

Response:

json
{
  "success": true,
  "data": {
    "session_id": "abc-123-def",
    "reference": "ZVP-CKO-S-123456",
    "status": "completed",
    "amount": 500000,
    "currency": "NGN",
    "customer_email": "customer@example.com",
    "payment_method": "bank_transfer",
    "paid_at": "2026-03-07T14:30:00.000Z"
  }
}

Always verify server-side

Never rely solely on client-side callbacks. Always call the verify endpoint from your server to confirm the payment status before delivering goods or services.

For the most reliable integration, set up a webhook endpoint. See Webhooks for details.

Next steps

ZevPay Checkout Developer Documentation