# Quick Start

Accept your first payment in under 5 minutes.

## Prerequisites

- A ZevPay Checkout account — [sign up here](https://business.zevpay.ng)
- An API key pair (secret + public) from the dashboard

## Step 1: Get your API keys

1. Log in to the [ZevPay Checkout Dashboard](https://business.zevpay.ng)
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:

### Option A: Inline Checkout (recommended — no backend required)

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>
```

::: info 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](/guide/authentication#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)**

::: code-group

```bash [cURL]
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 [Node.js]
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 [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"])
```

:::

::: tip 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"
  }
}
```

::: warning 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.
:::

## Step 5: Handle webhooks (recommended)

For the most reliable integration, set up a webhook endpoint. See [Webhooks](/webhooks/overview) for details.

## Next steps

- [Authentication](/guide/authentication) — API key types and security
- [Checkout Sessions](/guide/checkout-sessions) — Detailed session lifecycle
- [Inline SDK Reference](/sdks/inline) — Full configuration options
- [Webhook Setup](/webhooks/overview) — Real-time payment notifications
