# ZevPay Checkout - Full Documentation
> Source: https://docs.zevpaycheckout.com
> Concatenated build of every page below. Each page is also available individually at its URL with a .md suffix (e.g. https://docs.zevpaycheckout.com/api/transactions.md).


---

## Source: https://docs.zevpaycheckout.com/api/dynamic-payid
<!-- file: api/dynamic-payid.md -->

# Dynamic PayID

Create and manage temporary, auto-expiring checkout PayIDs. Dynamic PayIDs are ideal for one-time payments, invoices, or payment links.

**Required permission:** `virtual_payid`

## Create Dynamic PayID

```
POST /v1/checkout/dynamic-payid
```

### Authentication

Requires a **secret key** (`sk_*`).

### Request body

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `amount` | number | No | Expected payment amount in naira (e.g., `5000`). If omitted, any amount is accepted |
| `amount_validation` | string | No | How to validate incoming amounts. Default: `"A4"`. See [amount validation rules](#amount-validation-rules) |
| `allow_multiple_payments` | boolean | No | Accept more than one payment. Default: `false` |
| `expires_in_minutes` | integer | No | Expiry time in minutes. Default: `1440` (24h). Max: `4320` (72h) |
| `name` | string | No | Display name (max 255 chars). Auto-generated from your account name if omitted |
| `metadata` | object | No | Custom key-value data stored with the PayID |

::: tip Settlement
Payments received on this PayID are settled to your API key's configured settlement ledger. To change where payments are settled, update your API key's settlement configuration in the [dashboard](https://dashboard.zevpaycheckout.com).
:::

### Example request

::: code-group

```bash [cURL]
curl -X POST https://api.zevpaycheckout.com/v1/checkout/dynamic-payid \
  -H "Content-Type: application/json" \
  -H "x-api-key: sk_test_your_secret_key" \
  -d '{
    "amount": 5000,
    "amount_validation": "A0",
    "name": "Invoice #1234",
    "expires_in_minutes": 1440,
    "metadata": {
      "invoice_id": "INV-1234"
    }
  }'
```

```javascript [Node.js]
const response = await fetch(
  "https://api.zevpaycheckout.com/v1/checkout/dynamic-payid",
  {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "x-api-key": "sk_test_your_secret_key",
    },
    body: JSON.stringify({
      amount: 5000,
      amount_validation: "A0",
      name: "Invoice #1234",
      expires_in_minutes: 1440,
      metadata: { invoice_id: "INV-1234" },
    }),
  }
);
const data = await response.json();
```

:::

### Response

```json
{
  "success": true,
  "data": {
    "id": "a1b2c3d4-...",
    "slug": "a4b7",
    "suffix": ".dypid",
    "full_pay_id": "a4b7.dypid",
    "settlement_pay_id_id": "s1t2u3v4-...",
    "creator_pay_id_id": "c1d2e3f4-...",
    "creator_type": "business",
    "business_id": "b1c2d3e4-...",
    "name": "Invoice #1234",
    "amount": "5000.00",
    "amount_validation": "A0",
    "allow_multiple_payments": false,
    "status": "active",
    "source": "api",
    "expires_at": "2026-03-09T12:00:00.000Z",
    "deactivated_at": null,
    "completed_at": null,
    "created_at": "2026-03-08T12:00:00.000Z"
  }
}
```

---

## List Dynamic PayIDs

```
GET /v1/checkout/dynamic-payid
```

### Query parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `page` | integer | 1 | Page number |
| `page_size` | integer | 20 | Items per page (max 100) |
| `status` | string | none | Filter: `"active"`, `"completed"`, `"expired"`, `"deactivated"` |
| `search` | string | none | Search by slug, name, or PayID |

### Example request

```bash
curl "https://api.zevpaycheckout.com/v1/checkout/dynamic-payid?status=active&page_size=10" \
  -H "x-api-key: sk_test_your_secret_key"
```

### Response

```json
{
  "success": true,
  "data": {
    "items": [
      {
        "id": "a1b2c3d4-...",
        "full_pay_id": "a4b7.dypid",
        "name": "Invoice #1234",
        "amount": "5000.00",
        "status": "active",
        "expires_at": "2026-03-09T12:00:00.000Z",
        "created_at": "2026-03-08T12:00:00.000Z"
      }
    ],
    "total": 1,
    "page": 1,
    "page_size": 10,
    "total_pages": 1
  }
}
```

---

## Get Dynamic PayID

```
GET /v1/checkout/dynamic-payid/:id
```

### Path parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `id` | string | Dynamic PayID UUID |

### Example request

```bash
curl https://api.zevpaycheckout.com/v1/checkout/dynamic-payid/a1b2c3d4-... \
  -H "x-api-key: sk_test_your_secret_key"
```

---

## Deactivate Dynamic PayID

Deactivate a dynamic PayID before its natural expiry.

```
DELETE /v1/checkout/dynamic-payid/:id
```

### Example request

```bash
curl -X DELETE https://api.zevpaycheckout.com/v1/checkout/dynamic-payid/a1b2c3d4-... \
  -H "x-api-key: sk_test_your_secret_key"
```

### Response

```json
{
  "success": true,
  "data": {
    "success": true,
    "message": "Dynamic PayID deactivated."
  }
}
```

---

## Amount Validation Rules

Control how incoming payment amounts are validated against the configured `amount`:

| Rule | Description |
|------|-------------|
| `A0` | **Exact match**: payment must equal the amount exactly |
| `A1` | **Less than**: payment must be less than the amount |
| `A2` | **Greater than**: payment must be greater than the amount |
| `A3` | **At most**: payment must be equal to or less than the amount |
| `A4` | **At least**: payment must be equal to or greater than the amount (default) |
| `A5` | **Any amount**: no validation applied |

If `amount` is not set, all incoming payments are accepted regardless of the validation rule.

---

## Response fields

| Field | Type | Description |
|-------|------|-------------|
| `id` | string | Unique identifier (UUID) |
| `slug` | string | Short auto-generated slug |
| `suffix` | string | Always `".dypid"` |
| `full_pay_id` | string | Complete PayID (e.g., `"a4b7.dypid"`) |
| `settlement_pay_id_id` | string | PayID where payments are settled |
| `creator_pay_id_id` | string | Creator's PayID UUID |
| `creator_type` | string | `"personal"` or `"business"` |
| `business_id` | string\|null | Business UUID (if created by a business) |
| `name` | string | Display name |
| `amount` | string\|null | Configured amount (naira, e.g., `"5000.00"`) |
| `amount_validation` | string | Validation rule (`A0`–`A5`) |
| `allow_multiple_payments` | boolean | Whether multiple payments are accepted |
| `status` | string | `"active"`, `"completed"`, `"expired"`, or `"deactivated"` |
| `source` | string | Creation source (`"api"`, `"dashboard"`, etc.) |
| `expires_at` | string | ISO 8601 expiry timestamp |
| `deactivated_at` | string\|null | When deactivated (if applicable) |
| `completed_at` | string\|null | When a payment was received (if applicable) |
| `created_at` | string | ISO 8601 creation timestamp |

## Try it: Create Dynamic PayID

<ApiPlayground
  method="POST"
  endpoint="/v1/checkout/dynamic-payid"
  :bodyFields="[
    { name: 'amount', type: 'integer', placeholder: '5000', description: 'Amount in naira' },
    { name: 'amount_validation', type: 'select', options: [{ label: 'A0: Exact match', value: 'A0' }, { label: 'A1: Less than', value: 'A1' }, { label: 'A2: Greater than', value: 'A2' }, { label: 'A3: At most', value: 'A3' }], placeholder: 'Default: A4 (At least)' },
    { name: 'allow_multiple_payments', type: 'select', options: [{ label: 'false', value: 'false' }, { label: 'true', value: 'true' }] },
    { name: 'expires_in_minutes', type: 'integer', placeholder: '1440', description: 'Default: 1440 (24h)' },
    { name: 'name', type: 'string', placeholder: 'Invoice #1234' },
    { name: 'metadata', type: 'object', placeholder: '{ &quot;invoice_id&quot;: &quot;INV-1234&quot; }' },
  ]"
/>

## Try it: List Dynamic PayIDs

<ApiPlayground
  method="GET"
  endpoint="/v1/checkout/dynamic-payid"
  :queryParams="[
    { name: 'page', type: 'integer', placeholder: '1', default: '1' },
    { name: 'page_size', type: 'integer', placeholder: '20' },
    { name: 'status', type: 'select', options: [{ label: 'Active', value: 'active' }, { label: 'Completed', value: 'completed' }, { label: 'Expired', value: 'expired' }, { label: 'Deactivated', value: 'deactivated' }] },
    { name: 'search', type: 'string', placeholder: 'Search by slug, name, or PayID' },
  ]"
/>

---

## Source: https://docs.zevpaycheckout.com/api/errors
<!-- file: api/errors.md -->

# Errors

We use standard HTTP status codes and consistent error response formats.

## Error response format

All error responses follow this structure:

```json
{
  "success": false,
  "error": {
    "code": "HTTP_ERROR",
    "message": "A human-readable error description"
  },
  "correlationId": "-"
}
```

| Field | Type | Description |
|-------|------|-------------|
| `success` | boolean | Always `false` for errors |
| `error.code` | string | Machine-readable error code |
| `error.message` | string | Human-readable description of what went wrong |
| `correlationId` | string | Request correlation ID (from `x-correlation-id` header, or `"-"`) |

## Error codes

| Code | Description |
|------|-------------|
| `HTTP_ERROR` | Standard HTTP error (bad request, not found, unauthorized, etc.) |
| `INTERNAL_ERROR` | Unexpected server error |
| `MERCHANT_NOT_VERIFIED` | The merchant account has not completed verification; API calls are refused until it has |
| `STATIC_ACCOUNT_NOT_ENABLED` | Static NGN Accounts are not enabled for this merchant. See [Static NGN Account](/api/static-account#errors) for the product's other codes |
| `IDENTITY_MISMATCH` | The name supplied does not match the identity record (Static NGN Account creation) |

## HTTP status codes

| Code | Meaning | Description |
|------|---------|-------------|
| `200` | OK | Request succeeded |
| `400` | Bad Request | Invalid parameters, expired session, or business logic error |
| `401` | Unauthorized | Missing or invalid API key |
| `403` | Forbidden | Origin not allowed for this API key |
| `404` | Not Found | Resource does not exist |
| `429` | Too Many Requests | Rate limit exceeded |
| `500` | Internal Server Error | Something went wrong on our end |

## Common errors

### Authentication errors

| Status | Message | Cause | Solution |
|--------|---------|-------|----------|
| `401` | Invalid API key | API key not found or inactive | Check your API key is correct and active |
| `403` | Origin not allowed for this API key | Request origin doesn't match allowed domains | Add your domain to the API key's allowed domains in the dashboard |

### Session errors

| Status | Message | Cause | Solution |
|--------|---------|-------|----------|
| `404` | Session not found. | Invalid session ID | Verify the session ID is correct |
| `400` | Session is expired. | Session status is `expired` | Create a new session |
| `400` | Session is completed. | Payment already received | No action needed, payment is done |
| `400` | Session has expired. | Session's `expiresAt` time has passed | Create a new session |
| `400` | Session does not belong to this API key. | API key not from the same key pair | Use a key from the same key pair used to create the session |

### Payment method errors

| Status | Message | Cause | Solution |
|--------|---------|-------|----------|
| `400` | Unsupported payment method: {method} | Invalid `payment_method` value | Use `"bank_transfer"` or `"payid"` |

### Validation errors

| Status | Message | Cause | Solution |
|--------|---------|-------|----------|
| `400` | amount must not be less than 100 | Amount below minimum | Minimum is 100 kobo (NGN 1.00) |
| `400` | email must be an email | Invalid email format | Provide a valid email address |

### Rate limit errors

| Status | Message | Cause | Solution |
|--------|---------|-------|----------|
| `429` | Too Many Requests | Exceeded 100 requests/min (or 30/min for session initialization) | Wait and retry with exponential backoff. See [Rate Limiting](/guide/rate-limiting) |

::: tip Handling errors
Always check the `success` field in the response. If `false`, read `error.message` for details. Implement exponential backoff for `429` and `5xx` errors.
:::

## Error handling example

::: code-group

```js [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,
    currency: 'NGN',
    email: 'customer@example.com',
  }),
});

const result = await response.json();

if (!response.ok || result.success === false) {
  console.error(`Error: ${result.error?.message || 'Unknown error'}`);
  // Handle error appropriately
  return;
}

// Success
const session = result.data;
```

```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,
        "currency": "NGN",
        "email": "customer@example.com",
    },
)

result = response.json()

if not response.ok or not result.get("success"):
    error = result.get("error", {})
    print(f"Error: {error.get('message', 'Unknown error')}")
    # Handle error
else:
    session = result["data"]
```

:::

---

## Source: https://docs.zevpaycheckout.com/api/get-session
<!-- file: api/get-session.md -->

# Get Session

Retrieve the full details of a checkout session, including merchant info and enabled payment methods.

```
GET /v1/checkout/session/:sessionId
```

## Authentication

Requires an API key (public or secret). Origin/domain validation is enforced for public keys.

## Path parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `sessionId` | string | The checkout session ID |

## Example request

::: code-group

```bash [cURL]
curl https://api.zevpaycheckout.com/v1/checkout/session/ecc48011-e36e-4741-9b99-657f4a1ee86e \
  -H "x-api-key: pk_test_your_public_key"
```

```js [Node.js]
const response = await fetch(
  'https://api.zevpaycheckout.com/v1/checkout/session/ecc48011-e36e-4741-9b99-657f4a1ee86e',
  {
    headers: {
      'x-api-key': 'pk_test_your_public_key',
    },
  }
);

const { data } = await response.json();
console.log(data.status); // "active"
```

```python [Python]
import requests

response = requests.get(
    "https://api.zevpaycheckout.com/v1/checkout/session/ecc48011-e36e-4741-9b99-657f4a1ee86e",
    headers={"x-api-key": "pk_test_your_public_key"},
)

data = response.json()["data"]
print(data["merchant_name"])
```

:::

## Response

```json
{
  "success": true,
  "data": {
    "session_id": "ecc48011-e36e-4741-9b99-657f4a1ee86e",
    "amount": 500000,
    "currency": "NGN",
    "customer_email": "customer@example.com",
    "customer_name": null,
    "merchant_name": "Acme Store",
    "enabled_payment_methods": ["bank_transfer", "payid"],
    "callback_url": "https://merchant.com/payment/callback",
    "expires_at": "2026-03-07T19:37:00.000Z",
    "status": "active"
  }
}
```

| Field | Type | Description |
|-------|------|-------------|
| `session_id` | string | The checkout session ID |
| `amount` | integer | Amount in kobo |
| `currency` | string | Currency code (e.g., `"NGN"`) |
| `customer_email` | string | Customer's email address |
| `customer_name` | string \| null | Customer's name (if provided) |
| `merchant_name` | string \| null | Merchant's business name from checkout configuration |
| `enabled_payment_methods` | string[] | Available payment methods for this session |
| `callback_url` | string \| null | URL to redirect after payment (standard checkout) |
| `expires_at` | string | ISO 8601 timestamp when the session expires |
| `status` | string | Current session status: `active`, `completed`, `expired`, or `failed` |

## Behavior

- If the session is `active` but past its `expires_at` time, the status is automatically updated to `expired`
- This endpoint is used by the checkout UI to render session details

## Errors

| Status | Message | Cause |
|--------|---------|-------|
| `404` | Session not found. | Invalid session ID |
| `401` | Invalid API key | Key not found or inactive |

## Try it

<ApiPlayground
  method="GET"
  endpoint="/v1/checkout/session/:sessionId"
  :pathParams="[
    { name: 'sessionId', type: 'string', required: true, placeholder: 'ecc48011-e36e-4741-9b99-657f4a1ee86e' },
  ]"
/>

---

## Source: https://docs.zevpaycheckout.com/api/initialize-session
<!-- file: api/initialize-session.md -->

# Initialize Session

Create a new checkout session for collecting a payment.

```
POST /v1/checkout/session/initialize
```

## Authentication

This endpoint accepts both **secret keys** (`sk_*`) and **public keys** (`pk_*`).

| Key type | Use case | Origin validation |
|----------|----------|-------------------|
| **Secret key** | Server-to-server (standard checkout, API-only) | None |
| **Public key** | Client-side (inline checkout SDK) | Enforced if `allowedDomains` is configured on the key |

::: tip Inline checkout: no backend required
[Inline Checkout](/checkout/inline) uses your public key to call this endpoint directly from the browser. You don't need a backend server to accept payments with inline checkout. Configure `allowedDomains` on your API key to restrict which domains can use it. See [Domain Whitelisting](/guide/authentication#domain-whitelisting).
:::

## Request body

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `amount` | integer | Yes | Amount in **kobo** (minor units). Minimum: `100` (NGN 1.00) |
| `email` | string | Yes | Customer's email address |
| `customer_name` | string | No | Customer's name (max 255 chars). Displayed in dashboard instead of "Anonymous" |
| `currency` | string | No | Currency code (max 3 chars). Default: `"NGN"` |
| `reference` | string | No | Your unique reference for reconciliation and idempotency (max 255 chars). Same reference and amount returns the active session; same reference with a new amount replaces it. See [idempotency](/checkout/standard#idempotency) |
| `callback_url` | string | No | URL to redirect after payment, required for standard checkout (max 2048 chars) |
| `metadata` | object | No | Custom key-value data stored with the session |
| `payment_methods` | string[] | No | Methods to offer: `"bank_transfer"`, `"payid"`, `"card"`, `"crypto"`. Omit for the methods configured on your key (default `["bank_transfer", "payid"]`). An explicit list is honoured exactly — include `"crypto"` (or pass `crypto_assets`) to offer it; crypto joins automatically only when `payment_methods` is omitted. Pass only `["crypto"]` for a crypto-only checkout. See [Payment Methods](/payment-methods/overview#how-availability-is-decided) |
| `crypto_assets` | string[] | No | Narrow the crypto assets offered: `"USDT:TRON"` (one network) or `"USDT"` (every network). Only assets enabled on your key can appear. Omit to offer every eligible asset |

## Example request

::: 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/callback",
    "metadata": {
      "order_id": "12345"
    },
    "payment_methods": ["bank_transfer", "payid"]
  }'
```

```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,
      email: "customer@example.com",
      customer_name: "John Doe",
      currency: "NGN",
      reference: "ORDER-12345",
      callback_url: "https://yoursite.com/callback",
    }),
  }
);

const { data } = await response.json();
console.log(data.session_id);   // "ecc48011-e36e-4741-9b99-657f4a1ee86e"
console.log(data.checkout_url); // "https://secure.zevpaycheckout.com/ecc48011-..."
```

```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,
        "email": "customer@example.com",
        "customer_name": "John Doe",
        "currency": "NGN",
        "reference": "ORDER-12345",
        "callback_url": "https://yoursite.com/callback",
    },
)

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

```php [PHP]
$ch = curl_init("https://api.zevpaycheckout.com/v1/checkout/session/initialize");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => [
        "Content-Type: application/json",
        "x-api-key: sk_test_your_secret_key",
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "amount" => 500000,
        "email" => "customer@example.com",
        "customer_name" => "John Doe",
        "currency" => "NGN",
        "reference" => "ORDER-12345",
    ]),
]);
$response = json_decode(curl_exec($ch), true);
$sessionId = $response["data"]["session_id"];
```

:::

## Response

```json
{
  "success": true,
  "data": {
    "session_id": "ecc48011-e36e-4741-9b99-657f4a1ee86e",
    "reference": "ZVP-CKO-S-1772906868046-d5aa1c0b99153aae4766af242e656e80",
    "merchant_reference": "ORDER-12345",
    "checkout_url": "https://secure.zevpaycheckout.com/ecc48011-e36e-4741-9b99-657f4a1ee86e",
    "amount": 500000,
    "currency": "NGN",
    "expires_at": "2026-03-07T19:37:00.000Z",
    "merchant_name": "Your Business Name",
    "enabled_payment_methods": ["bank_transfer", "payid"]
  }
}
```

### Response fields

| Field | Type | Description |
|-------|------|-------------|
| `session_id` | string | Unique session identifier (UUID) |
| `reference` | string | Our unique payment reference (prefix: `ZVP-CKO-S`) |
| `merchant_reference` | string \| null | Your reference (if provided) |
| `checkout_url` | string | URL for standard checkout redirect |
| `amount` | integer | Amount in kobo (same as request) |
| `currency` | string | Currency code |
| `expires_at` | string | ISO 8601 expiry timestamp (30 minutes from creation) |
| `merchant_name` | string \| null | Your business name from checkout configuration |
| `enabled_payment_methods` | string[] | Active payment methods for this session. Includes `"crypto"` when the key qualifies, see [Crypto](/payment-methods/crypto) |
| `crypto_assets` | array \| null | Crypto assets offered on this session, each `{ assetCode, network, displayName, decimals }`. Null when crypto is not offered |

## Errors

| Status | Message | Cause |
|--------|---------|-------|
| `400` | Validation error | Missing or invalid parameters (e.g., `amount must not be less than 100`) |
| `401` | Invalid API key | Key not found or inactive |
| `403` | Origin not allowed for this API key | Public key used from unauthorized domain |

## Try it

<ApiPlayground
  method="POST"
  endpoint="/v1/checkout/session/initialize"
  :bodyFields="[
    { name: 'amount', type: 'integer', required: true, placeholder: '500000', description: 'Amount in kobo' },
    { name: 'email', type: 'string', required: true, placeholder: 'customer@example.com' },
    { name: 'customer_name', type: 'string', placeholder: 'John Doe' },
    { name: 'currency', type: 'string', placeholder: 'NGN', default: 'NGN' },
    { name: 'reference', type: 'string', placeholder: 'ORDER-12345' },
    { name: 'callback_url', type: 'string', placeholder: 'https://yoursite.com/callback' },
    { name: 'metadata', type: 'object', placeholder: '{ &quot;order_id&quot;: &quot;12345&quot; }' },
    { name: 'payment_methods', type: 'array', placeholder: 'bank_transfer, payid' },
  ]"
/>

---

## Source: https://docs.zevpaycheckout.com/api/invoice
<!-- file: api/invoice.md -->

# Invoice

Create programmable invoices via API and let your customers pay through the standard checkout gateway. Invoices support partial payments, tax calculations, line items, and automated status tracking.

**Required permission:** `invoices`

## How it works

1. **Create** an invoice via API with customer details, line items, and due date
2. **Send** the invoice (transitions from draft to sent)
3. **Share** the `payment_url` with your customer
4. Customer opens the payment URL and pays via bank transfer or PayID
5. Invoice status updates automatically: `partial` → `paid`
6. You receive webhook events for each status change

---

## Create Invoice

```
POST /v1/checkout/invoice
```

Creates a new invoice in `draft` status. You must [send](#send-invoice) the invoice before customers can pay.

### Authentication

Requires a **secret key** (`sk_*`).

### Request body

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `customer_name` | string | Yes | Customer's full name (max 255 characters) |
| `customer_email` | string | Yes | Customer's email address |
| `customer_address` | string | No | Customer's street address |
| `customer_city` | string | No | Customer's city (max 100) |
| `customer_state` | string | No | Customer's state/region (max 100) |
| `customer_country` | string | No | Customer's country (max 100) |
| `line_items` | array | Yes | Array of line item objects (at least one) |
| `line_items[].description` | string | Yes | Description of the item (max 500) |
| `line_items[].quantity` | number | Yes | Quantity (supports decimals, min 0.01) |
| `line_items[].unit_price` | integer | Yes | Unit price in **kobo** |
| `tax_rate` | number | No | Tax rate as percentage (0–100, e.g., `7.5` for 7.5%). Default: `0`. Mutually exclusive with `tax_amount` |
| `tax_amount` | integer | No | Flat tax amount in **kobo**, taken verbatim: `total = subtotal + tax_amount`, exactly. Use when your system computes tax itself. Mutually exclusive with `tax_rate` |
| `due_date` | string | Yes | Due date in ISO 8601 format |
| `invoice_number` | string | No | Custom invoice number (max 64). Auto-generated if omitted (e.g., `INV-202603-001`) |
| `reference` | string | No | Your unique reference for reconciliation (max 255) |
| `note` | string | No | Note to display on the invoice payment page (max 2000) |
| `payment_methods` | string[] | No | Methods to offer on this invoice's checkout: `bank_transfer`, `payid`, `card`, `crypto`. Omit for your key's configuration. See [Choosing payment methods](/checkout/invoice#choosing-payment-methods) |
| `crypto_assets` | string[] | No | Narrow the crypto assets offered, e.g. `["USDT:TRON"]` |
| `metadata` | object | No | Custom key-value data stored with the invoice |

### Example request

::: code-group

```bash [cURL]
curl -X POST https://api.zevpaycheckout.com/v1/checkout/invoice \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk_test_your_secret_key" \
  -d '{
    "customer_name": "Chidi Okonkwo",
    "customer_email": "chidi@example.com",
    "customer_address": "15 Admiralty Way, Lekki Phase 1",
    "customer_city": "Lagos",
    "customer_state": "Lagos",
    "customer_country": "Nigeria",
    "line_items": [
      {
        "description": "Website Development",
        "quantity": 1,
        "unit_price": 35000000
      },
      {
        "description": "Monthly Hosting (12 months)",
        "quantity": 12,
        "unit_price": 500000
      }
    ],
    "tax_rate": 7.5,
    "due_date": "2026-03-31T00:00:00Z",
    "reference": "PROJECT-2026-001",
    "note": "Thank you for your business!",
    "metadata": {
      "project_id": "PRJ-123"
    }
  }'
```

```javascript [Node.js]
const response = await fetch(
  "https://api.zevpaycheckout.com/v1/checkout/invoice",
  {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "Authorization": "Bearer sk_test_your_secret_key",
    },
    body: JSON.stringify({
      customer_name: "Chidi Okonkwo",
      customer_email: "chidi@example.com",
      customer_address: "15 Admiralty Way, Lekki Phase 1",
      customer_city: "Lagos",
      customer_state: "Lagos",
      customer_country: "Nigeria",
      line_items: [
        { description: "Website Development", quantity: 1, unit_price: 35000000 },
        { description: "Monthly Hosting (12 months)", quantity: 12, unit_price: 500000 },
      ],
      tax_rate: 7.5,
      due_date: "2026-03-31T00:00:00Z",
      reference: "PROJECT-2026-001",
      note: "Thank you for your business!",
      metadata: { project_id: "PRJ-123" },
    }),
  }
);
const data = await response.json();
```

```python [Python]
import requests

response = requests.post(
    "https://api.zevpaycheckout.com/v1/checkout/invoice",
    headers={
        "Content-Type": "application/json",
        "Authorization": "Bearer sk_test_your_secret_key",
    },
    json={
        "customer_name": "Chidi Okonkwo",
        "customer_email": "chidi@example.com",
        "customer_address": "15 Admiralty Way, Lekki Phase 1",
        "customer_city": "Lagos",
        "customer_state": "Lagos",
        "customer_country": "Nigeria",
        "line_items": [
            {"description": "Website Development", "quantity": 1, "unit_price": 35000000},
            {"description": "Monthly Hosting (12 months)", "quantity": 12, "unit_price": 500000},
        ],
        "tax_rate": 7.5,
        "due_date": "2026-03-31T00:00:00Z",
        "reference": "PROJECT-2026-001",
        "note": "Thank you for your business!",
        "metadata": {"project_id": "PRJ-123"},
    },
)
data = response.json()
```

:::

### Response

```json
{
  "success": true,
  "data": {
    "public_id": "abc123def456ghi78",
    "invoice_number": "INV-202603-001",
    "status": "draft",
    "customer_name": "Chidi Okonkwo",
    "customer_email": "chidi@example.com",
    "customer_address": "15 Admiralty Way, Lekki Phase 1",
    "customer_city": "Lagos",
    "customer_state": "Lagos",
    "customer_country": "Nigeria",
    "subtotal": 41000000,
    "tax_rate": 7.5,
    "tax_amount": 3075000,
    "total": 44075000,
    "amount_paid": 0,
    "currency": "NGN",
    "due_date": "2026-03-31T00:00:00.000Z",
    "issued_at": null,
    "paid_at": null,
    "cancelled_at": null,
    "merchant_reference": "PROJECT-2026-001",
    "metadata": { "project_id": "PRJ-123" },
    "note": "Thank you for your business!",
    "payment_url": "https://invoice.zevpaycheckout.com/pay/abc123def456ghi78?token=...",
    "created_at": "2026-03-08T10:00:00.000Z"
  }
}
```

### Response fields

| Field | Type | Description |
|-------|------|-------------|
| `public_id` | string | Unique public identifier for the invoice |
| `invoice_number` | string | Human-readable invoice number (auto-generated or custom) |
| `status` | string | Current status: `draft`, `sent`, `partial`, `paid`, `overdue`, `cancelled` |
| `customer_name` | string | Customer's full name |
| `customer_email` | string | Customer's email address |
| `customer_address` | string \| null | Customer's street address |
| `customer_city` | string \| null | Customer's city |
| `customer_state` | string \| null | Customer's state/region |
| `customer_country` | string \| null | Customer's country |
| `subtotal` | integer | Subtotal in kobo (sum of line items, before tax) |
| `tax_rate` | number | Tax rate as a percentage (e.g., `7.5`). `0` when the invoice uses a flat `tax_amount` |
| `tax_amount` | integer | Tax amount in kobo (derived from `tax_rate`, or the flat amount you supplied) |
| `total` | integer | Total amount in kobo (subtotal + tax) |
| `amount_paid` | integer | Cumulative amount paid so far, in kobo |
| `currency` | string | Currency code. Always `"NGN"` |
| `due_date` | string | Due date in ISO 8601 format |
| `issued_at` | string \| null | Timestamp when invoice was sent (ISO 8601). `null` for drafts |
| `paid_at` | string \| null | Timestamp when invoice was fully paid. `null` until paid |
| `cancelled_at` | string \| null | Timestamp when invoice was cancelled. `null` unless cancelled |
| `merchant_reference` | string \| null | Your custom reference, if provided |
| `metadata` | object \| null | Your custom key-value data, if provided |
| `note` | string \| null | Invoice note, if provided |
| `payment_url` | string | URL for the customer to view and pay the invoice |
| `created_at` | string | Invoice creation timestamp (ISO 8601) |

::: tip Amounts
All monetary amounts in the API are in **kobo** (1 NGN = 100 kobo). For example, `35000000` kobo = ₦350,000.00.
:::

::: tip Payment URL
Store the `public_id` (and optionally the `payment_url`) in your database. The `payment_url` resolves to the payment page when the invoice is payable, or shows a receipt when paid.
:::

---

## Update Invoice

```
PATCH /v1/checkout/invoice/:publicId
```

Updates an invoice. What you may change depends on whether it has been sent.

**Draft invoices** are fully editable, including line items, tax and the customer.

**Sent invoices** can still have their *terms* changed, because things like extending a due date are ordinary and should not cost you the invoice's history or its link:

| Editable after sending | Not editable after sending |
|------------------------|----------------------------|
| `due_date` | `line_items` |
| `note` | `tax_rate`, `tax_amount` |
| `allow_partial_payments` | `customer_name`, `customer_email`, `customer_address` |
| `minimum_initial_payment` | `invoice_number` |
| `subsequent_payment_rule` | |
| `due_date_action` | |
| `payment_methods`, `crypto_assets` | |
| `return_url`, `merchant_reference`, `metadata` | |

The second column is the money and who owes it. Changing that after a customer has agreed the invoice, and possibly already paid part of it, produces a different document rather than an edited one. Cancel and issue a new invoice instead.

Paid and cancelled invoices cannot be edited at all.

### Extending a due date

The common case. Send the new date and nothing else:

```bash
curl -X PATCH https://api.zevpaycheckout.com/v1/checkout/invoice/{public_id} \
  -H "x-api-key: sk_live_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{ "due_date": "2026-07-31T00:00:00Z" }'
```

An invoice that had already gone `overdue` returns to `sent`, or to `partial` if part of it is paid, as soon as the new date is in the future. The customer stops seeing a past-due invoice immediately rather than waiting for the next sweep.

The change is recorded on the invoice's [activity log](/checkout/invoice-instalments#the-activity-log) as "Due date extended", with the old and new dates, so there is a record of when the terms moved and what moved them.

### Authentication

Requires a **secret key** (`sk_*`).

### Path parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `publicId` | string | The invoice's `public_id` |

### Request body

All fields are optional. Only include the fields you want to change.

| Parameter | Type | Description |
|-----------|------|-------------|
| `customer_name` | string | Customer's full name |
| `customer_email` | string | Customer's email address |
| `customer_address` | string | Customer's street address |
| `customer_city` | string | Customer's city |
| `customer_state` | string | Customer's state/region |
| `customer_country` | string | Customer's country |
| `line_items` | array | Replacement line items (replaces all existing items) |
| `line_items[].description` | string | Item description |
| `line_items[].quantity` | number | Quantity |
| `line_items[].unit_price` | integer | Unit price in kobo |
| `tax_rate` | number | Tax rate as percentage (0–100). Mutually exclusive with `tax_amount` |
| `tax_amount` | integer | Flat tax amount in kobo (`total = subtotal + tax_amount`, exactly). Mutually exclusive with `tax_rate` |
| `due_date` | string | Due date in ISO 8601 format |
| `invoice_number` | string | Custom invoice number |
| `note` | string | Invoice note |
| `return_url` | string | URL the customer lands on after paying |
| `allow_partial_payments` | boolean | Whether the customer may pay less than the remaining balance |
| `payment_methods` | string[] | Methods to offer on this invoice's checkout. Send `[]` to fall back to your key's configuration |
| `crypto_assets` | string[] | Narrow the crypto assets offered. Send `[]` to offer every eligible asset |
| `metadata` | object | Custom key-value data |

::: warning Line items replacement
When you include `line_items` in an update, all existing line items are **replaced**, not merged. Always send the complete list of line items you want on the invoice.
:::

### Example request

::: code-group

```bash [cURL]
curl -X PATCH https://api.zevpaycheckout.com/v1/checkout/invoice/abc123def456ghi78 \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk_test_your_secret_key" \
  -d '{
    "note": "Updated: payment due by end of month",
    "due_date": "2026-04-15T00:00:00Z"
  }'
```

```javascript [Node.js]
const response = await fetch(
  "https://api.zevpaycheckout.com/v1/checkout/invoice/abc123def456ghi78",
  {
    method: "PATCH",
    headers: {
      "Content-Type": "application/json",
      "Authorization": "Bearer sk_test_your_secret_key",
    },
    body: JSON.stringify({
      note: "Updated: payment due by end of month",
      due_date: "2026-04-15T00:00:00Z",
    }),
  }
);
const data = await response.json();
```

```python [Python]
import requests

response = requests.patch(
    "https://api.zevpaycheckout.com/v1/checkout/invoice/abc123def456ghi78",
    headers={
        "Content-Type": "application/json",
        "Authorization": "Bearer sk_test_your_secret_key",
    },
    json={
        "note": "Updated: payment due by end of month",
        "due_date": "2026-04-15T00:00:00Z",
    },
)
data = response.json()
```

:::

### Response

Returns the updated invoice object (same shape as [Create Invoice](#create-invoice) response).

### Errors

| Status | Message | Cause |
|--------|---------|-------|
| 404 | Invoice not found | Invoice does not exist or does not belong to your account |
| 400 | Cannot edit an invoice with status "paid" / "cancelled" | The invoice is closed |
| 400 | An invoice that has been sent cannot change {fields} | You tried to edit line items, tax or the customer after sending. Adjust the terms instead, or cancel and re-issue |
| 400 | Invoice total must be greater than zero | Updated line items result in zero or negative total |
| 400 | minimum_initial_payment cannot be more than the invoice total | The deposit exceeds what is being billed |
| 400 | minimum_initial_payment cannot be changed after the first payment has been made | The deposit rule only applies to the first payment, which has already happened |

---

## List Invoices

```
GET /v1/checkout/invoice
```

Returns a paginated list of your invoices, ordered by creation date (newest first).

### Authentication

Requires a **secret key** (`sk_*`).

### Query parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `page` | integer | No | Page number (min 1). Default: `1` |
| `page_size` | integer | No | Items per page (1–100). Default: `20` |
| `status` | string | No | Filter by status: `draft`, `sent`, `partial`, `paid`, `overdue`, `cancelled` |
| `customer_email` | string | No | Filter by exact customer email address |
| `search` | string | No | Search by invoice number, customer name, or customer email (partial match) |

::: info customer_email vs search
`customer_email` performs an **exact match** on the email field. `search` performs a **partial match** (contains) across invoice number, customer name, and email. Use `customer_email` when you know the exact email; use `search` for flexible lookups.
:::

### Example request

::: code-group

```bash [cURL]
# List all sent invoices
curl "https://api.zevpaycheckout.com/v1/checkout/invoice?status=sent&page=1&page_size=20" \
  -H "Authorization: Bearer sk_test_your_secret_key"

# Filter by customer email
curl "https://api.zevpaycheckout.com/v1/checkout/invoice?customer_email=chidi@example.com" \
  -H "Authorization: Bearer sk_test_your_secret_key"
```

```javascript [Node.js]
// List all sent invoices
const response = await fetch(
  "https://api.zevpaycheckout.com/v1/checkout/invoice?status=sent&page=1",
  {
    headers: { "Authorization": "Bearer sk_test_your_secret_key" },
  }
);
const data = await response.json();

// Filter by customer email
const byEmail = await fetch(
  "https://api.zevpaycheckout.com/v1/checkout/invoice?customer_email=chidi@example.com",
  {
    headers: { "Authorization": "Bearer sk_test_your_secret_key" },
  }
);
```

```python [Python]
import requests

# List all sent invoices
response = requests.get(
    "https://api.zevpaycheckout.com/v1/checkout/invoice",
    headers={"Authorization": "Bearer sk_test_your_secret_key"},
    params={"status": "sent", "page": 1, "page_size": 20},
)
data = response.json()

# Filter by customer email
by_email = requests.get(
    "https://api.zevpaycheckout.com/v1/checkout/invoice",
    headers={"Authorization": "Bearer sk_test_your_secret_key"},
    params={"customer_email": "chidi@example.com"},
)
```

:::

### Response

```json
{
  "success": true,
  "data": {
    "items": [
      {
        "public_id": "abc123def456ghi78",
        "invoice_number": "INV-202603-001",
        "status": "sent",
        "customer_name": "Chidi Okonkwo",
        "customer_email": "chidi@example.com",
        "customer_address": "15 Admiralty Way, Lekki Phase 1",
        "customer_city": "Lagos",
        "customer_state": "Lagos",
        "customer_country": "Nigeria",
        "subtotal": 41000000,
        "tax_rate": 7.5,
        "tax_amount": 3075000,
        "total": 44075000,
        "amount_paid": 0,
        "currency": "NGN",
        "due_date": "2026-03-31T00:00:00.000Z",
        "issued_at": "2026-03-08T10:05:00.000Z",
        "paid_at": null,
        "cancelled_at": null,
        "merchant_reference": "PROJECT-2026-001",
        "metadata": { "project_id": "PRJ-123" },
        "note": "Thank you for your business!",
        "payment_url": "https://invoice.zevpaycheckout.com/pay/abc123def456ghi78?token=...",
        "created_at": "2026-03-08T10:00:00.000Z"
      }
    ],
    "total": 1,
    "page": 1,
    "page_size": 20,
    "total_pages": 1
  }
}
```

### Pagination fields

| Field | Type | Description |
|-------|------|-------------|
| `items` | array | Array of invoice objects (same fields as Create response) |
| `total` | integer | Total number of invoices matching the filters |
| `page` | integer | Current page number |
| `page_size` | integer | Number of items per page |
| `total_pages` | integer | Total number of pages |

---

## Get Invoice

```
GET /v1/checkout/invoice/:publicId
```

Returns a single invoice with its **line items** and **payment history**.

This is the endpoint to reach for when your records and ours disagree. One call tells you what the invoice is worth, what has been paid, what is still owed, and every payment that made up the difference, each with the reference of the transaction it settled as.

```json
{
  "status": "partial",
  "total": 180000000,
  "amount_paid": 120000000,
  "amount_outstanding": 60000000,
  "collecting": true,
  "allow_partial_payments": true,
  "minimum_initial_payment": 60000000,
  "subsequent_payment_rule": "flexible",
  "payments": [
    {
      "payment_id": "ipy_7Bn21kFd5Qa",
      "amount": 60000000,
      "paid_at": "2026-04-02T09:15:44.000Z",
      "payer_name": "ADAEZE NWOSU",
      "payment_channel": "bank_transfer",
      "transaction": {
        "reference": "ZVP-CKOTX-3d81be",
        "fees": 200000,
        "net_amount": 59800000,
        "settlement_state": "paid_out"
      }
    }
  ]
}
```

`amount_outstanding` is served rather than left to you to subtract, because client-side arithmetic on money is where rounding bugs start.

### Recovering from a missed webhook

Webhooks are delivered at least once and retried, but a receiver that was down, a deploy that dropped a request, or a bug in your handler all end the same way: your side thinks an invoice is unpaid when it is not.

You do not need a special endpoint for that. Fetch the invoice:

- `status` and `amount_outstanding` tell you where it stands now.
- `payments[]` is the full history. Anything in it that is not in your ledger is what you missed.
- `payments[].transaction.reference` is the same reference that appeared on the `invoice.payment_received` webhook and on your settlement, so it is the key to match on.
- `payments[].payment_id` identifies one instalment for good, and `GET /v1/checkout/invoice/{public_id}/payments/{payment_id}` verifies a single one.

Treat the fetch as authoritative and your webhook handler as an optimisation. A daily reconciliation pass over open invoices costs one request each and closes the gap without anyone noticing there was one. The same pattern applies to every payment type we offer: see [Recovering from a missed webhook](/guide/webhook-recovery) for the equivalent endpoint on sessions, static accounts, virtual accounts and PayIDs, plus a reconciliation pass you can copy.

::: tip Match on the transaction reference, not the amount
On a flexible instalment invoice a customer may pay the same amount twice. Amounts are not unique; `reference` and `payment_id` are.
:::

### Authentication

Requires a **secret key** (`sk_*`).

### Path parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `publicId` | string | The invoice's `public_id` |

### Example request

::: code-group

```bash [cURL]
curl https://api.zevpaycheckout.com/v1/checkout/invoice/abc123def456ghi78 \
  -H "Authorization: Bearer sk_test_your_secret_key"
```

```javascript [Node.js]
const response = await fetch(
  "https://api.zevpaycheckout.com/v1/checkout/invoice/abc123def456ghi78",
  {
    headers: { "Authorization": "Bearer sk_test_your_secret_key" },
  }
);
const data = await response.json();
```

```python [Python]
import requests

response = requests.get(
    "https://api.zevpaycheckout.com/v1/checkout/invoice/abc123def456ghi78",
    headers={"Authorization": "Bearer sk_test_your_secret_key"},
)
data = response.json()
```

:::

### Response

```json
{
  "success": true,
  "data": {
    "public_id": "abc123def456ghi78",
    "invoice_number": "INV-202603-001",
    "status": "partial",
    "customer_name": "Chidi Okonkwo",
    "customer_email": "chidi@example.com",
    "customer_address": "15 Admiralty Way, Lekki Phase 1",
    "customer_city": "Lagos",
    "customer_state": "Lagos",
    "customer_country": "Nigeria",
    "subtotal": 41000000,
    "tax_rate": 7.5,
    "tax_amount": 3075000,
    "total": 44075000,
    "amount_paid": 20000000,
    "currency": "NGN",
    "due_date": "2026-03-31T00:00:00.000Z",
    "issued_at": "2026-03-08T10:05:00.000Z",
    "paid_at": null,
    "cancelled_at": null,
    "merchant_reference": "PROJECT-2026-001",
    "metadata": { "project_id": "PRJ-123" },
    "note": "Thank you for your business!",
    "payment_url": "https://invoice.zevpaycheckout.com/pay/abc123def456ghi78?token=...",
    "created_at": "2026-03-08T10:00:00.000Z",
    "line_items": [
      {
        "id": "550e8400-e29b-41d4-a716-446655440001",
        "description": "Website Development",
        "quantity": 1,
        "unit_price": 35000000
      },
      {
        "id": "550e8400-e29b-41d4-a716-446655440002",
        "description": "Monthly Hosting (12 months)",
        "quantity": 12,
        "unit_price": 500000
      }
    ],
    "payments": [
      {
        "id": "550e8400-e29b-41d4-a716-446655440003",
        "amount": 20000000,
        "paid_at": "2026-03-10T14:30:00.000Z",
        "payer_name": "CHIDI OKONKWO",
        "payment_channel": "bank_transfer"
      }
    ]
  }
}
```

### Line item fields

| Field | Type | Description |
|-------|------|-------------|
| `id` | string | Line item UUID |
| `description` | string | Item description |
| `quantity` | number | Quantity |
| `unit_price` | integer | Unit price in kobo |

### Payment fields

| Field | Type | Description |
|-------|------|-------------|
| `id` | string | Payment record UUID |
| `amount` | integer | Payment amount in kobo |
| `paid_at` | string | Payment timestamp (ISO 8601) |
| `payer_name` | string \| null | Name of the person who made the payment |
| `payment_channel` | string \| null | Payment channel: `"bank_transfer"` or `"payid"` |

---

## List Invoice Payments

```
GET /v1/checkout/invoice/:publicId/payments
```

Every payment made against an invoice, newest first, each joined to the transaction it settled as. Requires a **secret key**.

`GET /v1/checkout/invoice/:publicId` already embeds this. Use this endpoint when you want the payments without the line items and customer detail, for example in a nightly reconciliation job over many invoices.

```json
{
  "invoice": {
    "public_id": "inv_8Kd93mQx2Lp",
    "status": "partial",
    "total": 180000000,
    "amount_paid": 120000000,
    "amount_outstanding": 60000000,
    "collecting": true
  },
  "payments": [
    {
      "payment_id": "ipy_7Bn21kFd5Qa",
      "amount": 60000000,
      "paid_at": "2026-04-02T09:15:44.000Z",
      "payer_name": "ADAEZE NWOSU",
      "payment_method": "bank_transfer",
      "transaction": {
        "reference": "ZVP-CKOTX-3d81be",
        "public_id": "ctx_5Km91xRe7Yb",
        "gross_amount": 60000000,
        "fees": 200000,
        "net_amount": 59800000,
        "settlement_state": "paid_out",
        "settled_at": "2026-04-03T12:00:00.000Z"
      }
    }
  ]
}
```

Each instalment settles separately, on the same T+1 cycle as any other payment, which is why each carries its own `settlement_state` rather than the invoice carrying one.

---

## Verify One Payment

```
GET /v1/checkout/invoice/:publicId/payments/:paymentId
```

The same payment object for a single instalment, plus the invoice's balance. Requires a **secret key**.

Use it when you have a `payment_id` from a webhook and want to confirm it against us before fulfilling, which is the safe pattern when a webhook arrives from an unverified source or after a retry you are unsure about.

---

## Invoice Activity Log

```
GET /v1/checkout/invoice/:publicId/events
```

An append-only record of what has been done to the invoice: created, sent, terms changed with the fields that moved, due date extended, reminders, each payment, paused, resumed, cancelled, overdue. Requires a **secret key**.

Each entry carries an `actor`:

| `actor` | Meaning |
|---------|---------|
| `api` | Your integration did it |
| `dashboard` | Someone did it by hand in the dashboard |
| `system` | We did it, such as a due date passing |
| `customer` | The payer did it |

That field is the one that settles arguments. When a customer says the terms changed after they agreed them, this is where you look.

---

## Send Invoice

Transitions an invoice from `draft` to `sent`. Sets the `issued_at` timestamp and makes the `payment_url` active.

```
POST /v1/checkout/invoice/:publicId/send
```

### Authentication

Requires a **secret key** (`sk_*`).

### Path parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `publicId` | string | The invoice's `public_id` |

### Example request

::: code-group

```bash [cURL]
curl -X POST https://api.zevpaycheckout.com/v1/checkout/invoice/abc123def456ghi78/send \
  -H "Authorization: Bearer sk_test_your_secret_key"
```

```javascript [Node.js]
const response = await fetch(
  "https://api.zevpaycheckout.com/v1/checkout/invoice/abc123def456ghi78/send",
  {
    method: "POST",
    headers: { "Authorization": "Bearer sk_test_your_secret_key" },
  }
);
const data = await response.json();
```

```python [Python]
import requests

response = requests.post(
    "https://api.zevpaycheckout.com/v1/checkout/invoice/abc123def456ghi78/send",
    headers={"Authorization": "Bearer sk_test_your_secret_key"},
)
data = response.json()
```

:::

### Response

Returns the updated invoice object with `status: "sent"` and `issued_at` populated.

### Errors

| Status | Message | Cause |
|--------|---------|-------|
| 404 | Invoice not found | Invoice does not exist or does not belong to your account |
| 400 | Only draft invoices can be sent | Invoice is not in draft status |

---

## Send Reminder

```
POST /v1/checkout/invoice/:publicId/remind
```

Re-sends the invoice email to the customer. Requires a **secret key**.

On a part-paid invoice the reminder chases the outstanding balance rather than the original total, so it never reads as a demand for money already paid.

Rate limited to one reminder an hour per invoice. This endpoint sends mail to your customer, so a loop in your automation is a loop in their inbox.

```json
{
  "public_id": "inv_8Kd93mQx2Lp",
  "invoice_number": "INV-2026-0041",
  "reminder_count": 3,
  "last_reminder_sent_at": "2026-05-02T09:00:00.000Z"
}
```

| Status | Message | Cause |
|--------|---------|-------|
| 400 | A reminder was sent recently. Try again in N minute(s) | Rate limit |
| 400 | Cannot send a reminder: {reason} | The invoice is paid, cancelled, draft or paused |

---

## Pause and Resume Collection

```
POST /v1/checkout/invoice/:publicId/pause
POST /v1/checkout/invoice/:publicId/resume
```

Stops and restarts payment on an invoice **without closing it**. Requires a **secret key**.

Pausing is not cancelling. The invoice keeps the status it earned, keeps its link, and the customer can still open it and see everything they have already paid. Only new payment stops. Use it for a dispute, a delivery problem, or a customer who asked you to hold.

```bash
curl -X POST https://api.zevpaycheckout.com/v1/checkout/invoice/{public_id}/pause \
  -H "x-api-key: sk_live_your_secret_key" \
  -d '{ "reason": "On hold while we agree the revised spec" }'
```

`reason` is optional and is shown to the customer on the invoice page. Both calls are idempotent.

```json
{
  "public_id": "inv_8Kd93mQx2Lp",
  "status": "partial",
  "collecting": false,
  "paused_at": "2026-05-04T10:12:00.000Z",
  "paused_reason": "On hold while we agree the revised spec"
}
```

Fires `invoice.paused` and `invoice.resumed`.

---

## Cancel Invoice

Cancels an invoice. Only invoices with status `draft`, `sent`, `partial`, or `overdue` can be cancelled. The payment link stops accepting payment and `invoice.cancelled` fires.

::: tip Balance settled outside ZevPay?
If you are cancelling because part of the invoice was paid where we cannot see it, collect the remainder with a checkout session on the same secret key. See [collecting a balance settled outside ZevPay](/checkout/invoice#collecting-a-balance-settled-outside-zevpay).
:::

```
POST /v1/checkout/invoice/:publicId/cancel
```

### Authentication

Requires a **secret key** (`sk_*`).

### Path parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `publicId` | string | The invoice's `public_id` |

### Example request

::: code-group

```bash [cURL]
curl -X POST https://api.zevpaycheckout.com/v1/checkout/invoice/abc123def456ghi78/cancel \
  -H "Authorization: Bearer sk_test_your_secret_key"
```

```javascript [Node.js]
const response = await fetch(
  "https://api.zevpaycheckout.com/v1/checkout/invoice/abc123def456ghi78/cancel",
  {
    method: "POST",
    headers: { "Authorization": "Bearer sk_test_your_secret_key" },
  }
);
const data = await response.json();
```

```python [Python]
import requests

response = requests.post(
    "https://api.zevpaycheckout.com/v1/checkout/invoice/abc123def456ghi78/cancel",
    headers={"Authorization": "Bearer sk_test_your_secret_key"},
)
data = response.json()
```

:::

### Response

Returns the updated invoice object with `status: "cancelled"` and `cancelled_at` populated.

### Errors

| Status | Message | Cause |
|--------|---------|-------|
| 404 | Invoice not found | Invoice does not exist or does not belong to your account |
| 400 | Cannot cancel an invoice with status "paid" | Invoice is already fully paid |

---

## Invoice Status Lifecycle

```
draft → sent → partial → paid
  ↓       ↓       ↓
  └───────┴───────┴──→ cancelled

sent/partial → overdue (automatic, when past due date)
overdue → paid (if payment received after due date)
overdue → cancelled
```

| Status | Description |
|--------|-------------|
| `draft` | Invoice created but not yet sent to customer. Payment URL is not usable |
| `sent` | Invoice sent, awaiting payment. Payment URL is active |
| `partial` | Customer has made a partial payment |
| `paid` | Invoice fully paid |
| `overdue` | Past due date, not fully paid (set automatically by hourly check) |
| `cancelled` | Invoice cancelled by merchant |

---

## Webhook Events

Subscribe to these events via your [webhook configuration](https://dashboard.zevpaycheckout.com/webhooks):

| Event | Description |
|-------|-------------|
| `invoice.created` | Invoice created via API |
| `invoice.sent` | Invoice status changed to `sent` |
| `invoice.payment_received` | Payment received (partial or full) |
| `invoice.paid` | Invoice fully paid |
| `invoice.overdue` | Invoice past due date, not fully paid |
| `invoice.paused` | Collection stopped without closing the invoice |
| `invoice.resumed` | Collection restarted |
| `invoice.reminder_sent` | A reminder email went out |
| `invoice.cancelled` | Invoice cancelled |

::: warning On an instalment invoice, `invoice.payment_received` fires every time
It is not a signal that the invoice is settled. Fulfil on `is_fully_paid`, or on `invoice.paid`.
:::

See the full [Webhook Events Reference](/webhooks/events) for complete payload documentation.

### Example webhook payload

```json
{
  "event": "invoice.payment_received",
  "data": {
    "public_id": "abc123def456ghi78",
    "invoice_number": "INV-202603-001",
    "status": "partial",
    "customer_name": "Chidi Okonkwo",
    "customer_email": "chidi@example.com",
    "subtotal": 41000000,
    "tax_rate": 7.5,
    "tax_amount": 3075000,
    "total": 44075000,
    "amount_paid": 20000000,
    "currency": "NGN",
    "due_date": "2026-03-31T00:00:00.000Z",
    "issued_at": "2026-03-08T10:05:00.000Z",
    "paid_at": null,
    "merchant_reference": "PROJECT-2026-001",
    "metadata": { "project_id": "PRJ-123" },
    "payment_url": "https://invoice.zevpaycheckout.com/pay/abc123def456ghi78?token=...",
    "payment_amount": 20000000,
    "amount_remaining": 24075000,
    "payer_name": "CHIDI OKONKWO",
    "payment_channel": "bank_transfer"
  }
}
```

---

## Error Responses

All error responses follow this format:

```json
{
  "success": false,
  "error": {
    "code": "HTTP_ERROR",
    "message": "An invoice that has been sent cannot change lineItems."
  },
  "correlationId": "b7f3c2a1-..."
}
```

The readable message is at `error.message`. Show that to whoever is going to act on it, and quote the `correlationId` if you contact support.

### Common errors

| Status | Message | Endpoint |
|--------|---------|----------|
| 401 | API key is required | All: missing or invalid API key |
| 403 | This endpoint requires a secret key | All: using a public key instead of secret key |
| 403 | Invoices are only available for business accounts | Create: personal account trying to create invoices |
| 400 | At least one line item is required | Create: empty line_items array |
| 400 | Invoice total must be greater than zero | Create/Update: calculated total is zero or negative |
| 400 | Invalid due date format | Create/Update: invalid ISO date string |
| 400 | An invoice that has been sent cannot change {fields} | Update: financial fields edited after sending. Terms such as `due_date` remain editable |
| 400 | Only draft invoices can be sent | Send: invoice is not in draft status |
| 404 | Invoice not found | Get/Update/Send/Cancel: invalid public_id or not your invoice |

## Try it: Create Invoice

<ApiPlayground
  method="POST"
  endpoint="/v1/checkout/invoice"
  authType="bearer"
  :bodyFields="[
    { name: 'customer_name', type: 'string', required: true, placeholder: 'Chidi Okonkwo' },
    { name: 'customer_email', type: 'string', required: true, placeholder: 'chidi@example.com' },
    { name: 'line_items', type: 'object', required: true, placeholder: '[{ &quot;description&quot;: &quot;Web Development&quot;, &quot;quantity&quot;: 1, &quot;unit_price&quot;: 35000000 }]' },
    { name: 'tax_rate', type: 'integer', placeholder: '7.5', description: 'Percentage (0-100)' },
    { name: 'due_date', type: 'string', required: true, placeholder: '2026-03-31T00:00:00Z' },
    { name: 'note', type: 'string', placeholder: 'Thank you for your business!' },
    { name: 'reference', type: 'string', placeholder: 'PROJECT-2026-001' },
    { name: 'metadata', type: 'object', placeholder: '{ &quot;project_id&quot;: &quot;PRJ-123&quot; }' },
  ]"
/>

## Try it: List Invoices

<ApiPlayground
  method="GET"
  endpoint="/v1/checkout/invoice"
  authType="bearer"
  :queryParams="[
    { name: 'page', type: 'integer', placeholder: '1', default: '1' },
    { name: 'page_size', type: 'integer', placeholder: '20' },
    { name: 'status', type: 'select', options: [{ label: 'Draft', value: 'draft' }, { label: 'Sent', value: 'sent' }, { label: 'Partial', value: 'partial' }, { label: 'Paid', value: 'paid' }, { label: 'Overdue', value: 'overdue' }, { label: 'Cancelled', value: 'cancelled' }] },
    { name: 'search', type: 'string', placeholder: 'Search by customer or invoice number' },
  ]"
/>

---

## Source: https://docs.zevpaycheckout.com/api/overview
<!-- file: api/overview.md -->

# API Overview

The ZevPay Checkout REST API lets you create and manage payments, virtual PayIDs, virtual accounts, invoices, and transfers programmatically.

## Base URL

```
https://api.zevpaycheckout.com
```

## Authentication

All endpoints require an API key via the `x-api-key` header or `Authorization: Bearer <key>` header. See [Authentication](/guide/authentication).

## Permissions

Each API key has a `permissions` array that controls which product APIs it can access. See [API Key Permissions](/guide/authentication#api-key-permissions) for details.

| Permission | Products | Description |
|------------|----------|-------------|
| `checkout` | Checkout Sessions | Initialize and manage checkout payment sessions |
| `virtual_payid` | Static PayID, Dynamic PayID | Create and manage virtual PayIDs |
| `virtual_account` | Virtual Accounts | Create temporary bank accounts for collecting payments |
| `invoices` | Invoices | Create and manage programmable invoices |
| `transfers` | Transfers | Programmatically send money from a linked wallet |

::: info Legacy keys
API keys created before the permissions system have an empty permissions array. These keys retain access to all non-transfer products automatically. Only the `transfers` permission must be explicitly granted.
:::

## Response format

All successful responses follow this format:

```json
{
  "success": true,
  "data": {
    // Response payload
  }
}
```

Error responses return the appropriate HTTP status code. See [Errors](/api/errors) for details:

```json
{
  "success": false,
  "error": {
    "code": "HTTP_ERROR",
    "message": "A human-readable error description"
  },
  "correlationId": "-"
}
```

## Endpoints

### Checkout Sessions

| Method | Path | Permission | Auth | Description |
|--------|------|------------|------|-------------|
| `POST` | [`/v1/checkout/session/initialize`](/api/initialize-session) | `checkout` | Secret or Public key | Create a checkout session |
| `POST` | [`/v1/checkout/session/:id/payment-method`](/api/select-payment-method) | `checkout` | Public key | Select payment method |
| `GET` | [`/v1/checkout/session/:id/verify`](/api/verify-session) | `checkout` | Secret or Public key | Check payment status |
| `GET` | [`/v1/checkout/session/:id`](/api/get-session) | `checkout` | Public key | Get full session details |

### Virtual PayID

| Method | Path | Permission | Auth | Description |
|--------|------|------------|------|-------------|
| `POST` | [`/v1/checkout/static-payid`](/api/static-payid#create-static-payid) | `virtual_payid` | Secret key | Create a static PayID |
| `GET` | [`/v1/checkout/static-payid`](/api/static-payid#list-static-payids) | `virtual_payid` | Secret key | List static PayIDs |
| `GET` | [`/v1/checkout/static-payid/:id`](/api/static-payid#get-static-payid) | `virtual_payid` | Secret key | Get a static PayID |
| `PUT` | [`/v1/checkout/static-payid/:id`](/api/static-payid#update-static-payid) | `virtual_payid` | Secret key | Update a static PayID |
| `DELETE` | [`/v1/checkout/static-payid/:id`](/api/static-payid#deactivate-static-payid) | `virtual_payid` | Secret key | Deactivate a static PayID |
| `POST` | [`/v1/checkout/static-payid/:id/reactivate`](/api/static-payid#reactivate-static-payid) | `virtual_payid` | Secret key | Reactivate a static PayID |
| `POST` | [`/v1/checkout/dynamic-payid`](/api/dynamic-payid#create-dynamic-payid) | `virtual_payid` | Secret key | Create a dynamic PayID |
| `GET` | [`/v1/checkout/dynamic-payid`](/api/dynamic-payid#list-dynamic-payids) | `virtual_payid` | Secret key | List dynamic PayIDs |
| `GET` | [`/v1/checkout/dynamic-payid/:id`](/api/dynamic-payid#get-dynamic-payid) | `virtual_payid` | Secret key | Get a dynamic PayID |

### Virtual Accounts

| Method | Path | Permission | Auth | Description |
|--------|------|------------|------|-------------|
| `POST` | [`/v1/checkout/virtual-account`](/api/virtual-account#create-virtual-account) | `virtual_account` | Secret key | Create a virtual account |
| `GET` | [`/v1/checkout/virtual-account`](/api/virtual-account#list-virtual-accounts) | `virtual_account` | Secret key | List virtual accounts |
| `GET` | [`/v1/checkout/virtual-account/:id`](/api/virtual-account#get-virtual-account) | `virtual_account` | Secret key | Get a virtual account |

### Invoices

| Method | Path | Permission | Auth | Description |
|--------|------|------------|------|-------------|
| `POST` | [`/v1/checkout/invoice`](/api/invoice#create-invoice) | `invoices` | Secret key | Create an invoice |
| `GET` | [`/v1/checkout/invoice`](/api/invoice#list-invoices) | `invoices` | Secret key | List invoices |
| `GET` | [`/v1/checkout/invoice/:id`](/api/invoice#get-invoice) | `invoices` | Secret key | Get an invoice |
| `PATCH` | [`/v1/checkout/invoice/:id`](/api/invoice#update-invoice) | `invoices` | Secret key | Update a draft invoice |
| `POST` | [`/v1/checkout/invoice/:id/send`](/api/invoice#send-invoice) | `invoices` | Secret key | Send an invoice |
| `POST` | [`/v1/checkout/invoice/:id/void`](/api/invoice#void-invoice) | `invoices` | Secret key | Void an invoice |

### Transfers

| Method | Path | Permission | Auth | Description |
|--------|------|------------|------|-------------|
| `GET` | [`/v1/checkout/transfer/banks`](/api/transfer#list-banks) |  | Secret key | List supported banks |
| `POST` | [`/v1/checkout/transfer/banks/resolve`](/api/transfer#resolve-bank-account) |  | Secret key | Verify a bank account |
| `POST` | [`/v1/checkout/transfer/charges`](/api/transfer#calculate-charges) | `transfers` | Secret key | Calculate transfer fees |
| `GET` | [`/v1/checkout/transfer/balance`](/api/transfer#get-balance) | `transfers` | Secret key | Get wallet balance |
| `POST` | [`/v1/checkout/transfer`](/api/transfer#initiate-transfer) | `transfers` | Secret key | Send money |
| `GET` | [`/v1/checkout/transfer`](/api/transfer#list-transfers) | `transfers` | Secret key | List transfers |
| `GET` | [`/v1/checkout/transfer/:reference`](/api/transfer#get-transfer) | `transfers` | Secret key | Get a transfer |
| `GET` | [`/v1/checkout/transfer/:reference/verify`](/api/transfer#verify-transfer) | `transfers` | Secret key | Verify transfer status |

### Wallet Management

| Method | Path | Permission | Auth | Description |
|--------|------|------------|------|-------------|
| `GET` | [`/v1/checkout/wallet`](/api/wallet#get-wallet) | `transfers` | Secret key (admin) | Get wallet details |
| `PATCH` | [`/v1/checkout/wallet`](/api/wallet#update-wallet-settings) | `transfers` | Secret key (admin) | Update wallet settings |
| `GET` | [`/v1/checkout/wallet/members`](/api/wallet#list-members) | `transfers` | Secret key (admin) | List wallet members |
| `POST` | [`/v1/checkout/wallet/members`](/api/wallet#add-member) | `transfers` | Secret key (admin) | Add a member |
| `DELETE` | [`/v1/checkout/wallet/members/:payId`](/api/wallet#remove-member) | `transfers` | Secret key (admin) | Remove a member |
| `PATCH` | [`/v1/checkout/wallet/members/:payId`](/api/wallet#update-member-settings) | `transfers` | Secret key (admin) | Update member settings |

## Rate limits

All endpoints are rate-limited to **100 requests per minute** per API key. The session initialization endpoint has a stricter limit of **30 requests per minute**.

If you exceed the limit, you'll receive a `429 Too Many Requests` response. See [Rate Limiting](/guide/rate-limiting) for details and best practices.

## Request size limits

Request bodies are limited to **1 MB**. This is more than sufficient for all API operations.

## Versioning

The API is versioned via the URL path (`/v1/`). Breaking changes will result in a new version.

---

## Source: https://docs.zevpaycheckout.com/api/select-payment-method
<!-- file: api/select-payment-method.md -->

# Select Payment Method

Select a payment method for a checkout session. Returns the payment details the customer needs to complete the transfer.

```
POST /v1/checkout/session/:sessionId/payment-method
```

**Required permission:** `checkout`

## Authentication

Requires an API key. Origin/domain validation is enforced for public keys.

## Path parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `sessionId` | string | The checkout session ID |

## Request body

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `payment_method` | string | Yes | `"bank_transfer"`, `"payid"`, `"palmpay"` or `"mobile_money"` |

## Example request

```bash
curl -X POST https://api.zevpaycheckout.com/v1/checkout/session/ecc48011-e36e-4741-9b99-657f4a1ee86e/payment-method \
  -H "Content-Type: application/json" \
  -H "x-api-key: pk_test_your_public_key" \
  -d '{"payment_method": "bank_transfer"}'
```

## Response: Bank Transfer

When `payment_method` is `"bank_transfer"`, a temporary virtual account is created. Show the customer `account_number`, `bank_name` and `account_name` exactly as returned. ZevPay mints these accounts through partner banks and rotates partners over time, so the bank differs between sessions.

```json
{
  "success": true,
  "data": {
    "payment_method": "bank_transfer",
    "account_number": "5000973258",
    "bank_name": "9 Payment Service Bank",
    "bank_code": "000036",
    "account_name": "Your Business Name",
    "amount": 500000,
    "expires_at": "2026-03-07T19:37:00.000Z",
    "banks": [
      { "provider": "psb9", "bank_name": "9 Payment Service Bank", "bank_code": "000036", "current": true },
      { "provider": "palmpay", "bank_name": "PalmPay", "bank_code": "100039", "current": false }
    ]
  }
}
```

| Field | Type | Description |
|-------|------|-------------|
| `payment_method` | string | Always `"bank_transfer"` |
| `account_number` | string | Virtual account number for the transfer |
| `bank_name` | string | Bank the customer must select. Not fixed: read it per session, never hardcode it |
| `bank_code` | string | NIP code for the bank, for UIs that match on code |
| `account_name` | string | Merchant's business name (or `"ZevPay Checkout"` if not configured) |
| `amount` | integer | Amount in kobo the customer should transfer |
| `expires_at` | string | ISO 8601 timestamp: when the virtual account expires |
| `banks` | array | Every bank this session can be paid into, with the active one flagged `current` |

### Letting the customer change bank

Some customers cannot complete a transfer to a given bank. The `banks` array
is the list you can offer them. Render it as a "change bank" control and call
[Switch Bank](#switch-bank) with the chosen `provider`.

The list is served per session, so a bank added on our side appears in your
checkout with no change on yours. Never hardcode it.

## Switch Bank

Move a pending bank transfer to another bank without starting a new session.

```
POST /v1/checkout/session/:sessionId/switch-bank
```

**Required permission:** `checkout`

### Request body

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `provider` | string | Yes | A `provider` value from the `banks` array |

### Example request

```bash
curl -X POST https://api.zevpaycheckout.com/v1/checkout/session/ecc48011-e36e-4741-9b99-657f4a1ee86e/switch-bank \
  -H "Content-Type: application/json" \
  -H "x-api-key: pk_test_your_public_key" \
  -d '{"provider": "palmpay"}'
```

The response is the same bank transfer payload shown above, carrying the new
`account_number`, `bank_name` and refreshed `banks` list.

::: warning The old account number stops working
Switching retires the previous account before issuing the new one, so the same
session can never be paid twice. Replace the account number on screen as soon
as the call returns, and never show two at once.
:::

The amount, reference and session are unchanged. Payment webhooks and
verification behave exactly as they would have on the original bank.

### Switch bank errors

| Status | Code | Cause |
|--------|------|-------|
| `400` | `BANK_UNAVAILABLE` | The `provider` is not in the session's `banks` list |
| `503` | `BANK_SWITCH_FAILED` | The previous account could not be retired. Retry shortly |

## Response: PayID

When `payment_method` is `"payid"`, a dynamic PayID is created:

```json
{
  "success": true,
  "data": {
    "payment_method": "payid",
    "pay_id": "5de2.dypid",
    "qr_data": "https://zevpay.me/5de2.dypid",
    "amount": 500000,
    "expires_at": "2026-03-07T19:37:00.000Z"
  }
}
```

| Field | Type | Description |
|-------|------|-------------|
| `payment_method` | string | Always `"payid"` |
| `pay_id` | string | Dynamic PayID for the payment |
| `qr_data` | string | URL for QR code generation (`https://zevpay.me/{payId}`) |
| `amount` | integer | Amount in kobo |
| `expires_at` | string | ISO 8601 timestamp: when the dynamic PayID expires |

## Mobile money

When `payment_method` is `"mobile_money"`, nothing is created yet. A collection needs the customer's phone number, and which network that number is on decides the limits and how they approve, so this call answers "what can this be paid with":

```json
{
  "payment_method": "mobile_money",
  "mobile_money": {
    "currency": "KES",
    "amount": 150000,
    "networks": [
      {
        "country": "KEN",
        "network": "MPESA_KEN",
        "network_name": "Safaricom",
        "logo_url": "https://...",
        "country_prefix": "254",
        "min_amount": "1",
        "max_amount": "250000",
        "auth_type": "provider_auth",
        "pin_prompt": "automatic",
        "decimals_accepted": 0,
        "status": "operational"
      }
    ]
  }
}
```

`decimals_accepted` is the precision **that network** takes, which is not always the currency's. M-Pesa accepts whole shillings even though KES has two decimal places, so an amount with cents cannot be collected on it.

### Start the collection

Once the customer has given a number:

```bash
curl -X POST https://api.zevpaycheckout.com/v1/checkout/session/{sessionId}/mobile-money/charge \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"msisdn": "254700000000"}'
```

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `msisdn` | string | Yes | The payer's number. The network is inferred from it |
| `mno` | string | No | Network id, when the customer corrects the inferred one |
| `pre_authorisation_code` | string | No | Required only on networks that make the customer fetch a code first |

The response describes what the customer should expect:

```json
{
  "payment_method": "mobile_money",
  "mobile_money": {
    "order_id": "V1StGXR8Z5jdHi6BmyT",
    "status": "processing",
    "network_name": "Safaricom",
    "auth_type": "provider_auth",
    "pin_prompt": "automatic",
    "instructions": null,
    "authorization_url": null
  }
}
```

`authorization_url` is set only on networks where the customer approves on the provider's own page. When it is present, send them there.

### Check the collection

```bash
curl https://api.zevpaycheckout.com/v1/checkout/session/{sessionId}/mobile-money/{orderId} \
  -H "Authorization: Bearer sk_live_..."
```

Returns the same shape with a current `status`: `pending`, `processing`, `completed`, `failed` or `expired`.

::: warning An unanswered request is not a failure
Mobile money requests can time out while the payment is still going through. A collection stays `processing` until we know what actually happened, and resolves on its own. Do not ask a customer to pay again on a timeout, or they may pay twice.
:::

## Behavior

- Calling this endpoint multiple times for the **same method** reuses the existing virtual account or PayID (as long as it's still active/pending)
- Switching methods (e.g., from `bank_transfer` to `payid`) logs a `method_switched` event and increments the attempt counter
- Switching methods also retires what the customer left behind, so a session is never payable in two places at once. Stop showing the previous account number as soon as you switch: it no longer accepts payment
- The session must be `active`; expired, completed, or failed sessions return an error

## Errors

| Status | Message | Cause |
|--------|---------|-------|
| `400` | Session is {status}. | Session is not active (e.g., `"Session is completed."`) |
| `400` | Session has expired. | Session's expiry time has passed |
| `400` | Unsupported payment method: {method} | Invalid `payment_method` value |
| `400` | Session does not belong to this API key. | API key mismatch |
| `401` | Invalid API key | Key not found or inactive |
| `404` | Session not found. | Invalid session ID |

## Try it

<ApiPlayground
  method="POST"
  endpoint="/v1/checkout/session/:sessionId/payment-method"
  :pathParams="[
    { name: 'sessionId', type: 'string', required: true, placeholder: 'ecc48011-e36e-4741-9b99-657f4a1ee86e' },
  ]"
  :bodyFields="[
    { name: 'payment_method', type: 'select', required: true, options: [{ label: 'Bank Transfer', value: 'bank_transfer' }, { label: 'PayID', value: 'payid' }, { label: 'Mobile Money', value: 'mobile_money' }] },
  ]"
/>

---

## Source: https://docs.zevpaycheckout.com/api/static-account
<!-- file: api/static-account.md -->

---
title: Static NGN Account API
description: Create and manage permanent NGN account numbers for your customers. Secret key only; enabled for selected merchants on request.
---

# Static NGN Account

Issue permanent bank account numbers to your customers and receive every transfer as a booked payment with an instant webhook. See the [concept guide](/guide/static-accounts) for how the product behaves.

All endpoints require a **secret key** (`sk_*`). Static NGN Accounts are enabled for selected merchants on request; contact our business support team for access. Every endpoint except `GET /status` returns `403` with `error.code = "STATIC_ACCOUNT_NOT_ENABLED"` when the product is not enabled for your account; `GET /status` always answers so you can check before you build.

Base path: `/v1/checkout/static-account`

## Check availability

```
GET /v1/checkout/static-account/status
```

```json
{
  "success": true,
  "data": {
    "enabled": true,
    "currency": "NGN",
    "bank_names": ["PalmPay"],
    "identity_types": ["bvn", "nin", "rc"]
  }
}
```

`bank_names` lists the bank(s) new accounts will be issued at, so you can show the customer where to transfer.

## Create an account

```
POST /v1/checkout/static-account
```

### Request body

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `customer_name` | string | Yes | Full legal name of the account holder, as on the identity record (2 to 200 characters) |
| `identity_type` | string | Yes | `"bvn"`, `"nin"` or `"rc"` |
| `identity_number` | string | Yes | 11-digit BVN or NIN, or the CAC number prefixed `RC` / `BN` (e.g. `"RC1234567"`) |
| `customer_email` | string | No | Account holder's email |
| `customer_phone` | string | No | Account holder's phone |
| `account_name` | string | No | Name printed on the account. Defaults to `customer_name`. The bank may append your business suffix |
| `reference` | string | Yes | Your unique reference for this account, typically your customer id (max 120 chars). Idempotent: sending the same reference again returns the existing account instead of creating another, so a customer never ends up with several numbers |
| `metadata` | object | No | Custom key-value data stored with the account and echoed on every `charge.success` |

The name is checked against the identity record before anything is created. If it does not match, the request fails with `IDENTITY_MISMATCH`.

### Example request

::: code-group

```bash [cURL]
curl -X POST https://api.zevpaycheckout.com/v1/checkout/static-account \
  -H "Content-Type: application/json" \
  -H "x-api-key: sk_live_your_secret_key" \
  -d '{
    "customer_name": "Adaeze Okafor",
    "identity_type": "bvn",
    "identity_number": "22345678901",
    "customer_email": "adaeze@example.com",
    "reference": "customer-1042",
    "metadata": { "plan": "pro" }
  }'
```

```javascript [Node.js]
const response = await fetch(
  "https://api.zevpaycheckout.com/v1/checkout/static-account",
  {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "x-api-key": "sk_live_your_secret_key",
    },
    body: JSON.stringify({
      customer_name: "Adaeze Okafor",
      identity_type: "bvn",
      identity_number: "22345678901",
      customer_email: "adaeze@example.com",
      reference: "customer-1042",
      metadata: { plan: "pro" },
    }),
  }
);
const { data } = await response.json();
```

:::

### Response

```json
{
  "success": true,
  "data": {
    "id": "V1StGXR8_Z5jdHi6B-myT",
    "account_number": "6641234567",
    "account_name": "Adaeze Okafor",
    "bank_name": "PalmPay",
    "bank_code": "100039",
    "currency": "NGN",
    "status": "active",
    "customer_name": "Adaeze Okafor",
    "customer_email": "adaeze@example.com",
    "customer_phone": null,
    "identity_type": "bvn",
    "identity_number_masked": "*******8901",
    "reference": "customer-1042",
    "metadata": { "plan": "pro" },
    "inflow_count": 0,
    "total_received": "0.00",
    "last_payment_at": null,
    "disabled_at": null,
    "deleted_at": null,
    "created_at": "2026-09-08T09:12:00.000Z",
    "updated_at": "2026-09-08T09:12:00.000Z"
  }
}
```

Show the customer `account_number` and `bank_name`. The identity number is never returned in full.

### Account object

| Field | Type | Description |
|-------|------|-------------|
| `id` | string | Account id. Use it in every other call |
| `account_number` | string | The NUBAN the customer transfers to |
| `account_name` | string | Name on the account |
| `bank_name` | string | Bank the customer selects when transferring |
| `bank_code` | string \| null | NIP bank code from the live bank list, when known. Show `bank_name` to customers; codes differ between bank apps |
| `status` | string | `"active"`, `"disabled"` (paused by you), `"suspended"` (by ZevPay), `"deleted"` |
| `identity_type` | string | `"bvn"`, `"nin"` or `"rc"` |
| `identity_number_masked` | string | Last four characters only |
| `reference` | string \| null | Your reference |
| `inflow_count` | integer | Payments received so far |
| `total_received` | string | Gross amount received so far, in naira |
| `last_payment_at` | string \| null | ISO 8601 timestamp of the latest payment |

## List accounts

```
GET /v1/checkout/static-account
```

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `page` | integer | 1 | Page number |
| `page_size` | integer | 20 | Items per page (max 100) |
| `status` | string | none | `"active"`, `"disabled"`, `"suspended"` or `"deleted"` |
| `search` | string | none | Matches account number, customer name, account name, reference or email |

Returns `{ items, total, page, page_size, total_pages }` with account objects in `items`.

## Get an account

```
GET /v1/checkout/static-account/{id}
```

Returns the account object.

## List payments on an account

```
GET /v1/checkout/static-account/{id}/payments
```

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `page` | integer | 1 | Page number |
| `page_size` | integer | 20 | Items per page (max 100) |

```json
{
  "success": true,
  "data": {
    "items": [
      {
        "id": "9f1c1e2a-8c1d-4d5c-9a44-1e0b2f6d7a10",
        "static_account_id": "V1StGXR8_Z5jdHi6B-myT",
        "amount": "25000.00",
        "fee": "375.00",
        "net_amount": "24625.00",
        "currency": "NGN",
        "status": "completed",
        "payer": { "name": "ADAEZE OKAFOR", "bank": "GTBank", "account": "0123456789" },
        "narration": "Top up",
        "session_id": "000013250908091200000123456789",
        "received_at": "2026-09-08T09:12:44.000Z",
        "booked_at": "2026-09-08T09:12:45.000Z",
        "settlement": {
          "status": "pending_settlement",
          "expected_payout_at": "2026-09-09T16:00:00.000Z",
          "settled_at": null,
          "payout_id": null
        },
        "refundable": true,
        "refund": null
      }
    ],
    "total": 1,
    "page": 1,
    "page_size": 20,
    "total_pages": 1
  }
}
```

`status` is `"completed"` once the payment is booked; `"processing"` is transient while a payment is being booked.

`settlement.status` follows the payment through settlement: `pending_settlement` (waiting for the next cutoff; `expected_payout_at` is the scheduled payout), `batched` (in a payout run), `paid_out` or `wallet_credit` (settled to you, `settled_at` set), `under_review` (held because a refund was requested), `refunded`, or `failed` (payout failed; support will retry). `refundable` is true while a refund can still be requested.

## Pause and resume

```
POST /v1/checkout/static-account/{id}/disable
POST /v1/checkout/static-account/{id}/enable
```

Pausing sets `status` to `"disabled"`; the bank rejects transfers until you resume. Both return the account object. You cannot resume an account that ZevPay has suspended.

## Delete an account

```
DELETE /v1/checkout/static-account/{id}
```

Retires the account number permanently (`status: "deleted"`). This cannot be undone and the number is not reused. Payment history stays available. Returns the account object.

## Refunds

A payment can be refunded to the payer as long as it has **not yet been settled to you**: the request is accepted only while the payment is still pending settlement (before the next payout batch picks it up). Refunds are two-step: your request holds the payment out of settlement and hands it to ZevPay; ZevPay then returns the money to the payer's bank account and fires [`charge.refunded`](/webhooks/events#charge-refunded). If ZevPay declines the request, the payment goes back into your next settlement and the refund shows as `rejected`.

### Request a refund

```
POST /v1/checkout/static-account/{id}/payments/{payment_id}/refund
```

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `reason` | string | No | Why you are refunding (max 500 chars). Shown to ZevPay's operations team |

`payment_id` is the `id` from the [payments list](#list-payments-on-an-account), where `refundable: true` tells you the payment can still be refunded. Repeating the request for the same payment returns the open refund.

```json
{
  "success": true,
  "data": {
    "id": "V1StGXR8_Z5jdHi6B-myT",
    "amount": "25000.00",
    "currency": "NGN",
    "status": "requested",
    "reason": "Duplicate payment",
    "rejection_reason": null,
    "failure_reason": null,
    "payment_id": "9f1c1e2a-8c1d-4d5c-9a44-1e0b2f6d7a10",
    "requested_at": "2026-09-08T10:02:11.000Z",
    "completed_at": null
  }
}
```

`status` moves `requested` → `processing` → `completed` (money returned) or `failed`; `rejected` means ZevPay declined and the payment settles to you as normal.

### List and get refunds

```
GET /v1/checkout/static-account/refunds?status=requested&page=1&page_size=20
GET /v1/checkout/static-account/refunds/{refund_id}
```

Both return refund objects in the shape above.

| Code | HTTP | Meaning |
|------|------|---------|
| `REFUND_NOT_ALLOWED` | 400 | The payment is not booked, or is already in a settlement batch or paid out |
| `ALREADY_REFUNDED` | 400 | This payment was refunded already |

## Webhook

Every payment into a static account fires [`charge.success`](/webhooks/events#charge-success) to the webhook URL of the API key that owns the account, with `channel: "static_account"` and a `static_account` object identifying which account was paid. See the [payload](/webhooks/events#static-ngn-account).

## Errors

| Code | HTTP | Meaning |
|------|------|---------|
| `STATIC_ACCOUNT_NOT_ENABLED` | 403 | Static NGN Accounts are not enabled for this merchant account |
| `STATIC_ACCOUNT_SUSPENDED` | 403 | Access is suspended: existing accounts and history stay visible on the dashboard, but every API call and every action is refused until it is lifted |
| `IDENTITY_MISMATCH` | 400 | `customer_name` does not match the identity record for `identity_number` |
| `IDENTITY_CHECK_UNAVAILABLE` | 503 | The identity registry could not be reached; retry shortly |
| `STATIC_ACCOUNT_REJECTED` | 400 | The bank declined to issue the account for the details given |
| `STATIC_ACCOUNT_UNAVAILABLE` | 503 | Account issuing is temporarily unavailable; retry later |
| `REFERENCE_IN_USE` | 409 | `reference` belongs to a deleted account; use a new reference |
| `ACCOUNT_SUSPENDED` | 400 | The account is suspended by ZevPay and cannot be changed |
| `ACCOUNT_DELETED` | 400 | The account has been deleted |
| `STATIC_ACCOUNT_RATE_LIMITED` | 429 | Too many create attempts, or too many identity mismatches, in the last hour for your account |
| `VALIDATION_ERROR` | 400 | A field has the right shape but an invalid value (message says which). Missing or wrongly typed fields return the standard `HTTP_ERROR` envelope with a list of messages |

---

## Source: https://docs.zevpaycheckout.com/api/static-payid
<!-- file: api/static-payid.md -->

# Static PayID

Create and manage permanent, reusable checkout PayIDs for receiving payments. Static PayIDs don't expire and have their own ledger for tracking balance.

**Required permission:** `virtual_payid`

::: warning Business accounts only
Static PayIDs require an API key belonging to a **business account**. API keys from personal accounts will receive a `403 Forbidden` error. You can check your account type in the [dashboard](https://dashboard.zevpaycheckout.com).
:::

## Create Static PayID

```
POST /v1/checkout/static-payid
```

### Authentication

Requires a **secret key** (`sk_*`) from a **business account**.

### Request body

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `pay_id` | string | Yes | Base name (3-20 chars). Letters, numbers, dots, and underscores only |
| `suffix` | string | Yes | PayID suffix: `".spid"` or `".checkout"` |
| `name` | string | Yes | Display name (max 255 chars) |
| `description` | string | No | Description (max 2000 chars) |

The full PayID will be `{pay_id}{suffix}`, for example, `mystore.spid`.

::: tip Settlement
Payments received on this PayID are settled to your API key's configured settlement ledger. To change where payments are settled, update your API key's settlement configuration in the [dashboard](https://dashboard.zevpaycheckout.com).
:::

### Example request

::: code-group

```bash [cURL]
curl -X POST https://api.zevpaycheckout.com/v1/checkout/static-payid \
  -H "Content-Type: application/json" \
  -H "x-api-key: sk_test_your_secret_key" \
  -d '{
    "pay_id": "mystore",
    "suffix": ".spid",
    "name": "My Online Store",
    "description": "Payments for online orders"
  }'
```

```javascript [Node.js]
const response = await fetch(
  "https://api.zevpaycheckout.com/v1/checkout/static-payid",
  {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "x-api-key": "sk_test_your_secret_key",
    },
    body: JSON.stringify({
      pay_id: "mystore",
      suffix: ".spid",
      name: "My Online Store",
      description: "Payments for online orders",
    }),
  }
);
const data = await response.json();
```

:::

### Response

```json
{
  "success": true,
  "data": {
    "id": "a1b2c3d4-...",
    "pay_id_id": "e5f6g7h8-...",
    "pay_id": "mystore.spid",
    "business_id": "b1c2d3e4-...",
    "api_key_id": "k1l2m3n4-...",
    "settlement_pay_id_id": "s1t2u3v4-...",
    "name": "My Online Store",
    "description": "Payments for online orders",
    "suffix": ".spid",
    "source": "api",
    "is_active": true,
    "created_at": "2026-03-08T12:00:00.000Z",
    "updated_at": "2026-03-08T12:00:00.000Z"
  }
}
```

---

## List Static PayIDs

```
GET /v1/checkout/static-payid
```

### Query parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `page` | integer | 1 | Page number |
| `page_size` | integer | 20 | Items per page (max 100) |
| `search` | string | none | Search by name or PayID |

### Example request

```bash
curl https://api.zevpaycheckout.com/v1/checkout/static-payid?page=1&page_size=10 \
  -H "x-api-key: sk_test_your_secret_key"
```

### Response

```json
{
  "success": true,
  "data": {
    "items": [
      {
        "id": "a1b2c3d4-...",
        "pay_id": "mystore.spid",
        "name": "My Online Store",
        "is_active": true,
        "created_at": "2026-03-08T12:00:00.000Z"
      }
    ],
    "total": 1,
    "page": 1,
    "page_size": 10,
    "total_pages": 1
  }
}
```

---

## Get Static PayID

```
GET /v1/checkout/static-payid/:id
```

### Path parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `id` | string | Static PayID UUID |

### Example request

```bash
curl https://api.zevpaycheckout.com/v1/checkout/static-payid/a1b2c3d4-... \
  -H "x-api-key: sk_test_your_secret_key"
```

---

## Update Static PayID

```
PUT /v1/checkout/static-payid/:id
```

### Request body

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | No | New display name (max 255 chars) |
| `description` | string | No | New description (max 2000 chars) |

### Example request

```bash
curl -X PUT https://api.zevpaycheckout.com/v1/checkout/static-payid/a1b2c3d4-... \
  -H "Content-Type: application/json" \
  -H "x-api-key: sk_test_your_secret_key" \
  -d '{ "name": "Updated Store Name" }'
```

---

## Deactivate Static PayID

Deactivate a static PayID so it no longer accepts payments.

```
DELETE /v1/checkout/static-payid/:id
```

### Example request

```bash
curl -X DELETE https://api.zevpaycheckout.com/v1/checkout/static-payid/a1b2c3d4-... \
  -H "x-api-key: sk_test_your_secret_key"
```

### Response

```json
{
  "success": true,
  "data": {
    "success": true,
    "message": "Static PayID deactivated."
  }
}
```

---

## Reactivate Static PayID

Re-enable a previously deactivated static PayID.

```
POST /v1/checkout/static-payid/:id/reactivate
```

### Example request

```bash
curl -X POST https://api.zevpaycheckout.com/v1/checkout/static-payid/a1b2c3d4-.../reactivate \
  -H "x-api-key: sk_test_your_secret_key"
```

### Response

```json
{
  "success": true,
  "data": {
    "success": true,
    "message": "Static PayID reactivated."
  }
}
```

---

## Response fields

| Field | Type | Description |
|-------|------|-------------|
| `id` | string | Unique identifier (UUID) |
| `pay_id_id` | string | Associated Pay ID record UUID |
| `pay_id` | string | Full PayID string (e.g., `"mystore.spid"`) |
| `business_id` | string | Owner business UUID |
| `api_key_id` | string\|null | API key used to create this PayID |
| `settlement_pay_id_id` | string\|null | Settlement destination entity UUID |
| `name` | string | Display name |
| `description` | string\|null | Description |
| `suffix` | string | PayID suffix (`.spid` or `.checkout`) |
| `source` | string | Creation source (`"api"` or `"dashboard"`) |
| `is_active` | boolean | Whether the PayID is active |
| `created_at` | string | ISO 8601 timestamp |
| `updated_at` | string | ISO 8601 timestamp |

## Try it: Create Static PayID

<ApiPlayground
  method="POST"
  endpoint="/v1/checkout/static-payid"
  :bodyFields="[
    { name: 'pay_id', type: 'string', required: true, placeholder: 'mystore', description: 'Base name (3-20 chars)' },
    { name: 'suffix', type: 'select', required: true, options: [{ label: '.spid', value: '.spid' }, { label: '.checkout', value: '.checkout' }] },
    { name: 'name', type: 'string', required: true, placeholder: 'My Online Store' },
    { name: 'description', type: 'string', placeholder: 'Payments for online orders' },
  ]"
/>

## Try it: List Static PayIDs

<ApiPlayground
  method="GET"
  endpoint="/v1/checkout/static-payid"
  :queryParams="[
    { name: 'page', type: 'integer', placeholder: '1', default: '1' },
    { name: 'page_size', type: 'integer', placeholder: '20' },
    { name: 'search', type: 'string', placeholder: 'Search by name or PayID' },
  ]"
/>

---

## Source: https://docs.zevpaycheckout.com/api/transfer
<!-- file: api/transfer.md -->

# Transfer API

Programmatically send money from a wallet to bank accounts or other ZevPay users via PayID.

::: warning Security Notice
Transfer endpoints move funds **out** of your wallet. These endpoints require a **secret key** and a wallet with **programmable debit** enabled. Keep your secret keys secure and consider IP whitelisting.
:::

## Authentication

All transfer endpoints require:

1. A **secret key** (`sk_live_*` or `sk_test_*`) passed via `Authorization: Bearer sk_live_...`
2. The API key must have the `transfers` permission
3. A programmable-debit wallet must be linked to the API key

See [Authentication](/guide/authentication) for details.

---

## List Banks

Returns all supported banks for external transfers.

```
GET /v1/checkout/transfer/banks
```

### Authentication

Secret key required. No `transfers` permission needed.

### Example Request

::: code-group

```bash [cURL]
curl https://api.zevpaycheckout.com/v1/checkout/transfer/banks \
  -H "Authorization: Bearer sk_live_your_secret_key"
```

```javascript [Node.js]
const response = await fetch('https://api.zevpaycheckout.com/v1/checkout/transfer/banks', {
  headers: {
    'Authorization': 'Bearer sk_live_your_secret_key',
  },
});
const { data } = await response.json();
console.log(data.banks);
```

```python [Python]
import requests

response = requests.get(
    'https://api.zevpaycheckout.com/v1/checkout/transfer/banks',
    headers={'Authorization': 'Bearer sk_live_your_secret_key'},
)
banks = response.json()['data']['banks']
```

:::

### Response

```json
{
  "success": true,
  "data": {
    "banks": [
      {
        "bankCode": "044",
        "bankName": "Access Bank"
      },
      {
        "bankCode": "058",
        "bankName": "Guaranty Trust Bank"
      }
    ]
  }
}
```

---

## Resolve Bank Account

Verify a bank account number and retrieve the account holder's name (name enquiry).

```
POST /v1/checkout/transfer/banks/resolve
```

### Authentication

Secret key required. No `transfers` permission needed.

### Request Body

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `account_number` | string | Yes | 10-digit bank account number |
| `bank_code` | string | Yes | Bank code from the [List Banks](#list-banks) endpoint |

### Example Request

::: code-group

```bash [cURL]
curl -X POST https://api.zevpaycheckout.com/v1/checkout/transfer/banks/resolve \
  -H "Authorization: Bearer sk_live_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{
    "account_number": "0123456789",
    "bank_code": "058"
  }'
```

```javascript [Node.js]
const response = await fetch('https://api.zevpaycheckout.com/v1/checkout/transfer/banks/resolve', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer sk_live_your_secret_key',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    account_number: '0123456789',
    bank_code: '058',
  }),
});
const { data } = await response.json();
console.log(data.account_name); // "JOHN DOE"
```

```python [Python]
import requests

response = requests.post(
    'https://api.zevpaycheckout.com/v1/checkout/transfer/banks/resolve',
    headers={'Authorization': 'Bearer sk_live_your_secret_key'},
    json={
        'account_number': '0123456789',
        'bank_code': '058',
    },
)
data = response.json()['data']
print(data['account_name'])  # "JOHN DOE"
```

:::

### Response

```json
{
  "success": true,
  "data": {
    "account_name": "JOHN DOE",
    "account_number": "0123456789",
    "bank_code": "058"
  }
}
```

---

## Calculate Charges

Calculate the fees for a bank transfer before initiating it.

```
POST /v1/checkout/transfer/charges
```

### Authentication

Secret key required. `transfers` permission required.

### Request Body

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `amount` | integer | Yes | Transfer amount in **kobo** |
| `bank_code` | string | Yes | Destination bank code |

### Example Request

::: code-group

```bash [cURL]
curl -X POST https://api.zevpaycheckout.com/v1/checkout/transfer/charges \
  -H "Authorization: Bearer sk_live_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 500000,
    "bank_code": "058"
  }'
```

```javascript [Node.js]
const response = await fetch('https://api.zevpaycheckout.com/v1/checkout/transfer/charges', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer sk_live_your_secret_key',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    amount: 500000,
    bank_code: '058',
  }),
});
const { data } = await response.json();
console.log(data);
```

:::

### Response

```json
{
  "success": true,
  "data": {
    "amount": 500000,
    "fee": 2625,
    "vat": 197,
    "stamp_duty": 0,
    "total": 502822,
    "currency": "NGN"
  }
}
```

### Response Fields

| Field | Type | Description |
|-------|------|-------------|
| `amount` | integer | Original transfer amount in kobo |
| `fee` | integer | Transfer fee in kobo |
| `vat` | integer | VAT on the fee in kobo |
| `stamp_duty` | integer | Stamp duty in kobo (applied on amounts ≥ ₦10,000) |
| `total` | integer | Total debit amount (amount + fee + vat + stamp_duty) in kobo |
| `currency` | string | Currency code (`"NGN"`) |

---

## Get Balance

Retrieve the available balance of the linked wallet.

```
GET /v1/checkout/transfer/balance
```

### Authentication

Secret key required. `transfers` permission required.

### Example Request

::: code-group

```bash [cURL]
curl https://api.zevpaycheckout.com/v1/checkout/transfer/balance \
  -H "Authorization: Bearer sk_live_your_secret_key"
```

```javascript [Node.js]
const response = await fetch('https://api.zevpaycheckout.com/v1/checkout/transfer/balance', {
  headers: {
    'Authorization': 'Bearer sk_live_your_secret_key',
  },
});
const { data } = await response.json();
console.log(`Balance: ₦${(data.available_balance / 100).toFixed(2)}`);
```

:::

### Response

```json
{
  "success": true,
  "data": {
    "available_balance": 15000000,
    "currency": "NGN"
  }
}
```

| Field | Type | Description |
|-------|------|-------------|
| `available_balance` | integer | Available balance in kobo |
| `currency` | string | Currency code (`"NGN"`) |

---

## Initiate Transfer

Send money to a bank account or ZevPay user. The `type` field determines the transfer destination.

```
POST /v1/checkout/transfer
```

### Authentication

Secret key required. `transfers` permission required.

### Request Body: Bank Transfer

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `type` | string | Yes | Must be `"bank_transfer"` |
| `account_number` | string | Yes | 10-digit destination account number |
| `bank_code` | string | Yes | Destination bank code |
| `account_name` | string | Yes | Account holder name (from [Resolve](#resolve-bank-account)) |
| `amount` | integer | Yes | Amount in **kobo** (min: 10,000 = ₦100, max: 500,000,000 = ₦5,000,000) |
| `narration` | string | No | Transfer description (max 100 characters) |
| `reference` | string | No | Your unique reference for idempotency (max 128 characters) |
| `metadata` | object | No | Custom key-value metadata |

### Request Body: PayID Transfer

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `type` | string | Yes | Must be `"payid"` |
| `pay_id` | string | Yes | Recipient's ZevPay ID (e.g., `"john"` or `"@john"`) |
| `amount` | integer | Yes | Amount in **kobo** (min: 10,000, max: 500,000,000) |
| `narration` | string | No | Transfer description (max 100 characters) |
| `reference` | string | No | Your unique reference for idempotency (max 128 characters) |
| `metadata` | object | No | Custom key-value metadata |

### Example Request: Bank Transfer

::: code-group

```bash [cURL]
curl -X POST https://api.zevpaycheckout.com/v1/checkout/transfer \
  -H "Authorization: Bearer sk_live_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "bank_transfer",
    "account_number": "0123456789",
    "bank_code": "058",
    "account_name": "JOHN DOE",
    "amount": 500000,
    "narration": "Vendor payment",
    "reference": "payout_001",
    "metadata": {
      "invoice_id": "INV-2026-001"
    }
  }'
```

```javascript [Node.js]
const response = await fetch('https://api.zevpaycheckout.com/v1/checkout/transfer', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer sk_live_your_secret_key',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    type: 'bank_transfer',
    account_number: '0123456789',
    bank_code: '058',
    account_name: 'JOHN DOE',
    amount: 500000,
    narration: 'Vendor payment',
    reference: 'payout_001',
    metadata: { invoice_id: 'INV-2026-001' },
  }),
});
const { data } = await response.json();
console.log(data.reference, data.status);
```

```python [Python]
import requests

response = requests.post(
    'https://api.zevpaycheckout.com/v1/checkout/transfer',
    headers={'Authorization': 'Bearer sk_live_your_secret_key'},
    json={
        'type': 'bank_transfer',
        'account_number': '0123456789',
        'bank_code': '058',
        'account_name': 'JOHN DOE',
        'amount': 500000,
        'narration': 'Vendor payment',
        'reference': 'payout_001',
        'metadata': {'invoice_id': 'INV-2026-001'},
    },
)
data = response.json()['data']
print(data['reference'], data['status'])
```

:::

### Example Request: PayID Transfer

::: code-group

```bash [cURL]
curl -X POST https://api.zevpaycheckout.com/v1/checkout/transfer \
  -H "Authorization: Bearer sk_live_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "payid",
    "pay_id": "john",
    "amount": 250000,
    "narration": "Freelance payment"
  }'
```

```javascript [Node.js]
const response = await fetch('https://api.zevpaycheckout.com/v1/checkout/transfer', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer sk_live_your_secret_key',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    type: 'payid',
    pay_id: 'john',
    amount: 250000,
    narration: 'Freelance payment',
  }),
});
const { data } = await response.json();
console.log(data.reference, data.status);
```

:::

### Response

```json
{
  "success": true,
  "data": {
    "reference": "ZVP-TRF-abc123def456",
    "public_id": "xK9mQ2pL4vR7nW3jY",
    "type": "bank_transfer",
    "status": "completed",
    "amount": 500000,
    "fees": 2625,
    "vat": 197,
    "stamp_duty": 0,
    "currency": "NGN",
    "narration": "Vendor payment",
    "recipient": {
      "name": "JOHN DOE",
      "bank": "Guaranty Trust Bank",
      "account_number": "0123456789"
    },
    "merchant_reference": "payout_001",
    "metadata": {
      "invoice_id": "INV-2026-001"
    },
    "created_at": "2026-03-08T14:30:00.000Z",
    "completed_at": "2026-03-08T14:30:02.000Z"
  }
}
```

### Response Fields

| Field | Type | Description |
|-------|------|-------------|
| `reference` | string | Our transaction reference |
| `public_id` | string | Public transaction identifier |
| `type` | string | `"bank_transfer"` or `"payid"` |
| `status` | string | `"pending"`, `"completed"`, or `"failed"` |
| `amount` | integer | Transfer amount in kobo |
| `fees` | integer | Transfer fees in kobo (0 for PayID transfers) |
| `vat` | integer | VAT in kobo |
| `stamp_duty` | integer | Stamp duty in kobo |
| `currency` | string | Currency code (`"NGN"`) |
| `narration` | string \| null | Transfer description |
| `recipient.name` | string | Recipient name |
| `recipient.bank` | string \| null | Recipient bank (bank transfers only) |
| `recipient.account_number` | string \| null | Recipient account number (bank transfers only) |
| `merchant_reference` | string \| null | Your idempotency reference |
| `metadata` | object \| null | Your custom metadata |
| `created_at` | string | ISO 8601 timestamp |
| `completed_at` | string \| null | ISO 8601 timestamp (when completed) |

### Transfer Status Lifecycle

| Status | Description |
|--------|-------------|
| `pending` | Transfer is being processed (bank transfers only) |
| `completed` | Transfer delivered successfully |
| `failed` | Transfer was rejected by the bank |

::: info
PayID transfers complete instantly. The status will always be `"completed"` on success.

Bank transfers may briefly show `"pending"` before resolving to `"completed"` or `"failed"`.
:::

### Idempotency

If you provide a `reference` and a transfer with that reference already exists, the API returns the existing transfer instead of creating a duplicate. The response will be identical to the original.

---

## List Transfers

Retrieve a paginated list of transfers from the linked wallet.

```
GET /v1/checkout/transfer
```

### Authentication

Secret key required. `transfers` permission required.

### Query Parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `page` | integer | 1 | Page number |
| `page_size` | integer | 20 | Items per page (max 100) |
| `status` | string | none | Filter by status: `pending`, `completed`, `failed` |
| `type` | string | none | Filter by type: `bank_transfer`, `payid` |
| `search` | string | none | Search by reference, recipient name, or account number |

### Example Request

::: code-group

```bash [cURL]
curl "https://api.zevpaycheckout.com/v1/checkout/transfer?page=1&page_size=10&status=completed" \
  -H "Authorization: Bearer sk_live_your_secret_key"
```

```javascript [Node.js]
const params = new URLSearchParams({
  page: '1',
  page_size: '10',
  status: 'completed',
});

const response = await fetch(
  `https://api.zevpaycheckout.com/v1/checkout/transfer?${params}`,
  {
    headers: {
      'Authorization': 'Bearer sk_live_your_secret_key',
    },
  },
);
const { data } = await response.json();
console.log(`${data.total} transfers, page ${data.page}/${data.total_pages}`);
```

:::

### Response

```json
{
  "success": true,
  "data": {
    "items": [
      {
        "reference": "ZVP-TRF-abc123def456",
        "public_id": "xK9mQ2pL4vR7nW3jY",
        "type": "bank_transfer",
        "status": "completed",
        "amount": 500000,
        "fees": 2625,
        "vat": 197,
        "stamp_duty": 0,
        "currency": "NGN",
        "narration": "Vendor payment",
        "recipient": {
          "name": "JOHN DOE",
          "bank": "Guaranty Trust Bank",
          "account_number": "0123456789"
        },
        "merchant_reference": "payout_001",
        "metadata": null,
        "created_at": "2026-03-08T14:30:00.000Z",
        "completed_at": "2026-03-08T14:30:02.000Z"
      }
    ],
    "total": 42,
    "page": 1,
    "page_size": 10,
    "total_pages": 5
  }
}
```

---

## Get Transfer

Retrieve a single transfer by its reference.

```
GET /v1/checkout/transfer/:reference
```

### Authentication

Secret key required. `transfers` permission required.

### Path Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `reference` | string | The transfer reference |

### Example Request

::: code-group

```bash [cURL]
curl https://api.zevpaycheckout.com/v1/checkout/transfer/ZVP-TRF-abc123def456 \
  -H "Authorization: Bearer sk_live_your_secret_key"
```

```javascript [Node.js]
const reference = 'ZVP-TRF-abc123def456';
const response = await fetch(
  `https://api.zevpaycheckout.com/v1/checkout/transfer/${reference}`,
  {
    headers: {
      'Authorization': 'Bearer sk_live_your_secret_key',
    },
  },
);
const { data } = await response.json();
console.log(data.status);
```

:::

### Response

Returns the same [transfer object](#response-fields) as the initiate endpoint.

---

## Verify Transfer

Check the current status of a transfer. For bank transfers, this queries the banking provider for the latest status.

```
GET /v1/checkout/transfer/:reference/verify
```

### Authentication

Secret key required. `transfers` permission required.

### Path Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `reference` | string | The transfer reference |

### Example Request

::: code-group

```bash [cURL]
curl https://api.zevpaycheckout.com/v1/checkout/transfer/ZVP-TRF-abc123def456/verify \
  -H "Authorization: Bearer sk_live_your_secret_key"
```

```javascript [Node.js]
const reference = 'ZVP-TRF-abc123def456';
const response = await fetch(
  `https://api.zevpaycheckout.com/v1/checkout/transfer/${reference}/verify`,
  {
    headers: {
      'Authorization': 'Bearer sk_live_your_secret_key',
    },
  },
);
const { data } = await response.json();
console.log(data.status); // "completed" | "pending" | "failed"
```

:::

### Response

Returns the same [transfer object](#response-fields) as the initiate endpoint, with the most up-to-date status.

::: tip
Use the verify endpoint after receiving a `transfer.failed` webhook to confirm the final status, or to poll pending transfers that haven't received a webhook yet.
:::

---

## Errors

| Status | Code | Description |
|--------|------|-------------|
| 400 | Bad Request | Invalid parameters (missing fields, invalid amount range) |
| 400 | Bad Request | Transfer not found (wrong reference) |
| 400 | Bad Request | Insufficient balance |
| 400 | Bad Request | Self-transfer not allowed (PayID transfers) |
| 403 | Forbidden | Secret key required |
| 403 | Forbidden | API key missing `transfers` permission |
| 403 | Forbidden | No transfer wallet linked to API key |
| 403 | Forbidden | Programmable debit disabled on wallet |
| 403 | Forbidden | Wallet does not belong to this business |

## Try it: List Banks

<ApiPlayground
  method="GET"
  endpoint="/v1/checkout/transfer/banks"
  authType="bearer"
/>

## Try it: Resolve Bank Account

<ApiPlayground
  method="POST"
  endpoint="/v1/checkout/transfer/banks/resolve"
  authType="bearer"
  :bodyFields="[
    { name: 'account_number', type: 'string', required: true, placeholder: '0123456789', description: '10-digit account number' },
    { name: 'bank_code', type: 'string', required: true, placeholder: '058', description: 'Bank code from List Banks' },
  ]"
/>

## Try it: Get Balance

<ApiPlayground
  method="GET"
  endpoint="/v1/checkout/transfer/balance"
  authType="bearer"
/>

## Try it: Initiate Transfer

<ApiPlayground
  method="POST"
  endpoint="/v1/checkout/transfer"
  authType="bearer"
  :bodyFields="[
    { name: 'type', type: 'select', required: true, options: [{ label: 'Bank Transfer', value: 'bank_transfer' }, { label: 'PayID', value: 'payid' }] },
    { name: 'account_number', type: 'string', placeholder: '0123456789', description: 'For bank_transfer' },
    { name: 'bank_code', type: 'string', placeholder: '058', description: 'For bank_transfer' },
    { name: 'account_name', type: 'string', placeholder: 'JOHN DOE', description: 'For bank_transfer' },
    { name: 'pay_id', type: 'string', placeholder: 'john', description: 'For payid' },
    { name: 'amount', type: 'integer', required: true, placeholder: '500000', description: 'Amount in kobo' },
    { name: 'narration', type: 'string', placeholder: 'Payment description' },
    { name: 'reference', type: 'string', placeholder: 'payout_001', description: 'Idempotency reference' },
  ]"
/>

## Try it: List Transfers

<ApiPlayground
  method="GET"
  endpoint="/v1/checkout/transfer"
  authType="bearer"
  :queryParams="[
    { name: 'page', type: 'integer', placeholder: '1', default: '1' },
    { name: 'page_size', type: 'integer', placeholder: '20' },
    { name: 'status', type: 'select', options: [{ label: 'Pending', value: 'pending' }, { label: 'Completed', value: 'completed' }, { label: 'Failed', value: 'failed' }] },
    { name: 'type', type: 'select', options: [{ label: 'Bank Transfer', value: 'bank_transfer' }, { label: 'PayID', value: 'payid' }] },
    { name: 'search', type: 'string', placeholder: 'Search by reference, name, or account' },
  ]"
/>

---

## Source: https://docs.zevpaycheckout.com/api/verify-session
<!-- file: api/verify-session.md -->

# Verify Session

Verify the status of a checkout session. Use this endpoint to confirm whether a payment has been completed.

```
GET /v1/checkout/session/:sessionId/verify
```

## Authentication

Requires an API key (public or secret).

## Path parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `sessionId` | string | The checkout session ID |

## Example request

::: code-group

```bash [cURL]
curl https://api.zevpaycheckout.com/v1/checkout/session/ecc48011-e36e-4741-9b99-657f4a1ee86e/verify \
  -H "x-api-key: sk_test_your_secret_key"
```

```js [Node.js]
const response = await fetch(
  'https://api.zevpaycheckout.com/v1/checkout/session/ecc48011-e36e-4741-9b99-657f4a1ee86e/verify',
  {
    headers: {
      'x-api-key': 'sk_test_your_secret_key',
    },
  }
);

const { data } = await response.json();
console.log(data.status); // "completed"
```

```python [Python]
import requests

response = requests.get(
    "https://api.zevpaycheckout.com/v1/checkout/session/ecc48011-e36e-4741-9b99-657f4a1ee86e/verify",
    headers={"x-api-key": "sk_test_your_secret_key"},
)

data = response.json()["data"]
print(data["status"])  # "completed"
```

```php [PHP]
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,
  'https://api.zevpaycheckout.com/v1/checkout/session/ecc48011-e36e-4741-9b99-657f4a1ee86e/verify');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  'x-api-key: sk_test_your_secret_key',
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = json_decode(curl_exec($ch), true);
$data = $response['data'];
echo $data['status']; // "completed"
```

:::

## Response

```json
{
  "success": true,
  "data": {
    "session_id": "ecc48011-e36e-4741-9b99-657f4a1ee86e",
    "reference": "ZVP-CKO-S-abc123",
    "merchant_reference": "ORDER-12345",
    "status": "completed",
    "amount": 500000,
    "currency": "NGN",
    "customer_email": "customer@example.com",
    "payment_method": "bank_transfer",
    "paid_at": "2026-03-07T19:42:00.000Z"
  }
}
```

| Field | Type | Description |
|-------|------|-------------|
| `session_id` | string | The checkout session ID |
| `reference` | string | Our transaction reference |
| `merchant_reference` | string \| null | Your custom reference (if provided during initialization) |
| `status` | string | Session status (see [statuses](#session-statuses)) |
| `amount` | integer | Amount in kobo |
| `currency` | string | Currency code (e.g., `"NGN"`) |
| `customer_email` | string | Customer's email address |
| `payment_method` | string \| null | Payment method used (`"bank_transfer"` or `"payid"`), or `null` if not yet selected |
| `paid_at` | string \| null | ISO 8601 timestamp of when payment was confirmed, or `null` if not yet paid |

## Session statuses

| Status | Description |
|--------|-------------|
| `active` | Session is active, awaiting payment |
| `completed` | Payment has been received and confirmed |
| `expired` | Session expired (30-minute timeout) |
| `failed` | Payment failed |

## Behavior

- If the session is `active` but past its `expires_at` time, the status is automatically updated to `expired` before returning
- The `paid_at` field is only populated when status is `completed`
- This endpoint is idempotent; calling it multiple times returns the same result

::: tip Best Practice
Always verify payment status on your server before fulfilling orders. Do not rely solely on client-side callbacks.
:::

## Errors

| Status | Message | Cause |
|--------|---------|-------|
| `404` | Session not found. | Invalid session ID |
| `401` | Invalid API key | Key not found or inactive |

## Try it

<ApiPlayground
  method="GET"
  endpoint="/v1/checkout/session/:sessionId/verify"
  :pathParams="[
    { name: 'sessionId', type: 'string', required: true, placeholder: 'ecc48011-e36e-4741-9b99-657f4a1ee86e' },
  ]"
/>

---

## Source: https://docs.zevpaycheckout.com/api/virtual-account
<!-- file: api/virtual-account.md -->

# Virtual Account

Create temporary bank accounts to receive payments via bank transfer. When a customer transfers money to a virtual account, the payment is automatically matched and settled to your account.

**Required permission:** `virtual_account`

## Create Virtual Account

```
POST /v1/checkout/virtual-account
```

### Authentication

Requires a **secret key** (`sk_*`).

### Request body

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `amount` | string | Yes | Expected amount in naira (e.g., `"5000.00"`) |
| `validity_minutes` | integer | No | How long the account stays active. Default: `4320` (72h). Max: `4320` |
| `amount_validation` | string | No | Amount validation rule. See [Dynamic PayID amount rules](/api/dynamic-payid#amount-validation-rules). Default: the bank's own default |
| `metadata` | object | No | Custom key-value data stored with the account |

::: tip Settlement
Payments received on this virtual account are settled to your API key's configured settlement ledger. To change where payments are settled, update your API key's settlement configuration in the [dashboard](https://dashboard.zevpaycheckout.com).
:::

### Example request

::: code-group

```bash [cURL]
curl -X POST https://api.zevpaycheckout.com/v1/checkout/virtual-account \
  -H "Content-Type: application/json" \
  -H "x-api-key: sk_test_your_secret_key" \
  -d '{
    "amount": "5000.00",
    "validity_minutes": 1440,
    "metadata": {
      "order_id": "ORD-12345"
    }
  }'
```

```javascript [Node.js]
const response = await fetch(
  "https://api.zevpaycheckout.com/v1/checkout/virtual-account",
  {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "x-api-key": "sk_test_your_secret_key",
    },
    body: JSON.stringify({
      amount: "5000.00",
      validity_minutes: 1440,
      metadata: { order_id: "ORD-12345" },
    }),
  }
);
const data = await response.json();
```

:::

### Response

```json
{
  "success": true,
  "data": {
    "public_id": "abc123def456ghi78",
    "account_number": "4601234567",
    "account_name": "My Business",
    "bank_name": "9 Payment Service Bank",
    "bank_code": "000036",
    "merchant_name": "My Business",
    "provider": "psb9",
    "reference": "ZVP-VA-1772906868046-d5aa1c",
    "amount": "5000.00",
    "status": "pending",
    "expires_at": "2026-03-09T12:00:00.000Z",
    "completed_at": null,
    "source": "api",
    "created_at": "2026-03-08T12:00:00.000Z"
  }
}
```

Show your customer both `account_number` and `bank_name`. They must pick that exact bank when sending the transfer, or the money will not reach the account.

::: warning Never hardcode the bank
The bank is not fixed. ZevPay mints virtual accounts through partner banks, we add and rotate partners over time, and two accounts created minutes apart can sit at different banks. Always read `bank_name` (and `bank_code` for a programmatic bank picker) from the response for that specific account. The `provider` field is an internal key, kept only for backward compatibility. Do not display it or map it to a bank name yourself.
:::

---

## List Virtual Accounts

```
GET /v1/checkout/virtual-account
```

### Query parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `page` | integer | 1 | Page number |
| `page_size` | integer | 20 | Items per page (max 100) |
| `status` | string | none | Filter: `"pending"`, `"completed"`, `"expired"`, `"cancelled"` |

### Example request

```bash
curl "https://api.zevpaycheckout.com/v1/checkout/virtual-account?status=pending&page_size=10" \
  -H "x-api-key: sk_test_your_secret_key"
```

### Response

```json
{
  "success": true,
  "data": {
    "items": [
      {
        "public_id": "abc123def456ghi78",
        "account_number": "4601234567",
        "account_name": "My Business",
        "bank_name": "9 Payment Service Bank",
        "bank_code": "000036",
        "merchant_name": "My Business",
        "provider": "psb9",
        "reference": "ZVP-VA-1772906868046-d5aa1c",
        "amount": "5000.00",
        "status": "pending",
        "expires_at": "2026-03-09T12:00:00.000Z",
        "completed_at": null,
        "source": "api",
        "created_at": "2026-03-08T12:00:00.000Z"
      }
    ],
    "total": 1,
    "page": 1,
    "page_size": 10,
    "total_pages": 1
  }
}
```

---

## Get Virtual Account

```
GET /v1/checkout/virtual-account/:publicId
```

### Path parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `publicId` | string | Virtual account public ID |

### Example request

```bash
curl https://api.zevpaycheckout.com/v1/checkout/virtual-account/abc123def456ghi78 \
  -H "x-api-key: sk_test_your_secret_key"
```

---

## Status lifecycle

| Status | Description |
|--------|-------------|
| `pending` | Account is active and awaiting payment |
| `completed` | Payment received and settled |
| `expired` | Account expired without receiving payment |
| `cancelled` | Account creation failed at the bank |

---

## Response fields

| Field | Type | Description |
|-------|------|-------------|
| `public_id` | string | Unique public identifier |
| `account_number` | string\|null | Bank account number your customer transfers to |
| `bank_name` | string | Bank your customer must select. Varies per account, always read it here |
| `bank_code` | string\|null | NIP code for that bank, for a programmatic bank picker |
| `account_name` | string\|null | Name shown on the account |
| `merchant_name` | string\|null | Same as `account_name`. Kept for backward compatibility |
| `provider` | string | Internal partner key. Deprecated, never display it |
| `reference` | string | Unique internal reference |
| `amount` | string\|null | Expected payment amount (naira) |
| `status` | string | Account status (see [lifecycle](#status-lifecycle)) |
| `expires_at` | string\|null | ISO 8601 expiry timestamp |
| `completed_at` | string\|null | ISO 8601 completion timestamp |
| `source` | string | Creation source (`"api"`, `"dashboard"`, etc.) |
| `created_at` | string | ISO 8601 creation timestamp |

## Try it: Create Virtual Account

<ApiPlayground
  method="POST"
  endpoint="/v1/checkout/virtual-account"
  :bodyFields="[
    { name: 'amount', type: 'string', required: true, placeholder: '5000.00', description: 'Amount in naira' },
    { name: 'validity_minutes', type: 'integer', placeholder: '4320', description: 'Default: 4320 (72h)' },
    { name: 'metadata', type: 'object', placeholder: '{ &quot;order_id&quot;: &quot;ORD-12345&quot; }' },
  ]"
/>

## Try it: List Virtual Accounts

<ApiPlayground
  method="GET"
  endpoint="/v1/checkout/virtual-account"
  :queryParams="[
    { name: 'page', type: 'integer', placeholder: '1', default: '1' },
    { name: 'page_size', type: 'integer', placeholder: '20' },
    { name: 'status', type: 'select', options: [{ label: 'Pending', value: 'pending' }, { label: 'Completed', value: 'completed' }, { label: 'Expired', value: 'expired' }, { label: 'Cancelled', value: 'cancelled' }] },
  ]"
/>

---

## Source: https://docs.zevpaycheckout.com/api/wallet
<!-- file: api/wallet.md -->

# Wallet Management API

Programmatically manage your linked wallet: view details, add or remove members, and update settings via an admin API key.

::: warning Admin Access Required
These endpoints require an API key with **admin role** on the linked wallet. Admin API keys can manage members but **cannot** manage other admins or the wallet owner. Only the wallet owner can promote/demote admins from the dashboard.
:::

## Authentication

All wallet management endpoints require:

1. A **secret key** (`sk_live_*` or `sk_test_*`) passed via `Authorization: Bearer sk_live_...`
2. The API key must have the `transfers` permission
3. A programmable-debit wallet must be linked to the API key
4. The API key must have **admin role** on the wallet (configured from the Members tab in the dashboard)

See [Authentication](/guide/authentication) for details.

---

## Get Wallet

Retrieve the linked wallet's details including balance, members, settings, and API key members.

```
GET /v1/checkout/wallet
```

### Authentication

Secret key required. `transfers` permission required. Admin role required.

### Example Request

::: code-group

```bash [cURL]
curl https://api.zevpaycheckout.com/v1/checkout/wallet \
  -H "Authorization: Bearer sk_live_your_secret_key"
```

```javascript [Node.js]
const response = await fetch('https://api.zevpaycheckout.com/v1/checkout/wallet', {
  headers: {
    'Authorization': 'Bearer sk_live_your_secret_key',
  },
});
const { data } = await response.json();
console.log(data.name, data.balance);
```

```python [Python]
import requests

response = requests.get(
    'https://api.zevpaycheckout.com/v1/checkout/wallet',
    headers={'Authorization': 'Bearer sk_live_your_secret_key'},
)
data = response.json()['data']
print(data['name'], data['balance'])
```

:::

### Response

```json
{
  "success": true,
  "data": {
    "public_id": "wlt_abc123",
    "name": "Operations Wallet",
    "description": "Main operations wallet",
    "pay_id": "@ops.wallet",
    "owner_type": "business",
    "balance": {
      "available": 5000000,
      "currency": "NGN"
    },
    "settings": {
      "daily_limit": "5000.00",
      "monthly_limit": "155000.00",
      "single_limit": null,
      "enable_notification": true,
      "hide_members_transaction": false,
      "allow_programmable_debit": true
    },
    "members": [
      {
        "pay_id": "@john.personal",
        "display_name": "John Doe",
        "entity_type": "personal",
        "role": "owner",
        "joined_at": "2025-01-15T10:00:00.000Z"
      },
      {
        "pay_id": "@jane.personal",
        "display_name": "Jane Smith",
        "entity_type": "personal",
        "role": "member",
        "joined_at": "2025-02-01T10:00:00.000Z"
      }
    ],
    "api_key_members": [
      {
        "api_key_id": "uuid-here",
        "label": "Production Key",
        "key_prefix": "sk_live_ab",
        "role": "admin",
        "linked_at": "2025-03-01T10:00:00.000Z"
      }
    ],
    "member_count": 4,
    "created_at": "2025-01-15T10:00:00.000Z"
  }
}
```

### Response Fields

| Field | Type | Description |
|-------|------|-------------|
| `public_id` | string | Wallet public identifier |
| `name` | string | Wallet name |
| `description` | string | Wallet description |
| `pay_id` | string | Wallet's PayID |
| `owner_type` | string | `business` or `personal` |
| `balance.available` | number | Available balance in kobo (divide by 100 for naira) |
| `balance.currency` | string | Currency code (e.g. `NGN`) |
| `settings` | object | Wallet-level settings |
| `members` | array | List of human members with their roles |
| `api_key_members` | array | List of API key members with their roles |
| `member_count` | number | Total member count (people + API keys) |
| `created_at` | string | ISO 8601 creation timestamp |

---

## Update Wallet Settings

Update the linked wallet's settings. Admin API keys can update name, description, notification, and transaction visibility settings.

```
PATCH /v1/checkout/wallet
```

### Authentication

Secret key required. `transfers` permission required. Admin role required.

### Request Body

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | No | Wallet name (max 100 characters) |
| `description` | string | No | Wallet description |
| `enable_notification` | boolean | No | Enable/disable transaction notifications |
| `hide_members_transaction` | boolean | No | Hide transaction details from members |

### Example Request

::: code-group

```bash [cURL]
curl -X PATCH https://api.zevpaycheckout.com/v1/checkout/wallet \
  -H "Authorization: Bearer sk_live_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Wallet Name",
    "hide_members_transaction": true
  }'
```

```javascript [Node.js]
const response = await fetch('https://api.zevpaycheckout.com/v1/checkout/wallet', {
  method: 'PATCH',
  headers: {
    'Authorization': 'Bearer sk_live_your_secret_key',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Updated Wallet Name',
    hide_members_transaction: true,
  }),
});
const { data } = await response.json();
```

```python [Python]
import requests

response = requests.patch(
    'https://api.zevpaycheckout.com/v1/checkout/wallet',
    headers={'Authorization': 'Bearer sk_live_your_secret_key'},
    json={
        'name': 'Updated Wallet Name',
        'hide_members_transaction': True,
    },
)
```

:::

### Response

```json
{
  "success": true,
  "data": {
    "success": true,
    "message": "Wallet settings updated"
  }
}
```

---

## List Members

List all members of the linked wallet, including both human members and API key members with their settings.

```
GET /v1/checkout/wallet/members
```

### Authentication

Secret key required. `transfers` permission required. Admin role required.

### Example Request

::: code-group

```bash [cURL]
curl https://api.zevpaycheckout.com/v1/checkout/wallet/members \
  -H "Authorization: Bearer sk_live_your_secret_key"
```

```javascript [Node.js]
const response = await fetch('https://api.zevpaycheckout.com/v1/checkout/wallet/members', {
  headers: {
    'Authorization': 'Bearer sk_live_your_secret_key',
  },
});
const { data } = await response.json();
console.log(data.members, data.api_key_members);
```

```python [Python]
import requests

response = requests.get(
    'https://api.zevpaycheckout.com/v1/checkout/wallet/members',
    headers={'Authorization': 'Bearer sk_live_your_secret_key'},
)
data = response.json()['data']
print(data['members'])
```

:::

### Response

```json
{
  "success": true,
  "data": {
    "members": [
      {
        "pay_id": "@john.personal",
        "display_name": "John Doe",
        "entity_type": "personal",
        "role": "owner",
        "is_active": true,
        "joined_at": "2025-01-15T10:00:00.000Z",
        "settings": {
          "enable_notification": true,
          "hide_wallet_balance": false,
          "has_daily_limit": false,
          "daily_limit": null,
          "has_monthly_limit": false,
          "monthly_limit": null,
          "has_single_limit": false,
          "single_limit": null
        }
      }
    ],
    "api_key_members": [
      {
        "api_key_id": "uuid-here",
        "label": "Production Key",
        "key_prefix": "sk_live_ab",
        "role": "admin",
        "is_active": true,
        "linked_at": "2025-03-01T10:00:00.000Z",
        "settings": {
          "hide_balance": false,
          "has_daily_limit": true,
          "daily_limit": "1000000.00",
          "has_monthly_limit": false,
          "monthly_limit": null,
          "has_single_limit": false,
          "single_limit": null
        }
      }
    ],
    "total": 4
  }
}
```

---

## Add Member

Add a new member to the wallet by their PayID. The member will be added with the `member` role.

```
POST /v1/checkout/wallet/members
```

### Authentication

Secret key required. `transfers` permission required. Admin role required.

### Request Body

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `pay_id` | string | Yes | The PayID of the entity to add (e.g. `john.personal`) |

::: info
Admin API keys can only add members. They cannot promote members to admin. Only the wallet owner can do that from the dashboard.
:::

### Example Request

::: code-group

```bash [cURL]
curl -X POST https://api.zevpaycheckout.com/v1/checkout/wallet/members \
  -H "Authorization: Bearer sk_live_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{ "pay_id": "jane.personal" }'
```

```javascript [Node.js]
const response = await fetch('https://api.zevpaycheckout.com/v1/checkout/wallet/members', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer sk_live_your_secret_key',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ pay_id: 'jane.personal' }),
});
const { data } = await response.json();
```

```python [Python]
import requests

response = requests.post(
    'https://api.zevpaycheckout.com/v1/checkout/wallet/members',
    headers={'Authorization': 'Bearer sk_live_your_secret_key'},
    json={'pay_id': 'jane.personal'},
)
```

:::

### Response

```json
{
  "success": true,
  "data": {
    "success": true,
    "message": "Member added to wallet"
  }
}
```

---

## Remove Member

Remove a member from the wallet by their PayID.

```
DELETE /v1/checkout/wallet/members/:payId
```

### Authentication

Secret key required. `transfers` permission required. Admin role required.

### Path Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `payId` | string | The PayID of the member to remove (e.g. `jane.personal`) |

::: warning Restrictions
- Admin API keys **cannot** remove the wallet owner
- Admin API keys **cannot** remove other admins; only the wallet owner can
- Admin API keys can only remove members with the `member` role
:::

### Example Request

::: code-group

```bash [cURL]
curl -X DELETE https://api.zevpaycheckout.com/v1/checkout/wallet/members/jane.personal \
  -H "Authorization: Bearer sk_live_your_secret_key"
```

```javascript [Node.js]
const response = await fetch('https://api.zevpaycheckout.com/v1/checkout/wallet/members/jane.personal', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer sk_live_your_secret_key',
  },
});
const { data } = await response.json();
```

```python [Python]
import requests

response = requests.delete(
    'https://api.zevpaycheckout.com/v1/checkout/wallet/members/jane.personal',
    headers={'Authorization': 'Bearer sk_live_your_secret_key'},
)
```

:::

### Response

```json
{
  "success": true,
  "data": {
    "success": true,
    "message": "Member removed from wallet"
  }
}
```

---

## Update Member Settings

Update a member's individual settings including notification preferences, balance visibility, and spending limits.

```
PATCH /v1/checkout/wallet/members/:payId
```

### Authentication

Secret key required. `transfers` permission required. Admin role required.

### Path Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `payId` | string | The PayID of the member to update (e.g. `jane.personal`) |

### Request Body

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `enable_notification` | boolean | No | Enable/disable notifications for this member |
| `hide_wallet_balance` | boolean | No | Hide the wallet balance from this member |
| `has_daily_limit` | boolean | No | Enable daily spending limit |
| `daily_limit` | number | No | Daily spending limit in naira (required when `has_daily_limit` is true) |
| `has_monthly_limit` | boolean | No | Enable monthly spending limit |
| `monthly_limit` | number | No | Monthly spending limit in naira |
| `has_single_limit` | boolean | No | Enable per-transaction spending limit |
| `single_limit` | number | No | Per-transaction spending limit in naira |

::: warning Restrictions
- Admin API keys can only update settings for members with the `member` role
- Cannot update the wallet owner's settings
- Cannot update other admins' settings
- Role changes are not available via the API; only the wallet owner can change roles from the dashboard
:::

### Example Request

::: code-group

```bash [cURL]
curl -X PATCH https://api.zevpaycheckout.com/v1/checkout/wallet/members/jane.personal \
  -H "Authorization: Bearer sk_live_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{
    "hide_wallet_balance": true,
    "has_daily_limit": true,
    "daily_limit": 50000
  }'
```

```javascript [Node.js]
const response = await fetch('https://api.zevpaycheckout.com/v1/checkout/wallet/members/jane.personal', {
  method: 'PATCH',
  headers: {
    'Authorization': 'Bearer sk_live_your_secret_key',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    hide_wallet_balance: true,
    has_daily_limit: true,
    daily_limit: 50000,
  }),
});
const { data } = await response.json();
```

```python [Python]
import requests

response = requests.patch(
    'https://api.zevpaycheckout.com/v1/checkout/wallet/members/jane.personal',
    headers={'Authorization': 'Bearer sk_live_your_secret_key'},
    json={
        'hide_wallet_balance': True,
        'has_daily_limit': True,
        'daily_limit': 50000,
    },
)
```

:::

### Response

```json
{
  "success": true,
  "data": {
    "success": true,
    "message": "Member settings updated"
  }
}
```

---

## Error Codes

| Status | Code | Description |
|--------|------|-------------|
| `401` | Unauthorized | Missing or invalid API key |
| `403` | Forbidden | Not a secret key, no wallet linked, programmable debit disabled, or insufficient permissions |
| `403` | Forbidden | API key is not an admin on the wallet |
| `403` | Forbidden | Cannot manage admins or the wallet owner (admin can only manage members) |
| `400` | Bad Request | Validation error, member already exists, or cannot remove owner |
| `404` | Not Found | Member not found in wallet, or PayID does not exist |

### Permission Hierarchy

| Role | Can manage members | Can manage admins | Can manage owner | Can change roles |
|------|-------------------|-------------------|------------------|------------------|
| **Owner** (dashboard only) | Yes | Yes | Self only | Yes |
| **Admin** (API or dashboard) | Yes | No | No | No |
| **Member** | No | No | No | No |

## Try it: Get Wallet

<ApiPlayground
  method="GET"
  endpoint="/v1/checkout/wallet"
  authType="bearer"
/>

## Try it: List Members

<ApiPlayground
  method="GET"
  endpoint="/v1/checkout/wallet/members"
  authType="bearer"
/>

## Try it: Add Member

<ApiPlayground
  method="POST"
  endpoint="/v1/checkout/wallet/members"
  authType="bearer"
  :bodyFields="[
    { name: 'pay_id', type: 'string', required: true, placeholder: 'jane.personal', description: 'PayID of entity to add' },
  ]"
/>

---

## Source: https://docs.zevpaycheckout.com/checkout/inline
<!-- file: checkout/inline.md -->

---
title: Inline Checkout
description: Embed a ZevPay payment modal directly on your page with the browser SDK. No server step required. Uses your public key, handles session creation, method selection, and polling.
---

# Inline Checkout

Embed a payment modal directly on your website. The browser SDK creates the checkout session, renders the modal, collects the payment, and polls for confirmation using your public API key. No server step is required to start a payment.

If you want us to host the whole page instead, use [Standard Checkout](/checkout/standard).

## Install

### Script tag (recommended)

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

### npm

```bash
npm install @zevpay/inline
```

## Quick start

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

<script src="https://js.zevpaycheckout.com/v1/inline.js"></script>
<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', // optional
      firstName: 'John', // optional
      lastName: 'Doe',   // optional
      onSuccess: function (reference) {
        console.log('Payment successful:', reference);
        // Verify the payment on your server before fulfilling the order.
      },
      onClose: function () {
        console.log('Checkout closed');
      },
    });
  });
</script>
```

## Options

Pass these to `checkout(options)`.

| Option | Type | Required | Description |
|--------|------|----------|-------------|
| `apiKey` | string | Yes | Your public API key (`pk_test_...` or `pk_live_...`). Sent from the browser, so configure allowed domains on the key. |
| `email` | string | Yes | Customer's email address. |
| `amount` | integer | Yes | Amount in kobo. `500000` is ₦5,000. |
| `currency` | string | No | Currency code. Only `"NGN"` is accepted. Defaults to `"NGN"`. |
| `reference` | string | No | Your unique transaction reference. Generated for you if omitted. |
| `firstName` | string | No | Combined with `lastName` and stored as the session's customer name. |
| `lastName` | string | No | Combined with `firstName`. |
| `metadata` | object | No | Custom data attached to the transaction. Returned in webhooks and on verify. |
| `paymentMethods` | string or string[] | No | Which methods to offer. Defaults to the methods configured for your key. See below. |
| `cryptoAssets` | string[] | No | Narrow the crypto assets offered, e.g. `['USDT:TRON']` or `['USDT']`. Only assets enabled on your key can appear. |
| `onInitialize` | function | No | Fires once the session is created and the modal is ready. |
| `onSuccess` | function | No | Fires when the payment is confirmed. Receives the transaction reference. |
| `onError` | function | No | Fires on a validation, network, or API error. Receives an error with `code` and `message`. |
| `onFailure` | function | No | Fires when a payment fails after a method was selected. |
| `onExpired` | function | No | Fires when the session expires. |
| `onClose` | function | No | Fires when the customer closes the modal. |

### Choosing payment methods

Control which methods appear in the modal:

```js
// All methods your key allows (default behaviour)
paymentMethods: 'all'

// A specific set
paymentMethods: ['bank', 'payid']

// A single method. The picker is skipped and the method is auto-selected.
paymentMethods: ['bank']

// Crypto only, and only USDT on TRON
paymentMethods: ['crypto'],
cryptoAssets: ['USDT:TRON']
```

The list you pass can only narrow what your key allows. If a method you list is not available on this checkout (disabled on your key, disabled platform-wide, or crypto not eligible), it is simply not shown; the modal renders whatever the session actually offers. Passing a list means exactly that list: crypto joins automatically only when you pass no `paymentMethods` at all — a list without `'crypto'` (and no `cryptoAssets`) never shows crypto.

| Value | Method |
|-------|--------|
| `'bank'` | [Bank transfer](/payment-methods/bank-transfer) via a virtual account |
| `'payid'` | [ZevPay ID](/payment-methods/zevpay-id), paid from the ZevPay app |
| `'card'` | [Card](/payment-methods/card). Not yet live. Hidden while it is disabled. |
| `'palmpay'` | [PalmPay](/payment-methods/palmpay). Approval opens in a new tab; the modal confirms automatically. |
| `'crypto'` | [Crypto](/payment-methods/crypto). Joins automatically only when `paymentMethods` is omitted; in an explicit list it must be named (or pass `cryptoAssets`). List it alone for a crypto-only modal. |

::: info Auto-selection
When exactly one method is enabled and it is not `payid`, the SDK selects it and skips the picker screen.
:::

### Metadata

Attach custom data to the transaction. It is returned in webhooks and on the verify endpoint:

```js
checkout.checkout({
  // ...
  metadata: {
    orderId: 'order_12345',
    customerId: 'cust_789',
  },
});
```

## Callbacks

### onSuccess(reference)

Fires when the payment is confirmed. `reference` is our transaction reference.

```js
onSuccess: function (reference) {
  // Verify on your server before fulfilling.
  fetch('/api/verify-payment', {
    method: 'POST',
    body: JSON.stringify({ reference }),
  });
}
```

::: warning Always verify on your server
A client callback is not proof of payment. Confirm the payment from your server using the [Verify Session](/api/verify-session) endpoint before you fulfil an order.
:::

### onError(error)

Fires on a validation, network, or API error. Read `error.code` for programmatic handling.

```js
onError: function (error) {
  console.error(error.code, error.message);
}
```

Common error codes: `MISSING_FIELD`, `INVALID_INPUT`, `INVALID_CREDENTIALS`, `FORBIDDEN`, `EXPIRED_SESSION`, `SERVICE_UNAVAILABLE`, `TOO_MANY_REQUESTS`.

### onFailure(error), onExpired(), onClose(), onInitialize()

`onFailure` fires when a payment fails after a method was selected. `onExpired` fires when the session times out. `onClose` fires when the customer dismisses the modal. `onInitialize` fires once the modal is ready.

## Validation

The SDK checks these before it makes any API call:

| Rule | Error code |
|------|------------|
| `apiKey` is required | `MISSING_FIELD` |
| `amount` is required | `MISSING_FIELD` |
| `email` is required | `MISSING_FIELD` |
| `currency`, if set, must be `"NGN"` | `INVALID_INPUT` |
| `amount` must be at least 10000 kobo (₦100) | `INVALID_INPUT` |

::: tip Card has a higher minimum
The card method is hidden in the picker when the amount is below ₦1,000, even where other methods are shown.
:::

## How it works

1. The customer clicks your pay button.
2. The SDK creates a checkout session with your public key. No server step is needed.
3. The modal renders the available payment methods.
4. The customer selects a method and sees the payment details, such as a bank account number.
5. The customer completes the transfer.
6. The SDK polls for confirmation every 5 seconds.
7. On confirmation, `onSuccess` fires with the transaction reference.
8. The modal closes shortly after.

## Domain whitelisting

The SDK sends your public key from the browser. To stop other sites from using your key, set allowed domains on the key in the [dashboard](https://dashboard.zevpaycheckout.com).

- Exact match: `mystore.com` allows only `mystore.com`.
- Wildcard: `*.mystore.com` allows `shop.mystore.com`, `mystore.com`, and other subdomains.

See [Domain Whitelisting](/guide/authentication#domain-whitelisting) for the full rules.

::: tip Production
Always set allowed domains on your live public keys.
:::

## Related

- [Standard Checkout](/checkout/standard), the hosted redirect alternative
- [Payment Methods](/payment-methods/overview)
- [Verify Session](/api/verify-session)
- [React SDK](/sdks/react), a component wrapper around this SDK
- [Webhook Events](/webhooks/events)

---

## Source: https://docs.zevpaycheckout.com/checkout/invoice-instalments
<!-- file: checkout/invoice-instalments.md -->

---
title: Instalment invoices
---

# Instalment invoices

Some things are not paid for in one go. A ₦1.8m kitchen fit-out, a term's school fees, a six-week retainer, a wedding booked nine months out. The deal is agreed once and the money arrives in pieces, on terms the two parties settled between themselves.

Most gateways make you rebuild that yourself: your own schedule table, your own balance arithmetic, a fresh payment link every time, and a reconciliation job to work out which transfer belonged to which customer. ZevPay invoices carry the terms, so the invoice itself knows what is owed, what has been paid, and what the customer is allowed to pay next.

This page is the long version. If you only want the field reference, see the [Invoice API](/api/invoice).

## The shape of it

One invoice. Many payments. Each payment is a real transaction that settles on its own, exactly like a standalone checkout, so nothing about your payout reconciliation changes.

```
Invoice INV-2026-0041          ₦1,800,000
├── Payment 1   ₦600,000   paid 3 Mar   settled 4 Mar
├── Payment 2   ₦600,000   paid 2 Apr   settled 3 Apr
└── Payment 3   ₦600,000   paid 1 May   settled 2 May
```

The customer opens the same link every time. They see what they have already paid, choose what to pay now, and pay it. You get a webhook per payment and a settlement per payment.

## A worked example

A furniture maker takes a ₦1.8m commission. The terms are a third up front, and the customer can pay the rest however they like until delivery.

### 1. Create the invoice with the terms on it

```bash
curl -X POST https://api.zevpaycheckout.com/v1/checkout/invoice \
  -H "x-api-key: sk_live_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_name": "Adaeze Nwosu",
    "customer_email": "adaeze@example.com",
    "due_date": "2026-06-30T00:00:00Z",
    "line_items": [
      { "description": "Walnut dining set, 8 seater", "quantity": 1, "unit_price": 180000000 }
    ],
    "allow_partial_payments": true,
    "minimum_initial_payment": 60000000,
    "subsequent_payment_rule": "flexible",
    "due_date_action": "keep_collecting"
  }'
```

Amounts are in kobo throughout, so `180000000` is ₦1,800,000 and `60000000` is ₦600,000.

Those four fields are the whole policy:

| Field | What it does |
|-------|--------------|
| `allow_partial_payments` | Turns instalments on. Without it the invoice is pay-in-full. |
| `minimum_initial_payment` | The deposit. The first payment must be at least this. They may pay more. |
| `subsequent_payment_rule` | `flexible` lets them pay any amount afterwards. `full_balance` means the rest must come in one payment. |
| `due_date_action` | What happens when the due date passes. Defaults to `keep_collecting`. |

### 2. Send it

```bash
curl -X POST https://api.zevpaycheckout.com/v1/checkout/invoice/{public_id}/send \
  -H "x-api-key: sk_live_your_secret_key"
```

The customer gets an email with a link to the invoice page.

### 3. The customer pays what they agreed

On an instalment invoice the page asks how much they want to pay before it offers payment methods. It is pre-filled with the full balance, because most people pay it all, and it states the rule before they type rather than rejecting them after.

If they try to pay ₦400,000 against a ₦600,000 deposit, the page tells them the first payment must be at least ₦600,000. The server enforces the same rule, so editing the request achieves nothing.

### 4. You get a webhook per payment

```json
{
  "event": "invoice.payment_received",
  "data": {
    "invoice_public_id": "inv_8Kd93mQx2Lp",
    "invoice_number": "INV-2026-0041",
    "payment_id": "ipy_4Rm72nBw9Tc",
    "amount": 60000000,
    "amount_paid": 60000000,
    "amount_outstanding": 120000000,
    "is_partial": true,
    "is_fully_paid": false,
    "reference": "ZVP-CKOTX-9f2a1c",
    "paid_at": "2026-03-03T11:24:08.000Z"
  }
}
```

Fulfil on `is_fully_paid`, not on the event arriving. On an instalment invoice `invoice.payment_received` fires every time, and the first one is not the last one.

### 5. Reconcile

Each instalment is its own settled transaction. To see them:

```bash
curl https://api.zevpaycheckout.com/v1/checkout/invoice/{public_id}/payments \
  -H "x-api-key: sk_live_your_secret_key"
```

```json
{
  "invoice": {
    "public_id": "inv_8Kd93mQx2Lp",
    "status": "partial",
    "total": 180000000,
    "amount_paid": 120000000,
    "amount_outstanding": 60000000,
    "collecting": true
  },
  "payments": [
    {
      "payment_id": "ipy_7Bn21kFd5Qa",
      "amount": 60000000,
      "paid_at": "2026-04-02T09:15:44.000Z",
      "payer_name": "ADAEZE NWOSU",
      "payment_method": "bank_transfer",
      "transaction": {
        "reference": "ZVP-CKOTX-3d81be",
        "gross_amount": 60000000,
        "fees": 200000,
        "net_amount": 59800000,
        "settlement_state": "paid_out",
        "settled_at": "2026-04-03T12:00:00.000Z"
      }
    }
  ]
}
```

Every payment carries its own reference, fee, net and settlement state. Verify a single one with `GET /v1/checkout/invoice/{public_id}/payments/{payment_id}`.

## Choosing your terms

### A deposit, then the balance in one go

The common shape for work with a delivery date. A third up front, the rest before it ships.

```json
{
  "allow_partial_payments": true,
  "minimum_initial_payment": 60000000,
  "subsequent_payment_rule": "full_balance"
}
```

After the deposit the page stops offering a choice and asks for the balance.

### Pay it down however you like

School fees, a retainer, anything where you care that it clears, not how.

```json
{
  "allow_partial_payments": true,
  "subsequent_payment_rule": "flexible"
}
```

No minimum, any amount, as many payments as it takes.

### A floor on every payment

There is deliberately no per-payment minimum beyond the first. If you need one, set `minimum_initial_payment` and `full_balance`, which gives you exactly two payments of known size. Chasing twelve ₦5,000 payments costs more in reconciliation than it collects.

## Changing your mind

Terms are not frozen at creation. A customer asking to pay in instalments halfway through is a normal conversation, and re-issuing the invoice would lose its history and its link.

This works on invoices you have already sent, and on part-paid ones. What stays fixed after sending is the money itself: line items, tax and the customer. Everything about *how* it gets paid, including the due date, remains yours to change.

### Relaxing or tightening the balance rule mid-invoice

The most common version of this: you asked for the balance in one payment, the customer comes back and says they cannot manage it, and you agree to let them pay it down.

```bash
curl -X PATCH https://api.zevpaycheckout.com/v1/checkout/invoice/{public_id} \
  -H "x-api-key: sk_live_your_secret_key" \
  -d '{ "subsequent_payment_rule": "flexible" }'
```

It takes effect on their next payment. On a ₦1.8m invoice with ₦600,000 already paid:

| Rule | What the customer may pay next |
|------|--------------------------------|
| `full_balance` | Exactly ₦1,200,000 |
| `flexible` | Any amount up to ₦1,200,000 |

The reverse works too. Tighten a flexible invoice to `full_balance` and the next payment must clear whatever is outstanding at that moment, not the original balance.

Two things hold either way. The ceiling is always the outstanding balance, so no rule lets a customer overpay. And `minimum_initial_payment` cannot be changed once the first payment has landed, because a deposit rule cannot apply retroactively to money already taken.

If the invoice was created with `allow_partial_payments: false`, send both fields to open it up:

```bash
-d '{ "allow_partial_payments": true, "subsequent_payment_rule": "flexible" }'
```

Every one of these changes lands on the activity log with the fields that moved, so what was agreed and when survives the conversation.

```bash
curl -X PATCH https://api.zevpaycheckout.com/v1/checkout/invoice/{public_id} \
  -H "x-api-key: sk_live_your_secret_key" \
  -d '{ "subsequent_payment_rule": "flexible" }'
```

Every change is recorded on the invoice's activity log with the fields that changed, so the record of what was agreed and when survives the conversation.

## Extending a due date

```bash
curl -X PATCH https://api.zevpaycheckout.com/v1/checkout/invoice/{public_id} \
  -H "x-api-key: sk_live_your_secret_key" \
  -d '{ "due_date": "2026-07-31T00:00:00Z" }'
```

An invoice that had already gone overdue returns to `sent`, or `partial` if part of it is paid, the moment the new date is in the future. Your customer stops seeing a past-due invoice straight away.

The old and new dates are recorded on the activity log, so the record of when the terms moved survives the conversation that moved them.

## Chasing payment

```bash
curl -X POST https://api.zevpaycheckout.com/v1/checkout/invoice/{public_id}/remind \
  -H "x-api-key: sk_live_your_secret_key"
```

Re-sends the invoice email. On a part-paid invoice the reminder chases the outstanding balance, not the original total, so it never reads as a demand for money already paid.

Rate limited to one reminder an hour per invoice. This endpoint points at your customer's inbox, and a loop in your automation is a loop in their mailbox.

## Stopping collection

Two different things, for two different situations.

**Pause** when you want to stop taking money but keep the invoice alive. A dispute, a delivery problem, a customer who asked you to hold. The invoice keeps its status and its history, the customer can still open the page and see everything they have paid, and you can resume without re-issuing anything.

```bash
curl -X POST https://api.zevpaycheckout.com/v1/checkout/invoice/{public_id}/pause \
  -H "x-api-key: sk_live_your_secret_key" \
  -d '{ "reason": "On hold while we agree the revised spec" }'
```

The reason is shown to the customer. Resume with `POST /{public_id}/resume`.

**Cancel** when the deal is off. The invoice closes and stops collecting for good. Payments already made stay visible to the customer on the same link, because money they sent you does not disappear when your paperwork does.

```bash
curl -X POST https://api.zevpaycheckout.com/v1/checkout/invoice/{public_id}/cancel \
  -H "x-api-key: sk_live_your_secret_key"
```

Cancelling a part-paid invoice does not refund anything. If you owe the customer money back, refund the specific payment.

## What happens at the due date

By default, nothing stops. The invoice moves to `overdue` and keeps accepting payment, because an overdue invoice is one you still want paid. Closing it would refuse a customer paying a day late, and on an instalment invoice it would strand someone who has already paid a deposit with no way to finish.

If you need a hard stop, say so per invoice:

| `due_date_action` | At the due date |
|-------------------|-----------------|
| `keep_collecting` | Default. Status goes `overdue`, payment still accepted. |
| `pause` | Collection stops. The invoice and its history stay visible. Resume any time. |
| `cancel` | The invoice closes. |

Use `pause` for a price that expires, `cancel` for an event that has passed, and the default for everything else.

## The activity log

Every invoice keeps an append-only record of what was done to it.

```bash
curl https://api.zevpaycheckout.com/v1/checkout/invoice/{public_id}/events \
  -H "x-api-key: sk_live_your_secret_key"
```

```json
{
  "events": [
    {
      "type": "payment_received",
      "title": "Part payment received",
      "description": "600000.00 received from ADAEZE NWOSU. 1200000.00 still outstanding.",
      "actor": "customer",
      "created_at": "2026-03-03T11:24:08.000Z"
    },
    {
      "type": "policy_changed",
      "title": "Payment terms changed",
      "description": "Changed: subsequentPaymentRule",
      "actor": "api",
      "created_at": "2026-03-01T16:02:11.000Z"
    },
    {
      "type": "sent",
      "title": "Invoice sent to customer",
      "description": "Emailed to adaeze@example.com.",
      "actor": "api",
      "created_at": "2026-03-01T15:58:03.000Z"
    }
  ]
}
```

`actor` answers the question that matters when something is disputed: `api` means your integration did it, `dashboard` means a person clicked it, `system` means we did (a due date passing), and `customer` means the payer.

The same log renders on the invoice detail page in your dashboard.

## Webhooks to handle

| Event | When |
|-------|------|
| `invoice.payment_received` | Every payment. Check `is_fully_paid` before fulfilling. |
| `invoice.paid` | The balance reached zero. |
| `invoice.overdue` | The due date passed. |
| `invoice.paused` / `invoice.resumed` | Collection stopped or restarted. |
| `invoice.reminder_sent` | A reminder went out. |
| `invoice.cancelled` | The invoice was closed. |

## Things worth knowing

**Overpayment is refused, not banked.** The most a customer can pay is the outstanding balance. Letting someone overpay an invoice creates a refund, not a sale.

**The amount is locked once chosen.** When a customer says they are paying ₦600,000, the account they are given accepts ₦600,000. They cannot underpay the instalment they just picked, which is the whole point of asking.

**Each payment settles separately.** Same T+1 cycle, same fee structure, same settlement destination as any other payment on that API key. An instalment invoice does not settle as a lump when it completes.

**Partial payments and ZevPay ID.** ZevPay ID is customer-initiated and cannot enforce an amount, so it is hidden on invoices that require an exact payment.

---

## Source: https://docs.zevpaycheckout.com/checkout/invoice
<!-- file: checkout/invoice.md -->

---
title: Invoice Checkout
description: Create programmable invoices with line items, tax, and due dates. Share a hosted, tokenised payment link that supports partial payments and doubles as a receipt.
---

# Invoice Checkout

Create an invoice on your server, share the returned payment link, and let us host the payment page. Invoices add line items, tax, due dates, and optional partial payments on top of the standard checkout. The payment page becomes a receipt once the invoice is paid.

For a single one-off payment without line items, use [Standard Checkout](/checkout/standard) instead.

## How it works

1. **Create** an invoice with customer details, line items, and a due date.
2. **Send** it to move it from draft to active.
3. **Share** the `payment_url` with your customer by email, SMS, or in your app.
4. The customer opens the link and pays with any of the invoice's payment methods: [bank transfer](/payment-methods/bank-transfer), [ZevPay ID](/payment-methods/zevpay-id), or [crypto](/payment-methods/crypto) when your key qualifies. You control the set per invoice, see [Choosing payment methods](#choosing-payment-methods).
5. The status updates automatically. Partial payments are supported.
6. Your server receives a webhook for each status change.

Invoices are created with your secret key, so this is a server-side flow.

## Create an invoice

```bash
curl -X POST https://api.zevpaycheckout.com/v1/checkout/invoice \
  -H "Content-Type: application/json" \
  -H "x-api-key: sk_test_your_secret_key" \
  -d '{
    "customer_name": "Chidi Okonkwo",
    "customer_email": "chidi@example.com",
    "line_items": [
      { "description": "Website Development", "quantity": 1, "unit_price": 35000000 },
      { "description": "Monthly Hosting (12 months)", "quantity": 12, "unit_price": 500000 }
    ],
    "tax_rate": 7.5,
    "due_date": "2026-03-31T00:00:00Z",
    "note": "Thank you for your business."
  }'
```

The response includes a `payment_url` that you share with your customer. It carries an access token, so treat it as the private pay link for that customer.

```json
{
  "public_id": "abc123def456ghi78",
  "invoice_number": "INV-202603-001",
  "status": "draft",
  "total": 44075000,
  "payment_url": "https://secure.zevpaycheckout.com/pay/abc123def456ghi78?token=..."
}
```

::: tip Amounts are in kobo
Every monetary field in the API is in kobo. 100 kobo is 1 Naira, so `35000000` kobo is ₦350,000.00.
:::

See the full [Invoice API reference](/api/invoice).

## Tax

There are two ways to add tax. Use one or the other, never both in the same request.

### Percentage rate

Pass `tax_rate` as a percentage from `0` to `100` and we compute the tax:

```json
{ "tax_rate": 7.5 }
```

`tax_amount` is derived as `subtotal * rate`, and `total = subtotal + tax_amount`.

### Exact amount

If your own system computes the tax and you need the total to land on an exact figure, pass `tax_amount` in kobo:

```json
{ "tax_amount": 117054 }
```

We use it verbatim: `total = subtotal + tax_amount`, to the kobo. The invoice page and customer emails show it as a dedicated Tax line, separate from your line items.

::: warning One or the other
Sending both `tax_rate` and `tax_amount` in the same request returns a `400` error. Requests with neither are untaxed.
:::


## Choosing payment methods

By default an invoice offers the methods configured on your API key, plus crypto when the key qualifies. Set `payment_methods` and `crypto_assets` on the invoice to override that for this invoice only; they follow the same rules as [initialize](/payment-methods/overview#how-availability-is-decided):

```json
{
  "payment_methods": ["bank_transfer", "crypto"],
  "crypto_assets": ["USDT:TRON"]
}
```

- Omit both for your key's configuration.
- `["crypto"]` alone gives a crypto-only invoice.
- `crypto_assets` only narrows assets your key already accepts.
- Both can be changed with an update while the invoice is still a draft, and are returned on every invoice response.

The hosted invoice page renders exactly what the resulting session offers, so the customer never sees a method that cannot complete.

## Partial payments

By default, an invoice accepts partial payments. The customer can pay any amount up to the remaining balance and return later to pay the rest. Each partial payment fires its own `invoice.payment_received` webhook with `is_partial` and `is_fully_paid` flags.

To require the full balance in one payment, set `allow_partial_payments: false`:

```bash
curl -X POST https://api.zevpaycheckout.com/v1/checkout/invoice \
  -H "x-api-key: sk_test_your_secret_key" \
  -d '{
    "customer_name": "Chidi Okonkwo",
    "customer_email": "chidi@example.com",
    "due_date": "2026-03-31T00:00:00Z",
    "line_items": [{ "description": "One-off service", "quantity": 1, "unit_price": 5000000 }],
    "allow_partial_payments": false
  }'
```

### What this changes

| Behaviour | `allow_partial_payments: true` (default) | `allow_partial_payments: false` |
|-----------|------------------------------------------|----------------------------------|
| Bank-transfer amount | Any amount up to the remaining balance | Locked to the exact remaining balance. Under and over payments are rejected at the bank. |
| ZevPay ID method | Available | Hidden. ZevPay ID is customer-initiated and cannot enforce an exact amount. |
| Status after a partial payment | Moves to `partial`. The customer can return via the same link to finish. | Cannot reach `partial`. Every successful payment is a full payment. |

### Instalments with terms

Partial payments on their own let a customer pay any amount, any number of times. If you need a deposit, a rule for what comes after, or a way to pause collection, invoices carry those terms directly.

See [Instalment invoices](/checkout/invoice-instalments) for the full walkthrough: `minimum_initial_payment`, `subsequent_payment_rule`, reminders, pause and resume, per-payment reconciliation and the activity log.

::: danger Always check `is_fully_paid`
Even with `allow_partial_payments: false`, check `is_fully_paid` on `invoice.payment_received` before you fulfil. It is a cheap safeguard against future changes such as an admin partial-crediting a customer for a service issue.
:::

## Payments made outside ZevPay

An invoice only ever records money that reached you through us. This is deliberate, and it shows up in the API in three ways:

- There is no endpoint to record an external payment against an invoice. Cash, a transfer straight into your own bank account, or credit your platform granted the customer cannot be posted onto an invoice.
- Amounts cannot be negative. Line items require `quantity` of at least 0.01 and `unit_price` of at least 0, `tax_amount` cannot be negative, and the invoice total must be greater than zero. A "discount" or "credit applied" line item with a negative price is rejected.
- The `partial` status only ever means partially paid through ZevPay. It is set by payments we processed, never by anything recorded from outside.

We hold this line because everything downstream depends on it. The payment page becomes a receipt when an invoice is paid, `invoice.paid` triggers your fulfilment, and your settlement reports reconcile against the invoice ledger. Each of those is only trustworthy if every naira on an invoice is money we actually moved and can stand behind. The moment an invoice could be marked paid by funds we never saw, the receipt, the webhook, and the reconciliation would all be claims we cannot verify.

If part of an invoice does get settled off ZevPay, the invoice is no longer the right tool for the rest. Collect the remainder with a checkout session instead, as described next.

## Collecting a balance settled outside ZevPay

Sometimes part of an invoice gets covered where we cannot see it. The customer pays some in cash, sends a transfer directly to your own account, or your platform applies credit to their balance. The invoice cannot represent that, but the same secret key also drives [Standard Checkout](/checkout/standard), and the two work well together:

1. **Cancel the invoice first.** `POST /v1/checkout/invoice/:public_id/cancel` works on `draft`, `sent`, `partial`, and `overdue` invoices. The payment link stops accepting payment and `invoice.cancelled` fires. Cancel before you issue anything new: while the old link is live, the customer could still pay the stale full amount through it.

2. **Create a standard checkout session for exactly the outstanding amount.** Same secret key, one call:

```bash
curl -X POST https://api.zevpaycheckout.com/v1/checkout/session/initialize \
  -H "x-api-key: sk_test_your_secret_key" \
  -d '{
    "amount": 250000,
    "email": "chidi@example.com",
    "reference": "INV-2026-0042-balance",
    "callback_url": "https://yourstore.com/billing",
    "line_items": [
      { "name": "Balance due, invoice INV-2026-0042", "quantity": 1, "amount": 250000 }
    ],
    "metadata": { "kind": "invoice_balance", "invoice_id": "abc123def456ghi78" }
  }'
```

   Name the line item so the customer recognises what they are paying, and carry your invoice id in `metadata` so the payment finds its way home.

3. **Reconcile on the webhook.** When the customer pays, `charge.success` delivers your `merchant_reference` and `metadata` back to you. Match it to the invoice in your own system and mark the balance settled there. Webhook delivery is signed and retried like every other event, so treat it, not the callback redirect, as the source of truth.

If the outstanding amount changes again before the customer pays, for example more credit is applied, initialize again with the same `reference` and the new amount. We expire the old session and issue a fresh link for the new amount, so a stale link can never collect an outdated balance. See [idempotency](/checkout/standard#idempotency) for the exact semantics.

This is the same pattern our own products use. ZevCloud bills its customers with the invoice integration while nothing is settled, and switches to a checkout session for the exact remainder the moment credit or an off-platform payment lands on one of its invoices.

## Post-payment return URL

Set a `return_url` on the invoice and the payment page shows a "Return to {your business}" button after payment and redirects there after 5 seconds.

```bash
curl -X POST https://api.zevpaycheckout.com/v1/checkout/invoice \
  -H "x-api-key: sk_test_your_secret_key" \
  -d '{
    "customer_name": "Chidi Okonkwo",
    "customer_email": "chidi@example.com",
    "due_date": "2026-03-31T00:00:00Z",
    "line_items": [{ "description": "Subscription", "quantity": 1, "unit_price": 1000000 }],
    "return_url": "https://yourstore.com/orders/12345/thank-you"
  }'
```

On return, we append two query parameters so you can match the payment without a database lookup:

```
https://yourstore.com/orders/12345/thank-you?status=success&invoice=abc123def456ghi78
```

| Parameter | Description |
|-----------|-------------|
| `status` | Currently always `success` on the post-payment redirect. Leaves room for future states. |
| `invoice` | The invoice's `public_id`. Use it to look up the full state via the [GET invoice endpoint](/api/invoice). |

::: tip Falls back to your checkout config
If you do not pass `return_url`, we fall back to the redirect URL in your checkout config (per key, with a merchant default). Set the default in your dashboard under Checkout, then Settings, and pass `return_url` per invoice only when you need to override it.
:::

## Invoice lifecycle

```
draft -> sent -> partial -> paid
  |        |        |
  +--------+--------+--> cancelled

sent or partial -> overdue (automatic, past due date)
```

| Status | Description |
|--------|-------------|
| `draft` | Created but not active. The payment link is not usable yet. |
| `sent` | Active and awaiting payment. |
| `partial` | The customer has made a partial payment. |
| `paid` | Fully paid. |
| `overdue` | Past the due date and not fully paid. Set automatically. |
| `cancelled` | Cancelled by you via the API or dashboard. |

### Send an invoice

A draft is not payable. Send it to make the payment link work:

```bash
curl -X POST https://api.zevpaycheckout.com/v1/checkout/invoice/abc123def456ghi78/send \
  -H "x-api-key: sk_test_your_secret_key"
```

This moves the invoice from `draft` to `sent` and sets `issued_at`.

### Overdue detection

Invoices past their `due_date` and not fully paid are marked `overdue` automatically. The check runs hourly. Overdue invoices can still be paid, and become `paid` when the balance is cleared.

### Update a draft

While an invoice is in `draft`, update any field with the PATCH endpoint. Send only the fields you want to change:

```bash
curl -X PATCH https://api.zevpaycheckout.com/v1/checkout/invoice/abc123def456ghi78 \
  -H "Content-Type: application/json" \
  -H "x-api-key: sk_test_your_secret_key" \
  -d '{ "note": "Updated scope and revised pricing." }'
```

::: warning Update rules
- Only draft invoices can be updated. Updating a sent, paid, or cancelled invoice returns a `400` error.
- If you send `line_items`, the whole list is replaced, not merged. Send the complete list every time.
- Totals are recalculated when `line_items`, `tax_rate`, or `tax_amount` change.
:::

## Payment flow

When the customer opens the `payment_url`:

1. The invoice details, total, and remaining balance are shown.
2. A checkout session is created for the remaining balance.
3. The customer picks a method and pays.
4. `amount_paid` is updated.
5. If the balance is not cleared, the status stays `partial` and the same link works again later.
6. When fully paid, the status becomes `paid` and the page becomes a receipt.

## Customer emails

We email the invoice `customer_email` on three events:

| Event | When | Includes |
|-------|------|----------|
| Invoice sent | You call the send endpoint | Amount due, due date, and a Pay Now link. |
| Partial payment received | The customer paid less than the total | Amount paid, balance remaining, and a link to pay the rest. |
| Payment received in full | Payments reach the total | A receipt link. The same invoice URL serves as a permanent receipt. |

## Webhook events

| Event | When |
|-------|------|
| `invoice.created` | Invoice created via the API. |
| `invoice.sent` | Invoice sent (draft to sent). |
| `invoice.payment_received` | Payment received, partial or full. |
| `invoice.paid` | Invoice fully paid. |
| `invoice.overdue` | Invoice past its due date. |
| `invoice.cancelled` | Invoice cancelled. |

```js
app.post('/webhooks/zevpay', (req, res) => {
  res.status(200).send('OK'); // respond fast, process asynchronously

  const { event, data } = req.body;
  switch (event) {
    case 'invoice.paid':
      fulfillOrder(data.public_id, data.amount_paid);
      break;
    case 'invoice.payment_received':
      updatePaymentProgress(data.public_id, data.amount_paid, data.total);
      break;
    case 'invoice.overdue':
      sendPaymentReminder(data.customer_email, data.payment_url);
      break;
  }
});
```

Always verify the webhook signature. See [Verifying Signatures](/webhooks/signatures).

## Invoice compared to other options

| | Invoice | Standard | Inline |
|---|---------|----------|--------|
| Line items | Yes | Optional | No |
| Tax calculation | Built in | No | No |
| Partial payments | Yes | No | No |
| Expiry | Due date | 30 minutes | 30 minutes |
| Session created by | Your server, invoice API | Your server | The browser SDK |

## Related

- [Invoice API reference](/api/invoice)
- [Standard Checkout](/checkout/standard)
- [Payment Methods](/payment-methods/overview)
- [Webhook Events](/webhooks/events)

---

## Source: https://docs.zevpaycheckout.com/checkout/overview
<!-- file: checkout/overview.md -->

---
title: Checkout Options
description: Compare the three ways to collect payments with ZevPay Checkout - inline modal, standard hosted redirect, and programmable invoices. Pick the one that fits your stack.
---

# Checkout Options

ZevPay Checkout gives you three ways to collect a payment. They all settle to the same account, support the same payment methods, and emit the same webhooks. The difference is where the checkout runs and who creates the session.

Pick one based on how much of the flow you want to own.

## The three options

| Option | Where it runs | Who creates the session | API key | Best for |
|--------|---------------|-------------------------|---------|----------|
| [Inline Checkout](/checkout/inline) | A modal on your own page | The browser SDK, for you | Public (`pk_`) | Vanilla JS, jQuery, and single-page apps that want the customer to stay on the page |
| [Standard Checkout](/checkout/standard) | A page we host | Your server, before redirect | Secret (`sk_`) to create, then a redirect | Server-rendered stores, carts, and email or SMS payment links |
| [Invoice Checkout](/checkout/invoice) | A hosted, tokenised invoice page | Your server, via the invoice API | Secret (`sk_`) | Itemised billing, due dates, and partial payments |

## How to choose

**Choose Inline** if you want the customer to stay on your page and you would rather not run a server step. The SDK creates the session with your public key and renders a modal. You handle the result in JavaScript callbacks.

**Choose Standard** if you already have a backend and want us to host the payment page. Your server creates the session with your secret key, you redirect the customer to the returned URL, and they come back to your `callback_url` with the result.

**Choose Invoice** if you need line items, tax, a due date, or the option for a customer to pay in parts. You create the invoice on your server and share the returned `payment_url`. The customer pays on a hosted page that doubles as a receipt after payment.

## What they share

Regardless of the option you pick:

- **Amounts are in kobo.** 100 kobo is 1 Naira. An amount of `500000` is ₦5,000.00.
- **Payment methods** are bank transfer and ZevPay ID by default. See [Payment Methods](/payment-methods/overview) for how availability is decided.
- **Verification is server-side.** Never treat a client callback or redirect as proof of payment on its own. Confirm every payment from your server before you fulfil an order. See [Payment Lifecycle](/guide/payment-lifecycle).
- **Webhooks** notify your server of every status change. See [Webhook Events](/webhooks/events).

## Next steps

- [Inline Checkout](/checkout/inline)
- [Standard Checkout](/checkout/standard)
- [Invoice Checkout](/checkout/invoice)
- [Payment Methods](/payment-methods/overview)
- [Authentication](/guide/authentication)

---

## Source: https://docs.zevpaycheckout.com/checkout/standard
<!-- file: checkout/standard.md -->

---
title: Standard Checkout
description: Redirect customers to a hosted ZevPay checkout page. Create the session on your server with your secret key, redirect to the returned URL, then verify the result server-side.
---

# Standard Checkout

Create a checkout session on your server, redirect the customer to our hosted page, and handle the result when they return. This keeps your secret key on the server and lets us host the payment page.

If you want the checkout to appear as a modal on your own page, use [Inline Checkout](/checkout/inline).

## How it works

1. Your server creates a session with your secret key.
2. You redirect the customer to the returned `checkout_url`.
3. The customer selects a method and pays on our hosted page.
4. The customer is redirected to your `callback_url` with the status.
5. Your server verifies the payment before fulfilling the order.

## Step 1: Create a session

Call the initialize endpoint from your server with your secret key.

::: code-group

```js [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 in kobo
    currency: 'NGN',
    email: 'customer@example.com',
    customer_name: 'John Doe', // optional
    callback_url: 'https://yoursite.com/payment/callback',
    reference: 'order_12345', // optional
    metadata: { orderId: '12345' }, // optional
  }),
});

const { data } = await response.json();
// data.checkout_url  ->  https://secure.zevpaycheckout.com/{sessionId}
// data.session_id    ->  save this for verification
```

```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,
        "currency": "NGN",
        "email": "customer@example.com",
        "customer_name": "John Doe",
        "callback_url": "https://yoursite.com/payment/callback",
        "reference": "order_12345",
    },
)

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

```php [PHP]
$ch = curl_init('https://api.zevpaycheckout.com/v1/checkout/session/initialize');
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_HTTPHEADER => [
    'Content-Type: application/json',
    'x-api-key: sk_test_your_secret_key',
  ],
  CURLOPT_POSTFIELDS => json_encode([
    'amount' => 500000,
    'currency' => 'NGN',
    'email' => 'customer@example.com',
    'customer_name' => 'John Doe',
    'callback_url' => 'https://yoursite.com/payment/callback',
    'reference' => 'order_12345',
  ]),
  CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
$checkoutUrl = $response['data']['checkout_url'];
$sessionId = $response['data']['session_id'];
```

:::

The response returns the hosted page URL and the identifiers you need later.

Every response from our API is wrapped in a `{ "success": true, "data": {...} }` envelope. Read the fields off `data`, as the code samples above do.

```json
{
  "success": true,
  "data": {
    "session_id": "ecc48011-e36e-4741-9b99-657f4a1ee86e",
    "reference": "ZVP-CKO-S-abc123",
    "merchant_reference": "order_12345",
    "checkout_url": "https://secure.zevpaycheckout.com/ecc48011-e36e-4741-9b99-657f4a1ee86e",
    "amount": 500000,
    "currency": "NGN",
    "expires_at": "2026-01-01T12:30:00.000Z",
    "merchant_name": "Your Business Name",
    "enabled_payment_methods": ["bank_transfer", "payid"]
  }
}
```

Reusing a still-active session with the same `reference` and `amount` returns this exact same shape (including `checkout_url`), so you never have to special-case it. See [Idempotency](#idempotency).

## Step 2: Redirect the customer

Send the customer to `checkout_url`.

```js
window.location.href = data.checkout_url;
```

Or link to it directly:

```html
<a href="https://secure.zevpaycheckout.com/ecc48011-e36e-4741-9b99-657f4a1ee86e">
  Complete payment
</a>
```

## Step 3: Handle the callback

After the customer finishes or leaves, we redirect them to your `callback_url` with query parameters.

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

Your `callback_url` can carry its own query parameters. We append ours properly, so `https://yoursite.com/cb?order=123` comes back as `https://yoursite.com/cb?order=123&status=success&reference=...`.

| Parameter | Values | Description |
|-----------|--------|-------------|
| `status` | `success` | Payment completed. |
| `status` | `cancelled` | Customer cancelled or closed the page. |
| `status` | `expired` | Session expired before payment. |
| `reference` | string | Our transaction reference. Present on `success`. |
| `merchant_reference` | string | Your own `reference` from initialize, echoed back on every outcome (`success`, `cancelled`, `expired`) when you set one. Lets you map the return to your order without having stored our session reference. |

## Step 4: Verify the payment

::: warning Always verify
The callback query parameters are not proof of payment. Confirm every payment from your server before you fulfil an order.
:::

```js
app.get('/payment/callback', async (req, res) => {
  const { status } = req.query;

  if (status === 'success') {
    const verification = await fetch(
      `https://api.zevpaycheckout.com/v1/checkout/session/${sessionId}/verify`,
      { headers: { 'x-api-key': 'sk_test_your_secret_key' } },
    );

    const { data } = await verification.json();

    if (data.status === 'completed') {
      await fulfillOrder(data.reference, data.amount);
      return res.redirect('/order/success');
    }
    return res.redirect('/order/pending');
  }

  if (status === 'cancelled') return res.redirect('/checkout');
  if (status === 'expired') return res.redirect('/checkout?error=expired');
});
```

## Webhooks and terminal states

A successful payment fires a [`charge.success`](/webhooks/events#charge-success) webhook, which is the signal you should fulfil on. It is the only webhook a standard checkout session emits today.

There is no `session.expired` or `charge.failed` webhook. For non-success outcomes, either act on the callback `status` (`cancelled` / `expired`) or poll [verify](/api/verify-session) for the session's terminal state. A session that is never paid expires after 30 minutes; a subsequent verify returns `status: "expired"`.

## Initialize parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `amount` | integer | Yes | Amount in kobo. |
| `email` | string | Yes | Customer's email address. |
| `currency` | string | No | `"NGN"` (default) or `"USD"`. |
| `callback_url` | string | No | Where to redirect the customer after checkout. |
| `reference` | string | No | Your unique reference. Used for idempotency, see below. |
| `customer_name` | string | No | Shown in the dashboard instead of "Anonymous". |
| `metadata` | object | No | Custom data attached to the session. |
| `payment_methods` | string[] | No | Methods to offer, for example `["bank_transfer", "payid"]`. Defaults to the methods on your key. An explicit list is honoured exactly (crypto joins automatically only when this is omitted); include `"crypto"` to offer it, or `["crypto"]` alone for a crypto-only page. See [Payment Methods](/payment-methods/overview#how-availability-is-decided). |
| `crypto_assets` | string[] | No | Narrow the crypto assets offered, for example `["USDT:TRON"]`. |
| `line_items` | array | No | Optional line items, each `{ name, description?, quantity, amount }` with `amount` in kobo. Renders an itemised summary on the page. |

::: tip Authentication
Both key types can call initialize. Use your secret key from a server, which is the pattern shown here. A public key also works, in which case its allowed domains are enforced against the request origin. Never put a secret key in client-side code.
:::

## Idempotency

The `reference` you pass makes initialize safe to retry, and it is amount-aware:

- Same `reference`, same `amount`, while a session is still active: we return the existing session rather than creating a second one. A network retry can never produce two live payment links.
- Same `reference`, different `amount`: the charge has changed, so we expire the old session and create a fresh one for the new amount. The old link stops working immediately, which means a customer holding it can never pay an outdated amount.

Use a stable `reference` per order or per balance you are collecting. If what the customer owes changes, just initialize again with the same `reference` and the new amount and share the fresh link.

## Session lifetime

A checkout session is valid for 30 minutes. After that the hosted page shows an expired state with a link back to your site, and the callback status is `expired`.

## Compared to Inline Checkout

| Aspect | Standard | Inline |
|--------|----------|--------|
| Session creation | Server-side, secret key | Browser, public key |
| Experience | Full-page redirect | Modal on your page |
| Server required | Yes | No |
| Result delivery | Callback URL | JavaScript callback |
| Best for | Server-rendered stores, payment links | Vanilla JS and single-page apps |

## Related

- [Inline Checkout](/checkout/inline)
- [Invoice Checkout](/checkout/invoice)
- [Initialize Session](/api/initialize-session)
- [Verify Session](/api/verify-session)
- [Webhook Events](/webhooks/events)

---

## Source: https://docs.zevpaycheckout.com/guide/authentication
<!-- file: guide/authentication.md -->

# Authentication

All API requests must include an API key. We use a **key pair** model: each pair consists of a secret key and a public key.

## API key types

| Key Type | Prefix | Use on | Purpose |
|----------|--------|--------|---------|
| **Secret key** | `sk_live_` or `sk_test_` | Server only | Full access: initialize sessions, verify payments, manage resources |
| **Public key** | `pk_live_` or `pk_test_` | Client (browser) | Initialize sessions (inline checkout), load checkout UI, select payment methods |

::: danger Never expose your secret key
Secret keys grant full access to your account. Never include them in frontend code, public repositories, or client-side bundles.
:::

### What each key can do

| Endpoint | Secret key | Public key |
|----------|-----------|-----------|
| Initialize session | Yes | Yes (with origin validation) |
| Select payment method | Yes | Yes (with origin validation) |
| Get session | Yes | Yes (with origin validation) |
| Verify session | Yes | Yes |
| All other endpoints | Yes | No |

Public keys can initialize checkout sessions directly from the browser. This is how [Inline Checkout](/checkout/inline) works without requiring a backend. When `allowedDomains` is configured on the API key, the request's `Origin` header is validated against the whitelist.

## Sending your API key

Include the key in the `x-api-key` header:

```bash
curl https://api.zevpaycheckout.com/v1/checkout/session/initialize \
  -H "x-api-key: sk_test_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{"amount": 100000, "email": "test@example.com"}'
```

Alternatively, use the `Authorization` header with a `Bearer` prefix:

```bash
Authorization: Bearer sk_test_your_secret_key
```

## API key permissions

Each API key has a **permissions** array that controls which product APIs it can access. Permissions are managed from the [dashboard](https://dashboard.zevpaycheckout.com).

### Available permissions

| Permission | Products | Account type | Description |
|------------|----------|-------------|-------------|
| `checkout` | Checkout Sessions | All | Initialize and manage checkout payment sessions |
| `invoices` | Invoices | Business only | Create and manage programmable invoices |
| `virtual_payid` | Static PayID, Dynamic PayID | All | Create and manage virtual PayIDs |
| `virtual_account` | Virtual Accounts | All | Create temporary bank accounts for collecting payments |
| `transfers` | Transfers | Business only | Programmatically send money from a wallet |

::: info Legacy keys
API keys created before the permissions system was introduced have an empty permissions array. These keys retain access to all non-transfer products automatically. Only the `transfers` permission must be explicitly granted.
:::

### Permissions and account types

Some products are only available to business accounts:

| Product | Personal account | Business account |
|---------|-----------------|------------------|
| Checkout Sessions | Yes | Yes |
| Virtual PayID | Yes | Yes |
| Virtual Accounts | Yes | Yes |
| Invoices | No | Yes |
| Transfers | No | Yes |

### How permissions are assigned

- **Checkout, invoices, virtual_payid, virtual_account**: Configured when creating or editing an API key in the [dashboard](https://dashboard.zevpaycheckout.com)
- **Transfers**: Granted automatically when a [programmable-debit wallet](/guide/transfers#setup) is linked to the API key from the wallet settings

### Permission errors

If an API key lacks the required permission for an endpoint, the API returns:

```json
{
  "statusCode": 403,
  "message": "API key does not have 'transfers' permission.",
  "error": "Forbidden"
}
```

## Domain whitelisting

Public keys can be restricted to specific domains. When `allowedDomains` is configured on an API key, requests using the public key must include an `Origin` or `Referer` header matching one of the allowed domains.

Configure allowed domains in the **[dashboard](https://dashboard.zevpaycheckout.com/api-keys) > Developers > API Keys** section.

### Matching rules

| Pattern | Matches | Example |
|---------|---------|---------|
| `example.com` | Exact domain only | `https://example.com` |
| `*.example.com` | Any subdomain + the domain itself | `https://shop.example.com`, `https://example.com` |

### Example configuration

If you set `allowedDomains` to `["mystore.com", "*.mystore.com"]`:

```
✅ https://mystore.com           → allowed (exact match)
✅ https://shop.mystore.com      → allowed (wildcard match)
❌ https://evil-site.com         → rejected
❌ https://mystore.com.evil.com  → rejected
```

::: tip Recommendation
For production, always configure `allowedDomains` on your public keys to prevent unauthorized sites from using your API key.
:::

## Live vs test mode

| Mode | Key prefix | Real money? | Purpose |
|------|-----------|-------------|---------|
| **Test** | `sk_test_` / `pk_test_` | No | Development and testing. Payments are completed by the simulator |
| **Live** | `sk_live_` / `pk_live_` | Yes | Production payments |

The key decides the mode, and the two never mix: a test key cannot reach a live session, invoice or transaction, and the reverse. See [Test Mode](/guide/test-mode).

Both modes use the same API base URL:

```
https://api.zevpaycheckout.com
```

The mode is determined entirely by which key you use.

## Key management

- Create, rotate, and deactivate keys from the [dashboard](https://dashboard.zevpaycheckout.com)
- Each key pair shares a webhook secret for signature verification
- You can create multiple key pairs (e.g., one per environment or application)
- Configure permissions per key to follow the principle of least privilege

---

## Source: https://docs.zevpaycheckout.com/guide/checkout-sessions
<!-- file: guide/checkout-sessions.md -->

# Checkout Sessions

A checkout session represents a single payment attempt. It holds the amount, customer information, payment method details, and status.

## Session lifecycle

```
┌──────────┐    ┌────────┐    ┌───────────┐    ┌───────────┐
│ Created  │───▶│ Active │───▶│ Completed │    │  Expired  │
│ (init)   │    │        │    │           │    │           │
└──────────┘    └────┬───┘    └───────────┘    └───────────┘
                     │                              ▲
                     │         ┌────────┐           │
                     └────────▶│ Failed │           │
                     │         └────────┘           │
                     └──────────────────────────────┘
                              (30 min timeout)
```

### Status transitions

| Status | Description |
|--------|-------------|
| `active` | Session created, waiting for payment |
| `completed` | Payment received and confirmed |
| `failed` | Payment attempt failed |
| `expired` | No payment received within 30 minutes |

## Creating a session

```bash
POST /v1/checkout/session/initialize
```

This endpoint accepts both secret keys (server-side) and public keys (inline checkout from browser). See [Authentication](/guide/authentication) for details.

Key parameters:

- **`amount`** (required): Amount in kobo. Minimum: 100 (NGN 1.00)
- **`email`** (required): Customer's email address
- **`customer_name`** (optional): Customer's name, displayed in the dashboard instead of "Anonymous"
- **`reference`** (optional): Your unique order reference for reconciliation
- **`callback_url`** (optional): URL to redirect to after payment (standard checkout)
- **`payment_methods`** (optional): Methods to offer, e.g. `["bank_transfer", "payid"]`. May include `"crypto"`; `["crypto"]` alone makes the checkout crypto-only
- **`crypto_assets`** (optional): Narrow the crypto assets, e.g. `["USDT:TRON"]`
- **`metadata`** (optional): Custom key-value object stored with the session

## Payment method priority

Payment methods are resolved in this order:

1. **`payment_methods` parameter** in the initialize request
2. **API key configuration** set in the dashboard
3. **Default**: `["bank_transfer", "payid"]`

Crypto is appended automatically whenever your key has it enabled and the checkout qualifies, regardless of which list applied. Platform-disabled methods are removed unless your account is allow-listed. The response's `enabled_payment_methods` is the final word. Full rules: [Payment Methods](/payment-methods/overview#how-availability-is-decided).

## Session expiry

Sessions expire **30 minutes** after creation. Expired sessions cannot accept payments.

## Amount format

All amounts in the API are in **kobo** (minor currency units):

| Display | Kobo value |
|---------|-----------|
| NGN 1.00 | 100 |
| NGN 100.00 | 10,000 |
| NGN 5,000.00 | 500,000 |
| NGN 1,000,000.00 | 100,000,000 |

## Metadata

Store up to any custom data with the session. Metadata is returned in webhook payloads and verify responses.

```json
{
  "metadata": {
    "order_id": "ORD-4521",
    "plan": "premium",
    "customer_id": "cust_abc123"
  }
}
```

---

## Source: https://docs.zevpaycheckout.com/guide/currencies
<!-- file: guide/currencies.md -->

---
title: Currencies
description: Price a checkout in a currency other than naira, understand minor units per currency, and know what you get paid in.
---

# Currencies

ZevPay checkouts are priced in naira by default. You can price in other currencies where we have a way to collect them.

## Pricing in another currency

Pass `currency` when you create the session or invoice:

```json
{
  "amount": 150000,
  "currency": "KES",
  "customer": { "email": "customer@example.com" }
}
```

The response tells you what can actually be used to pay it, in `enabled_payment_methods`. A currency with no live rail returns a clear error rather than minting a checkout nobody can pay.

## Amounts are always in minor units

`amount` is an integer in the currency's smallest unit. This is the part that most often goes wrong, because the number of decimal places is not the same everywhere:

| Currency | Minor unit | `amount: 150000` means |
| --- | --- | --- |
| NGN | kobo (2 dp) | ₦1,500.00 |
| KES | cents (2 dp) | KSh 1,500.00 |
| GHS | pesewas (2 dp) | GH₵ 1,500.00 |
| XOF | none (0 dp) | CFA 150,000 |
| XAF | none (0 dp) | FCFA 150,000 |
| UGX | none (0 dp) | USh 150,000 |
| RWF | none (0 dp) | FRw 150,000 |

The West and Central African CFA francs, the Ugandan shilling and the Rwandan franc have **no minor unit at all**. For those, `amount` is the whole number of francs or shillings. Sending `150000` for XOF means 150,000 francs, not 1,500.

Every amount we send you follows the same rule, including webhook payloads and fees, so a single conversion in your code works in both directions.

## What you can collect, by currency

| Currency | How customers pay |
| --- | --- |
| NGN | Bank transfer, ZevPay ID, card, PalmPay |
| KES, GHS, UGX, TZS, RWF, ZMW, MWK, MZN, CDF, SLE, XOF, XAF | [Mobile money](/payment-methods/mobile-money) |
| USD | [Crypto](/payment-methods/crypto), and mobile money in some markets |

Markets open one at a time. A currency in this table is not necessarily live for your account yet; the initialize response is the authority, and support can tell you what is open.

## What you get paid in

You are paid in the currency you collected.

- **Naira** goes to your bank account or ZevPay balance, as it always has.
- **Mobile money currencies** go to a mobile money number you nominate per currency, under **Settlement → Mobile money** in your dashboard. See [getting paid](/payment-methods/mobile-money#getting-paid).

We do not convert your money between currencies without being asked. A shilling collection stays shillings all the way to your payout, so no exchange rate is applied behind your back.

## Fees

Fees are configured per currency, not converted from a naira rate. Your statement and your `charge.success` webhook both report the fee in the currency of the payment.

## Checking what is live

The initialize response is always the source of truth:

```json
{
  "currency": "KES",
  "enabled_payment_methods": ["mobile_money"]
}
```

If a currency is not open for your account, the call fails with a clear message rather than returning a checkout that cannot be paid.

---

## Source: https://docs.zevpaycheckout.com/guide/introduction
<!-- file: guide/introduction.md -->

# Introduction

ZevPay Checkout lets you accept payments from Nigerian customers via **bank transfer**, **ZevPay ID (P2P)**, and **cards** (coming soon).

## How it works

1. **You create a checkout session**: either from your server using a secret key, or directly from the browser using the inline SDK with a public key.
2. **The customer pays** through either the inline modal (embedded on your site) or the standard checkout page (hosted by us).
3. **We confirm the payment** automatically and send a webhook to your server.
4. **You verify the payment** by checking the webhook signature or calling the verify endpoint.

## Integration options

| Option | Best for | How it works |
|--------|----------|-------------|
| **Inline Checkout** | Seamless on-site experience, no backend required | Embed a JavaScript SDK that opens a payment modal on your page. Works with just a public key |
| **Standard Checkout** | Quick setup, hosted page | Initialize a session from your server, then redirect customers to a ZevPay-hosted checkout page |
| **API Only** | Full control | Use the REST API directly from your server to build a custom payment flow |

## Payment methods

| Method | Status | Settlement |
|--------|--------|-----------|
| Bank Transfer | Available | Instant |
| ZevPay ID (PayID) | Available | Instant |
| Card (Debit/Credit) | Coming soon | - |

## Base URL

All API requests are made to:

```
https://api.zevpaycheckout.com
```

For test mode, use the same base URL with test API keys (prefixed with `sk_test_` or `pk_test_`).

## Next steps

- [Quick Start](/guide/quick-start): Set up your first payment in 5 minutes
- [Use Cases](/guide/use-cases): Find the integration shape that fits what you are building
- [Authentication](/guide/authentication): Learn about API keys and security
- [API Reference](/api/overview): Full endpoint documentation

---

## Source: https://docs.zevpaycheckout.com/guide/payment-lifecycle
<!-- file: guide/payment-lifecycle.md -->

# Payment Lifecycle

This page describes the complete flow from session creation to payment confirmation.

## Flow overview

```
Your Server                    ZevPay API                  Customer
    │                              │                          │
    │  POST /initialize            │                          │
    │─────────────────────────────▶│                          │
    │  { session_id, checkout_url }│                          │
    │◀─────────────────────────────│                          │
    │                              │                          │
    │  Return checkout_url or      │                          │
    │  pass public key to SDK      │                          │
    │─────────────────────────────────────────────────────────▶│
    │                              │                          │
    │                              │  POST /payment-method    │
    │                              │◀─────────────────────────│
    │                              │  { account_number, ... } │
    │                              │─────────────────────────▶│
    │                              │                          │
    │                              │      Customer pays       │
    │                              │◀─────────────────────────│
    │                              │                          │
    │  Webhook: charge.success     │                          │
    │◀─────────────────────────────│                          │
    │                              │                          │
    │  GET /verify (optional)      │                          │
    │─────────────────────────────▶│                          │
    │  { status: "completed" }     │                          │
    │◀─────────────────────────────│                          │
```

## Step-by-step

### 1. Initialize session

Your server calls `POST /v1/checkout/session/initialize` with your **secret key**, the amount, and customer email.

### 2. Customer selects payment method

The checkout UI (inline modal or standard page) presents the available payment methods. When the customer selects one, the SDK calls `POST /v1/checkout/session/:id/payment-method`.

For **bank transfer**, this returns a virtual account number. For **PayID**, this returns a dynamic PayID.

### 3. Customer completes payment

The customer transfers money (via bank or ZevPay app). We detect the transfer automatically.

### 4. Payment confirmed

We:
- Mark the session as `completed`
- Send a `charge.success` webhook to your server
- The checkout UI detects the completion via polling and shows a success screen

### 5. You verify and fulfill

Your server verifies the payment via the webhook or the `/verify` endpoint, then fulfills the order.

## Polling

Both the inline and standard checkout SDKs poll the `/verify` endpoint every 5 seconds after the customer selects a payment method. When the status changes to `completed`, the success screen is shown automatically.

## Idempotency

- Each session can only be completed once
- Duplicate bank transfers to the same virtual account are rejected
- The `reference` parameter on initialization helps you prevent duplicate sessions

## Refunds

A payment can be returned to the payer while it is still **pending settlement**, meaning before it is picked up by a payout batch. Request it from the transaction page in your [dashboard](https://dashboard.zevpaycheckout.com): the Refund button is active only while the payment still qualifies.

What happens next:

1. The payment is immediately held out of your next settlement, so the money stops on its way to you.
2. ZevPay returns it to the payer, through the provider where that is supported and by transfer otherwise.
3. You receive [`charge.refunded`](/webhooks/events#charge-refunded) and the transaction shows as refunded.

If the request is declined, the payment goes back into your next settlement and nothing changes for you.

Bank transfer, card, PalmPay and [Static NGN Account](/guide/static-accounts) payments can be refunded this way. ZevPay ID and crypto payments are returned by support instead. Once a payment has been paid out to you, a refund is handled with support, not from the dashboard. Static NGN Account payments can also be refunded [through the API](/api/static-account#refunds).

## Error handling

| Scenario | What happens |
|----------|-------------|
| Session expires (30 min) | Status set to `expired`, customer shown expiry screen |
| Transfer amount mismatch | Transfer may not be matched to the session |
| Network error during polling | SDK retries silently on next poll interval |
| Webhook delivery fails | Logged in dashboard, you should poll `/verify` as backup |

---

## Source: https://docs.zevpaycheckout.com/guide/quick-start
<!-- file: guide/quick-start.md -->

# Quick Start

Accept your first payment in under 5 minutes.

## Prerequisites

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

## Step 1: Get your API keys

1. Log in to the [ZevPay Checkout dashboard](https://dashboard.zevpaycheckout.com)
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 Checkout](/checkout/inline) for the full configuration options
- [Webhook Setup](/webhooks/overview): Real-time payment notifications

---

## Source: https://docs.zevpaycheckout.com/guide/rate-limiting
<!-- file: guide/rate-limiting.md -->

# Rate Limiting

We enforce rate limits to ensure fair usage and protect the API from abuse. All REST API endpoints are subject to rate limiting.

## Limits

| Scope | Limit | Window |
|-------|-------|--------|
| **Global** (per API key) | 100 requests | 1 minute |
| **Session initialization** (`POST /v1/checkout/session/initialize`) | 30 requests | 1 minute |

Rate limits are applied per API key. Test and live keys have separate counters.

::: info
These limits are generous for normal usage. If your integration requires higher limits, contact us at support@zevpay.ng.
:::

## Rate limit response

When you exceed the rate limit, the API responds with HTTP `429 Too Many Requests`:

```json
{
  "success": false,
  "error": {
    "code": "HTTP_ERROR",
    "message": "ThrottlerException: Too Many Requests"
  },
  "correlationId": "-"
}
```

## Handling rate limits

Implement exponential backoff when you receive a `429` response:

::: code-group

```js [Node.js]
async function fetchWithRetry(url, options, maxRetries = 3) {
  for (let attempt = 0; attempt <= maxRetries; attempt++) {
    const response = await fetch(url, options);

    if (response.status !== 429) return response;

    // Exponential backoff: 1s, 2s, 4s
    const delay = Math.pow(2, attempt) * 1000;
    await new Promise(resolve => setTimeout(resolve, delay));
  }

  throw new Error('Rate limit exceeded after retries');
}
```

```python [Python]
import time
import requests

def fetch_with_retry(url, **kwargs):
    max_retries = 3
    for attempt in range(max_retries + 1):
        response = requests.request(**kwargs, url=url)

        if response.status_code != 429:
            return response

        # Exponential backoff: 1s, 2s, 4s
        delay = (2 ** attempt)
        time.sleep(delay)

    raise Exception("Rate limit exceeded after retries")
```

:::

## Best practices

- **Batch operations** where possible instead of making many individual requests
- **Cache responses** to avoid redundant API calls (e.g., cache bank list, verify results)
- **Spread requests** evenly over time rather than sending bursts
- **Use webhooks** instead of polling for payment status (see [Webhooks](/webhooks/overview))

## Request body size

All REST API endpoints enforce a **1 MB** maximum request body size. Requests exceeding this limit will be rejected with a `413 Payload Too Large` response.

This limit is more than sufficient for all API operations. If you're sending metadata with your requests, keep it concise.

---

## Source: https://docs.zevpaycheckout.com/guide/static-accounts
<!-- file: guide/static-accounts.md -->

---
title: Static NGN Accounts
description: Permanent Nigerian bank account numbers you issue to your customers. Every transfer is confirmed instantly by webhook and settles on the standard T+1 schedule.
---

# Static NGN Accounts

A Static NGN Account is a permanent bank account number that belongs to one of your customers (or to your business) for as long as you keep it. Customers can pay into it any number of times, from any Nigerian bank. Each transfer is booked the moment it lands, you get a `charge.success` webhook straight away, and the money settles to you on the standard T+1 schedule.

::: info Available on request
Static NGN Accounts are enabled for selected merchants on request. If you do not see **Static Accounts** in your dashboard, or the API returns `STATIC_ACCOUNT_NOT_ENABLED`, contact our business support team to request access.
:::

## Static vs. virtual accounts

| | [Virtual account](/guide/virtual-accounts) | Static NGN Account |
|---|---|---|
| Lifetime | Expires after a set validity window | Permanent until you pause or delete it |
| Account number | New number per request | One number per customer, reused forever |
| Amount | Optional expected amount and validation rule | Any amount, any number of times |
| Identity | None | BVN, NIN or CAC number of the account holder (verified) |
| Where it is offered | API, dashboard, and hosted/inline checkout | API and dashboard only |
| Settlement | T+1 | T+1 |

Static accounts are not a checkout payment method. They do not appear on hosted, inline or invoice checkouts, and they are not part of `payment_methods`. They are for server-side integrations and the dashboard: wallet top-ups, recurring customer funding, dedicated collection accounts per client.

## How it works

1. **Create** an account for a customer via the [API](/api/static-account) or the dashboard, supplying their name, a BVN, NIN or CAC number, and your own unique reference for the customer (so the same customer is never issued two numbers).
2. ZevPay **verifies** that the name matches the identity record, then issues the account number. You get back the number and the bank name to show the customer.
3. The customer **transfers** to that number from any bank, as often as they like.
4. Each transfer is **booked immediately**: it appears in your transactions with `channel: "static_account"`, and your webhook URL receives [`charge.success`](/webhooks/events#charge-success) within seconds.
5. The money **settles T+1** to the settlement destination configured on the API key that owns the account (bank account or ZevPay balance), like every other checkout payment.

The account holds no balance of its own. Everything that lands is owed to you and paid out on the settlement schedule.

## Identity requirements

Every account is tied to a verified identity. Pass one of:

| `identity_type` | `identity_number` | Who it is for |
|---|---|---|
| `bvn` | 11-digit Bank Verification Number | An individual |
| `nin` | 11-digit National Identification Number | An individual |
| `rc` | CAC registration number, prefixed `RC` or `BN` (e.g. `RC1234567`) | A registered business or business name |

The `customer_name` you send must match the name on that record. A mismatch is rejected with `IDENTITY_MISMATCH` and nothing is created. ZevPay never returns the registry record to you; the check is pass/fail only.

For compliance, the details you submit for every account (including rejected attempts) are retained by ZevPay.

## Settlement and the API key

An account belongs to the secret API key you created it with. That key decides two things for every transfer into the account:

- **Where the money settles**: the key's settlement destination (an external bank account or a ZevPay balance), read at the time each payment lands, so changing the key's settlement bank later applies to future payments.
- **Where the webhook goes**: the key's webhook URL and signing secret.

Pick the key deliberately when you create accounts. If you route different products through different keys, create each customer's account under the key for that product.

## Pausing, resuming and deleting

- **Pause** an account to stop accepting transfers temporarily; the bank rejects transfers while it is paused. Resume any time.
- **Delete** an account to retire the number permanently. It cannot be restored, and the number cannot be reused. Payment history is kept.

If ZevPay suspends an account (or your access to the product), transfers are rejected and the account shows as `suspended`. You cannot lift a suspension yourself; contact support.

## Refunds

You can ask for a payment to be returned to the payer as long as it has not yet been settled to you. The request removes the payment from your next settlement while ZevPay returns the money, and you receive `charge.refunded` when it is done. Once a payment has been paid out to you, a refund is handled with support instead. See the [API](/api/static-account#refunds).

## Reliability

Confirmation is webhook-driven from the bank, with a reconciliation sweep behind it that pulls any transfer the notification missed. A transfer that reaches the account number is always booked, even if the account was paused at the time; it is flagged so you can review it.

## Next steps

- [Static NGN Account API](/api/static-account)
- [`charge.success` payload for `channel: "static_account"`](/webhooks/events#static-ngn-account)

---

## Source: https://docs.zevpaycheckout.com/guide/test-mode
<!-- file: guide/test-mode.md -->

# Test Mode

Build and verify your whole integration without moving real money. Test mode uses the same endpoints, the same SDKs and the same webhooks as live. Payments are completed by a simulator instead of a bank.

## Test keys and live keys

| | Test | Live |
|---|---|---|
| Secret key | `sk_test_...` | `sk_live_...` |
| Public key | `pk_test_...` | `pk_live_...` |
| Payments | Simulated | Real |
| Settlement and payouts | Never | T+1 |
| Available before verification | Yes | No |

The key decides the mode. Everything a test key creates (sessions, transactions, invoices, webhook events) is test data, and stays test data: a test object can never be paid with real money, settled or paid out, and a live object can never be reached with a test key.

## Getting test keys

1. Sign in to the [Dashboard](https://dashboard.zevpaycheckout.com).
2. Turn on **Test mode** in the top bar.
3. Go to **Developers → API Keys** and choose **Create test key**. A test key needs only a name: no settlement account, no domain restrictions.

You can create test keys while your business verification is still in review. The dashboard opens in test mode until you are approved, so you can finish your integration while you wait.

## Simulating a payment

Test sessions offer **bank transfer**, which is what the simulator completes today. The customer sees an account at **ZevPay Test Bank**. Nothing can be sent to it; you complete the payment with the simulator instead, in whichever way suits your test:

- **On the checkout page, the inline modal or a test invoice's payment page**, the pay button reads **Simulate successful transfer**. Every screen of a test session or test invoice carries a **TEST MODE** ribbon.
- **From the dashboard**, open the transaction and choose **Simulate transfer**.
- **From your server**, call the API with your test secret key. The customer must have chosen bank transfer first.

```bash
curl -X POST https://api.zevpaycheckout.com/v1/checkout/session/{session_id}/simulate-payment \
  -H "Authorization: Bearer sk_test_..."
```

```json
{
  "success": true,
  "data": {
    "session_id": "4e466b30-d598-498d-8541-453a4017db7b",
    "reference": "ZVP-CKO-S-mvnyed41-0c0c4fc0a41e",
    "status": "completed",
    "amount": 250000,
    "fees": 3750,
    "currency": "NGN",
    "livemode": false
  }
}
```

A simulated payment behaves like a real one from your integration's point of view:

- your account's real fee schedule is applied, so amounts, fees and net match what you will see live;
- the session completes, so [verify](/api/verify-session) returns `completed`;
- `charge.success` is sent to your test key's webhook URL, signed with its webhook secret;
- an invoice payment is credited to the invoice.

Simulating twice is refused, the same way a session can only be paid once.

## Telling test from live in your code

Every response that describes a session, and every webhook, carries `livemode`:

```json
{
  "event": "charge.success",
  "livemode": false,
  "data": { "reference": "ZVP-CKO-S-abc123", "amount": 250000, "currency": "NGN", "status": "completed" }
}
```

`livemode` is set from the key that created the object, never from anything in the request. Use it to keep test orders out of your fulfilment: fulfil only when `livemode` is `true`.

Give each test key its own webhook URL (it is set per key, like on live keys), so test events reach your development endpoint and never your production one. Webhook URLs must be reachable from the internet: localhost and private network addresses are refused. To receive test webhooks on your machine, use a tunnel such as ngrok.

## What test keys cannot do

Test mode exists to exercise your integration, so anything that would touch real money or a real person is refused with the error code `TEST_MODE_BOUNDARY`:

| Action | In test mode |
|---|---|
| Card, ZevPay ID, PalmPay, mobile money, crypto | Not offered yet; sessions show only the methods the simulator can complete |
| Creating PayIDs (static or dynamic) | Refused: a PayID can be paid by a real ZevPay user |
| Static NGN accounts | Refused |
| Refunds | Refused: a test payment took no money in |
| Settlement destinations, transfer wallets, payouts | Not applicable to test keys |

Methods that are enabled per account, such as mobile money or crypto, appear in test mode only for accounts that have them enabled live. Test mode never widens what your account can use.

## The dashboard in test mode

With **Test mode** on, the dashboard shows test data only: transactions, customers, invoices, webhook logs and API keys. Totals never mix the two, so a test payment can never appear in your live revenue. Switch back with **Switch to live** in the banner or the top bar.

Test mode emails reach you, marked `[TEST]`. Nothing is sent to the customer addresses used in test sessions or invoices, since those are often real people's.

## Teammates who only need test mode

When you invite a teammate, you can give them **Test mode only** access. They can create and use test keys, simulate payments and read test webhooks, but they never see live payments, customers or settings, and cannot move money. This is enforced on our side for every request, not just hidden in the dashboard, so it is safe for a contractor building your integration.

## Errors you may see

| Code | Meaning |
|---|---|
| `TEST_MODE_BOUNDARY` | The action is not available in test mode, or a test key reached for a live object (or the reverse) |
| `TEST_ONLY_ACCESS` | Your teammate access is limited to test mode |

If your test keys stop working with *Test mode has been switched off for this account*, contact support.

## Going live

1. Turn off **Test mode** in the dashboard and create live keys with your settlement account.
2. Swap `sk_test_` / `pk_test_` for `sk_live_` / `pk_live_`. Nothing else in your code changes.
3. Set your production webhook URL on the live key.
4. Confirm your handler fulfils only when `livemode` is `true`, verifies signatures, and is idempotent on `reference`.

::: tip
Make your first live payment a small one and confirm it end to end, webhook included, before opening checkout to everyone.
:::

---

## Source: https://docs.zevpaycheckout.com/guide/transfers
<!-- file: guide/transfers.md -->

# Transfers

Programmable transfers let you send money from a ZevPay wallet to bank accounts or other ZevPay users via API. This is useful for payouts, vendor payments, refunds, and any scenario where you need to move funds programmatically.

## How It Works

Unlike checkout (which collects money *in*), transfers move money *out* of your wallet. Because of this, transfers have additional security layers:

1. **Wallet-level consent**: You must explicitly enable "Programmable Debit" on a wallet in your business dashboard
2. **API key permissions**: The API key must have the `transfers` permission
3. **Fixed source**: Each API key is linked to exactly one wallet. The transfer always debits from that wallet. You cannot override the source per request
4. **Secret key only**: All transfer endpoints require a secret key (`sk_*`)

::: warning Requires a full ZevPay business account
Transfers move money out of a ZevPay **wallet**, which checkout-only accounts do not have. If you onboarded through the [checkout dashboard](https://dashboard.zevpaycheckout.com) and were approved for Checkout, you will not be able to open the business dashboard until your account is upgraded. Request the upgrade from your account, or email business@zevpay.africa.
:::

## Setup

### Step 1: Enable Programmable Debit on a Wallet

In the ZevPay Business Dashboard:

1. Navigate to **Wallets** and select the wallet you want to use for transfers
2. Open **Settings** on the wallet detail page
3. Under the **Developer API** section, toggle **Programmable Debit** to enabled
4. Read and confirm the consent dialog

::: warning
Enabling programmable debit allows API keys to debit this wallet without PIN confirmation. Only enable this on wallets designated for API payouts. Disabling it later will immediately unlink all connected API keys.
:::

### Step 2: Add an API Key as a Wallet Member

Once programmable debit is enabled, you can add API keys to the wallet from the **Members** tab:

1. Go to the wallet detail page and open the **Members** tab
2. Click the **Add** dropdown and select **Add API Key**
3. Search for and select the API key you want to link
4. Confirm: the API key is added as a **member** by default

::: info
A wallet can have multiple API key members. Each API key can only be linked to one transfer wallet at a time. The `transfers` permission is automatically granted when linked.
:::

### Step 3: Configure the API Key's Role and Limits

After adding an API key, tap on it in the members list to configure its settings:

#### Role

| Role | Capabilities |
|------|-------------|
| **Admin** | Initiate transfers **and** manage the wallet via REST API (add/remove members, update settings). Only the wallet owner can promote an API key to admin. |
| **Member** | Initiate transfers only. Cannot perform wallet management operations. |

#### Spending Limits

Set per-key spending limits to control how much an API key can transfer:

| Limit | Description |
|-------|-------------|
| **Single transaction limit** | Maximum amount per individual transfer |
| **Daily limit** | Maximum total amount transferred in a rolling 24-hour window |
| **Monthly limit** | Maximum total amount transferred in a rolling 30-day window |

Amounts are in naira (not kobo). For example, setting a daily limit of `50000` means the API key cannot transfer more than ₦50,000 per day.

::: tip
Use spending limits to minimize risk. For example, a payout key that only needs to send small amounts should have a low single transaction limit. A batch payout key might have a higher daily limit but still benefit from a monthly cap.
:::

#### Balance Visibility

You can hide the wallet balance from an API key. When enabled, the API key cannot view the wallet's available balance via the [Get Wallet](/api/wallet#get-wallet) endpoint. Admin API keys always have balance visibility. This setting only applies to member-role keys.

### Step 4: Start Making Transfers

Your API key is now ready to initiate transfers. Use the [Transfer API](/api/transfer) endpoints.

If the API key has an **admin** role, it can also manage the wallet programmatically via the [Wallet Management API](/api/wallet).

## Bank Transfer Flow

The recommended flow for sending a bank transfer:

### 1. Get bank list

Fetch the list of supported banks to populate your UI or validate bank codes.

```javascript
const { data } = await fetch('/v1/checkout/transfer/banks', {
  headers: { 'Authorization': `Bearer ${secretKey}` },
}).then(r => r.json());

// data.banks = [{ bankCode: "044", bankName: "Access Bank" }, ...]
```

### 2. Resolve bank account

Verify the account number and get the account holder's name. Always show this to the user for confirmation before sending.

```javascript
const { data } = await fetch('/v1/checkout/transfer/banks/resolve', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${secretKey}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    account_number: '0123456789',
    bank_code: '058',
  }),
}).then(r => r.json());

// data.account_name = "JOHN DOE"
```

### 3. Check charges (optional)

Calculate fees before initiating so you know the total debit amount.

```javascript
const { data } = await fetch('/v1/checkout/transfer/charges', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${secretKey}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    amount: 500000,    // ₦5,000 in kobo
    bank_code: '058',
  }),
}).then(r => r.json());

// data = { amount: 500000, fee: 2625, vat: 197, stamp_duty: 0, total: 502822 }
```

### 4. Initiate transfer

```javascript
const { data } = await fetch('/v1/checkout/transfer', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${secretKey}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    type: 'bank_transfer',
    account_number: '0123456789',
    bank_code: '058',
    account_name: 'JOHN DOE',
    amount: 500000,
    narration: 'Vendor payment - March',
    reference: 'payout_vendor_001',
  }),
}).then(r => r.json());

// data.status = "completed" or "pending"
// data.reference = "ZVP-TRF-..."
```

### 5. Handle webhook

Listen for `transfer.success` or `transfer.failed` webhooks to confirm the outcome. See [Webhook Events](/webhooks/events#transfer-success).

## PayID Transfer Flow

PayID transfers are simpler: no bank resolution or fee calculation needed. PayID transfers are instant and free.

```javascript
const { data } = await fetch('/v1/checkout/transfer', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${secretKey}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    type: 'payid',
    pay_id: 'john',
    amount: 250000,    // ₦2,500 in kobo
    narration: 'Freelance payment',
  }),
}).then(r => r.json());

// PayID transfers complete instantly
// data.status = "completed"
```

## Handling Webhooks

Set up a webhook endpoint to receive transfer status updates:

```javascript
app.post('/webhooks/zevpay', (req, res) => {
  const { event, data } = req.body;

  switch (event) {
    case 'transfer.success':
      console.log(`Transfer ${data.reference} completed`);
      // Update your records
      markPayoutComplete(data.reference, data.amount);
      break;

    case 'transfer.failed':
      console.log(`Transfer ${data.reference} failed`);
      // Funds are returned to your wallet automatically
      markPayoutFailed(data.reference);
      // Consider retrying or notifying your team
      break;
  }

  res.status(200).send('OK');
});
```

::: info
When a bank transfer fails, the debited amount is automatically reversed back to your wallet. You do not need to handle the reversal manually.
:::

## Checking Balance

Monitor your wallet balance to ensure you have sufficient funds:

```javascript
const { data } = await fetch('/v1/checkout/transfer/balance', {
  headers: { 'Authorization': `Bearer ${secretKey}` },
}).then(r => r.json());

const balanceNaira = data.available_balance / 100;
console.log(`Available: ₦${balanceNaira.toLocaleString()}`);
```

## Revoking Access

### Disable programmable debit

Disabling programmable debit on a wallet (from **Settings → Developer API**) automatically:
- Removes **all** API key members from that wallet
- Revokes the `transfers` permission from those keys
- Takes effect immediately

### Remove a single API key

To revoke access for one API key without affecting others:

1. Go to the wallet's **Members** tab
2. Find the API key in the list and open its settings
3. Remove it from the wallet

Other API keys linked to the same wallet continue to work normally.

### Via the API

Admin API keys can also remove members programmatically using `DELETE /v1/checkout/wallet/members/:payId`. See [Wallet Management API](/api/wallet#remove-member).

## Best Practices

### Use idempotency references

Always provide a `reference` when initiating transfers. If your system retries a request (due to network issues), the API will return the existing transfer instead of creating a duplicate.

```javascript
// Good — idempotent
{ reference: "payout_vendor_001_march", amount: 500000, ... }

// Risky — no reference means retries could create duplicates
{ amount: 500000, ... }
```

### Store references

Save both your `reference` and our `reference` returned in the response. You'll need them for:
- Looking up transfers via the API
- Matching webhook events to your records
- Debugging with ZevPay support

### Verify before sending

Always call the [Resolve Bank Account](/api/transfer#resolve-bank-account) endpoint and show the account name to your user before initiating a bank transfer. This prevents sending money to the wrong account.

### Monitor balance

Check your wallet balance before initiating transfers to avoid insufficient balance errors. Consider setting up alerts when your balance drops below a threshold.

### Secure your keys

- Never expose secret keys in client-side code
- Configure IP whitelisting in your API key settings
- Use separate API keys for transfers and checkout
- Rotate keys periodically

## Wallet Management via API

API keys linked to a wallet with an **admin** role can manage the wallet programmatically: adding or removing members, updating member settings, and changing wallet settings.

### Permission Hierarchy

| Role | Can manage |
|------|-----------|
| **Owner** | Everyone (admins + members) |
| **Admin** | Members only (not other admins or the owner) |
| **Member** | No management access |

API keys are linked as either `admin` or `member`. Only admin API keys can use the wallet management endpoints.

### Available Operations

| Operation | Description |
|-----------|-------------|
| Get wallet details | View wallet info, balance, members, and settings |
| Update wallet settings | Change name, description, notifications, and privacy |
| List members | View all people and API key members |
| Add a member | Add a ZevPay user by their PayID |
| Remove a member | Remove a member (members only, not admins or owner) |
| Update member settings | Change spending limits, notifications, and balance visibility |

### Example: Add a Member

```javascript
const { data } = await fetch('/v1/checkout/wallet/members', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${secretKey}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    pay_id: '@jane.personal',
  }),
}).then(r => r.json());
```

### Example: Set Spending Limits on a Member

```javascript
await fetch('/v1/checkout/wallet/members/@jane.personal', {
  method: 'PATCH',
  headers: {
    'Authorization': `Bearer ${secretKey}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    has_daily_limit: true,
    daily_limit: 50000,       // ₦50,000
    has_single_limit: true,
    single_limit: 10000,      // ₦10,000
  }),
});
```

For full endpoint details, request/response schemas, and error codes, see the [Wallet Management API Reference](/api/wallet).

---

## Source: https://docs.zevpaycheckout.com/guide/use-cases
<!-- file: guide/use-cases.md -->

---
title: Use Cases
description: Practical recipes that map real business needs to the right ZevPay Checkout integration, with links into the detailed reference for each step.
---

# Use Cases

This page maps common business needs to a concrete integration path. Each recipe is short on purpose: it tells you which pieces to use and links straight to the reference for the details. If you are brand new, start with the [Quick Start](/guide/quick-start), then come back here to find the shape that fits what you are building.

A quick orientation on the three checkout styles, since most recipes pick one:

| Style | You host | We host | Best for |
|-------|----------|---------|----------|
| [Inline](/checkout/inline) | Your page + our SDK | The payment widget | Keeping customers on your site, no backend required |
| [Standard](/checkout/standard) | Nothing | The whole payment page | Fastest server-to-server integration |
| [Invoice](/checkout/invoice) | Nothing | A shareable, itemised payment link that becomes a receipt | Billing a specific customer for a specific amount |

Everything below settles the same way and reports back through the same [webhooks](/webhooks/events). You learn one settlement and reconciliation model once, then reuse it across every recipe.

## Accept a one-time payment on your site

**When:** a customer checks out an order and you want them to pay now.

1. On your server, call [initialize](/api/initialize-session) with the `amount` (in kobo), the customer `email`, a `callback_url`, and your own `reference`.
2. Redirect the customer to the returned `checkout_url` ([Standard Checkout](/checkout/standard)).
3. When they finish, we redirect them back to your `callback_url` with a `status` and your `merchant_reference`.
4. **Confirm from your server** with [verify](/api/verify-session) before you fulfil. The callback alone is not proof of payment.
5. Fulfil once, keyed on the reference, when [`charge.success`](/webhooks/events#charge-success) arrives (or verify returns `completed`).

Prefer to keep the customer on your own page? Use [Inline Checkout](/checkout/inline) instead: the flow is the same, but the widget renders in your page.

## Accept payments without a backend

**When:** you have a static site or a frontend-only app and no server to hold a secret key.

Use [Inline Checkout](/checkout/inline) with your **public key** (`pk_*`). The SDK calls [initialize](/api/initialize-session) directly from the browser, and you lock the key to your domains with [domain whitelisting](/guide/authentication#domain-whitelisting). Never ship a secret key to the browser. Because you have no server to receive webhooks, reconcile by having your backend (even a serverless function) call [verify](/api/verify-session), or add a webhook endpoint when you are ready.

## Send a payable invoice

**When:** you are billing a known customer for a known amount, and you want a link you can email or paste into a chat.

1. Create the invoice with line items, optional tax, and a due date ([Invoice Checkout](/checkout/invoice)).
2. Share the returned payment link. The hosted page collects the payment and becomes a receipt once paid.
3. Fulfil on the [`invoice.paid`](/webhooks/events) webhook. Partial payments (if enabled) fire [`invoice.payment_received`](/webhooks/events) with `is_partial` and `is_fully_paid` flags, and now carry the invoice's `line_items` and `metadata` so you can reconcile without a follow-up fetch.

## Collect a balance settled outside ZevPay

**When:** part of an invoice was paid somewhere we cannot see (cash, a transfer straight to your own bank, or platform credit), and you need to collect the rest online.

An invoice only ever records money that reached you through us, so a part-settled invoice cannot represent the remainder. The same secret key drives standard checkout, so:

1. Cancel the invoice so its old full-amount link stops working.
2. Open a [Standard Checkout](/checkout/standard) session for exactly the outstanding amount.
3. Reconcile the `charge.success` back to your invoice using `merchant_reference` and `metadata`.

This is the exact pattern our own products use. See the full walkthrough in [Collecting a balance settled outside ZevPay](/checkout/invoice#collecting-a-balance-settled-outside-zevpay).

## Bill on a schedule

**When:** subscriptions, memberships, or any recurring charge.

We do not store cards for off-session charging, so recurring billing is customer-initiated each cycle:

1. At the start of each cycle, create a fresh [invoice](/checkout/invoice) (or [session](/checkout/standard)) for that period, with a `reference` unique to the cycle, for example `SUB-{customer}-{yyyy-mm}`.
2. Email the invoice link, or if the customer is on your site, redirect them through checkout.
3. Advance the subscription when [`invoice.paid`](/webhooks/events) (or [`charge.success`](/webhooks/events)) arrives for that cycle's reference.

A per-cycle reference keeps each period idempotent: retrying the same cycle never creates a second charge.

## Reconcile every payment reliably

**When:** always. This is the backbone under every recipe above.

- **Webhooks are the source of truth.** Fulfil on [`charge.success`](/webhooks/events#charge-success) / [`invoice.paid`](/webhooks/events), not on the browser redirect.
- **Verify signatures** on every webhook against the raw request body, see [Verifying Signatures](/webhooks/signatures).
- **Be idempotent.** Key your fulfilment on the reference. We retry failed deliveries with backoff, so your endpoint will occasionally see the same event twice.
- **Confirm server-side** with [verify](/api/verify-session) before fulfilling if you are acting on a redirect, and as a fallback if a webhook is delayed.
- **Every response is wrapped** in `{ "success": true, "data": {...} }`. Read your fields off `data`.

## Map payments back to your orders

**When:** you need each payment to point at one of your records.

- Set your own `reference` (your order id) on [initialize](/api/initialize-session) or the invoice. We echo it back as `merchant_reference` in the webhook and on the callback redirect (on `success`, `cancelled`, and `expired`).
- Attach anything else you need in `metadata`. We return it verbatim in the webhook, in [verify](/api/verify-session), and on the transaction in your dashboard.

Between `merchant_reference` and `metadata`, you never have to store our identifiers to find your way back to an order.

## Testing before you go live

- **Build against [test mode](/guide/test-mode)** (`sk_test_` / `pk_test_`). Test keys hit the same endpoints and send the same webhooks as live keys; bank transfers are completed with the simulator, so you can run the whole flow, webhook included, without moving money. Test keys are available while your verification is still in review.
- **Fulfil only when `livemode` is `true`.** Every webhook and session response carries it, so a test order can never ship by mistake.
- **Then make one small real payment** on live keys for a true end-to-end check, since methods other than bank transfer are not simulated yet.
- **Build reconciliation before you go live.** A working webhook handler with signature verification and idempotency is what makes a first real payment safe.
- **Never fulfil on the redirect alone.** Always confirm with a webhook or [verify](/api/verify-session).
- **Roll out behind a flag** so you can enable live checkout for a small cohort first.

## Security checklist

A short list worth revisiting before launch:

- Secret keys (`sk_*`) live only on your server. Public keys (`pk_*`) are the only keys that belong in a browser, and only with domain whitelisting.
- Verify every webhook signature against the raw bytes.
- Treat callback query params as untrusted hints, never as proof of payment.
- Store the reference you care about at create time so a delayed or replayed event still maps home.

## Related

- [Quick Start](/guide/quick-start)
- [Standard Checkout](/checkout/standard) · [Inline Checkout](/checkout/inline) · [Invoice Checkout](/checkout/invoice)
- [Webhook Events](/webhooks/events) · [Verifying Signatures](/webhooks/signatures)
- [Authentication](/guide/authentication) · [Test Mode](/guide/test-mode)

---

## Source: https://docs.zevpaycheckout.com/guide/virtual-accounts
<!-- file: guide/virtual-accounts.md -->

# Virtual Accounts

Virtual accounts are temporary bank accounts that let you receive payments via standard bank transfer. When a customer transfers money to a virtual account, the payment is automatically detected and settled to your ZevPay account.

## How It Works

1. **Create** a virtual account via the [API](/api/virtual-account) or dashboard
2. You receive an **account number** and the **bank name** to show alongside it
3. **Share** the account details with your customer
4. Customer makes a **bank transfer** to the account number from any bank
5. Payment is **automatically detected** and settled to your account
6. A **webhook notification** is sent to your configured webhook URL

## Creating a Virtual Account

```bash
curl -X POST https://api.zevpaycheckout.com/v1/checkout/virtual-account \
  -H "Content-Type: application/json" \
  -H "x-api-key: sk_test_your_secret_key" \
  -d '{
    "amount": "5000.00",
    "validity_minutes": 1440
  }'
```

The response includes the `account_number` that your customer should transfer to:

```json
{
  "success": true,
  "data": {
    "public_id": "abc123def456ghi78",
    "account_number": "4601234567",
    "merchant_name": "My Business",
    "amount": "5000.00",
    "status": "pending",
    "expires_at": "2026-03-09T12:00:00.000Z"
  }
}
```

See the full [Virtual Account API reference](/api/virtual-account).

## Status Lifecycle

```
pending → completed   (payment received)
pending → expired     (validity period elapsed)
cancelled             (creation failed at provider)
```

| Status | Description |
|--------|-------------|
| `pending` | Account is active and waiting for a transfer |
| `completed` | Payment has been received and settled |
| `expired` | Account expired without receiving payment |
| `cancelled` | Account could not be created at the banking provider |

## Expiry

Virtual accounts have a configurable validity period:

- **Default:** 4320 minutes (72 hours)
- **Maximum:** 4320 minutes (72 hours)
- **Minimum:** 1 minute

After the validity period, the account expires and can no longer receive payments. If you need to extend the window, create a new virtual account.

## Virtual Accounts vs Checkout Sessions

Both can accept bank transfer payments, but they serve different purposes:

| | Checkout Session | Virtual Account |
|---|---|---|
| **UI** | Full hosted checkout page | No UI: just account details |
| **Payment methods** | Bank transfer + PayID | Bank transfer only |
| **Use case** | Customer-facing checkout | Backend/API-driven payment collection |
| **Expiry** | 30 minutes | Up to 72 hours |
| **Amount** | Required | Required |

Use **checkout sessions** when you want a complete payment UI for your customers. Use **virtual accounts** when you need to generate bank account details programmatically (e.g., for POS systems, invoice payments, or custom payment flows).

## Dashboard

Virtual accounts can be viewed and created from the [Virtual Accounts](https://dashboard.zevpaycheckout.com/virtual-accounts) section of your dashboard.

---

## Source: https://docs.zevpaycheckout.com/guide/virtual-payid
<!-- file: guide/virtual-payid.md -->

# Virtual PayID

Virtual PayIDs are payment addresses that customers can send money to. ZevPay Checkout supports two types: **Static** and **Dynamic**.

## Static PayID

A static PayID is a permanent, reusable payment address for your business. Think of it like a store's bank account number that never changes.

- **Format:** `yourname.spid` or `yourname.checkout`
- **Expiry:** Never expires (can be deactivated manually)
- **Settlement:** Payments settle directly to your business account
- **Use case:** Storefronts, recurring payment pages, donation links

::: warning Business accounts only
Static PayIDs can only be created by **business accounts**. API keys from personal accounts will receive a `403 Forbidden` error on all static PayID endpoints.
:::

### Creating via API

```bash
curl -X POST https://api.zevpaycheckout.com/v1/checkout/static-payid \
  -H "Content-Type: application/json" \
  -H "x-api-key: sk_test_your_secret_key" \
  -d '{
    "pay_id": "mystore",
    "suffix": ".spid",
    "name": "My Online Store"
  }'
```

See the full [Static PayID API reference](/api/static-payid).

## Dynamic PayID

A dynamic PayID is a temporary, auto-expiring payment address. It's generated on demand for specific transactions and expires after a set time.

- **Format:** `abcd.dypid` (auto-generated slug)
- **Expiry:** Configurable (default 24h, max 72h)
- **Settlement:** Payments settle directly to your account
- **Use case:** One-time invoices, payment requests, checkout flows

Both personal and business accounts can create dynamic PayIDs.

### Creating via API

```bash
curl -X POST https://api.zevpaycheckout.com/v1/checkout/dynamic-payid \
  -H "Content-Type: application/json" \
  -H "x-api-key: sk_test_your_secret_key" \
  -d '{
    "amount": 5000,
    "amount_validation": "A0",
    "name": "Invoice #1234",
    "expires_in_minutes": 1440
  }'
```

See the full [Dynamic PayID API reference](/api/dynamic-payid).

## Static vs Dynamic

| | Static PayID | Dynamic PayID |
|---|---|---|
| **Persistence** | Permanent | Temporary (1-72 hours) |
| **Format** | `yourname.spid` | `abcd.dypid` (auto-generated) |
| **Settlement** | Directly to business account | Directly to creator account |
| **Multiple payments** | Always | Configurable |
| **Amount validation** | Not supported | 6 rules (A0-A5) |
| **Account type** | Business only | Personal or business |
| **Use case** | Storefronts, recurring | Invoices, one-time payments |

## Amount Validation Rules

Dynamic PayIDs support configurable amount validation to control what payment amounts are accepted:

| Rule | Name | Description |
|------|------|-------------|
| `A0` | Exact match | Payment must equal the configured amount |
| `A1` | Less than | Payment must be less than the configured amount |
| `A2` | Greater than | Payment must be greater than the configured amount |
| `A3` | At most | Payment must be equal to or less than the configured amount |
| `A4` | At least | Payment must be equal to or greater than the configured amount |
| `A5` | Any amount | No amount validation (accepts anything) |

**Default:** `A4` (at least the configured amount).

If no `amount` is set on the dynamic PayID, all payments are accepted regardless of the validation rule.

## Settlement

Payments received through a PayID are automatically settled to a destination based on how the PayID was created:

- **API-created:** Settled to the API key's configured settlement ledger. To change where payments go, update your API key's settlement configuration in the [dashboard](https://dashboard.zevpaycheckout.com). If you need different products to settle to different destinations, create separate API keys with different settlement configurations.
- **Dashboard-created:** You can choose a specific settlement destination (your main account or a wallet) when creating the PayID.

::: tip Use wallets for separation
Create dedicated wallets for different revenue streams (e.g., "Online Store", "Invoices") and configure your API keys or dashboard products to settle to the appropriate wallet.
:::

## Payment Flow

1. **Create** a static or dynamic PayID via the [API](/api/static-payid) or [dashboard](https://dashboard.zevpaycheckout.com)
2. **Share** the PayID with your customer (e.g., display on your website, send in an invoice)
3. **Customer pays** by sending money to the PayID through the ZevPay app or any compatible payment method
4. **Payment is settled** to your configured settlement entity automatically
5. **Webhook notification** is sent to your configured webhook URL (if set up)

## Managing PayIDs

### Deactivation

You can deactivate a PayID to stop accepting payments:

- **Static PayIDs:** Can be deactivated and reactivated at any time
- **Dynamic PayIDs:** Can be deactivated before their natural expiry. Cannot be reactivated. Create a new one instead

### Dashboard

All PayIDs (static and dynamic) can be managed from the [Virtual PayID](https://dashboard.zevpaycheckout.com/virtual-payid) section of your dashboard.

---

## Source: https://docs.zevpaycheckout.com/guide/webhook-recovery
<!-- file: guide/webhook-recovery.md -->

---
title: Recovering from a missed webhook
---

# Recovering from a missed webhook

Webhooks fail. Not often, but the ways they fail are ordinary: a deploy restarts your receiver mid-request, a bug in your handler throws before you commit, a firewall rule changes, a queue backs up and a retry window closes. None of these are exotic, and all of them end the same way. Your records say a payment did not happen. Ours say it did.

The fix is the same on every rail we offer, and it is deliberately boring: **ask us**. Every payment type has an endpoint that returns the current truth, and that endpoint is authoritative. Your webhook handler is an optimisation on top of it, not the record itself.

::: tip The one-line version
Treat webhooks as a latency improvement and a scheduled fetch as your source of truth. Systems built that way do not have webhook incidents, they have a slightly slower Tuesday.
:::

## Why not just retry harder

We do retry. Deliveries are attempted repeatedly with backoff, and you can replay them from your dashboard. But retries cannot help with the failure that matters most: a handler that returned `200` and then failed to write the row. From our side that delivery succeeded. Only your side knows it did not, and only a fetch will tell you.

## The pattern

1. Find the things that should have resolved by now: sessions you created but never marked paid, invoices with a balance, accounts you expect money on.
2. Fetch each one.
3. Compare what we return against your ledger and write what is missing.
4. Match on a **reference**, never on an amount.

That last point is the one that bites. Two customers can pay the same amount for the same product in the same minute, and one customer can pay an instalment invoice twice for the same figure. Amounts are not identities. References are.

## By payment type

### Checkout sessions

For a one-off payment created with `initialize`:

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

Returns the session's `status`, `reference`, `amount`, `payment_method` and `paid_at`. A session that reads `completed` was paid, whatever your records say.

If you need an answer that is fresher than our own records, use force-verify instead:

```bash
curl -X POST https://api.zevpaycheckout.com/v1/checkout/session/{session_id}/force-verify \
  -H "x-api-key: sk_live_your_secret_key"
```

That one asks the bank directly before answering, so it catches a payment that has landed at the provider but whose notification has not reached us yet. It is rate limited because each call is an outbound request to a partner. Use it when a specific customer is waiting, not in a loop over yesterday's sessions.

See [Verify Session](/api/verify-session).

### Invoices

```bash
curl https://api.zevpaycheckout.com/v1/checkout/invoice/{public_id} \
  -H "x-api-key: sk_live_your_secret_key"
```

Returns `status`, `amount_paid`, `amount_outstanding`, and every payment made against it. On an instalment invoice each payment carries its own `payment_id` and the `reference` of the transaction it settled as.

Anything in `payments[]` that is not in your ledger is what you missed. See [Recovering from a missed webhook](/api/invoice#recovering-from-a-missed-webhook) in the invoice reference for the full shape.

### Static NGN accounts

A permanent account collects indefinitely, so the recovery unit is a list rather than a single object:

```bash
curl "https://api.zevpaycheckout.com/v1/checkout/static-account/{id}/payments?page=1" \
  -H "x-api-key: sk_live_your_secret_key"
```

Every inflow received on that account, paginated. Because these accounts are assigned to one of your customers, this doubles as that customer's statement.

See [Static Account API](/api/static-account).

### Virtual accounts

```bash
curl https://api.zevpaycheckout.com/v1/checkout/virtual-account/{public_id} \
  -H "x-api-key: sk_live_your_secret_key"
```

Returns the account's `status` and `completed_at`. A `completed` virtual account was paid.

### ZevPay IDs

Both static and dynamic PayIDs expose the same shape:

```bash
curl https://api.zevpaycheckout.com/v1/checkout/static-payid/{id} \
  -H "x-api-key: sk_live_your_secret_key"
```

## A reconciliation pass worth copying

Run this nightly. It is cheap, and it means a webhook outage becomes something you notice in a report rather than in a customer complaint.

```javascript
// Everything you believe is unpaid but might not be.
const open = await db.invoices.find({
  status: { $in: ["sent", "partial", "overdue"] },
});

for (const local of open) {
  const res = await fetch(
    `https://api.zevpaycheckout.com/v1/checkout/invoice/${local.zevpayPublicId}`,
    { headers: { "x-api-key": process.env.ZEVPAY_SECRET_KEY } },
  );
  const { data } = await res.json();

  // Reconcile payment by payment, matching on reference.
  for (const payment of data.payments) {
    const ref = payment.transaction?.reference;
    if (!ref) continue;
    const known = await db.payments.findOne({ reference: ref });
    if (known) continue;

    // We were paid and never recorded it. Do now what the webhook
    // handler would have done.
    await recordPayment({
      reference: ref,
      invoiceId: local.id,
      amount: payment.amount,
      paidAt: payment.paid_at,
    });
    log.warn(`Recovered missed payment ${ref} on invoice ${local.id}`);
  }

  if (data.status === "paid" && local.status !== "paid") {
    await markInvoicePaid(local.id);
  }
}
```

The `log.warn` matters as much as the recovery. A pass that silently fixes things hides a delivery problem that will keep happening.

## Make your handler idempotent first

Recovery only works if replaying a payment is safe. Whether a payment reaches you by webhook, by this fetch, or by both a second apart, your handler should reach the same state.

Key on the payment's `reference` and write once:

```javascript
async function recordPayment(p) {
  // Unique index on reference. The second write is a no-op, not a duplicate.
  await db.payments.updateOne(
    { reference: p.reference },
    { $setOnInsert: p },
    { upsert: true },
  );
}
```

Without that, adding a reconciliation pass turns one missed payment into two recorded ones, which is a worse problem than the one you started with.

## What not to do

**Do not poll every few seconds.** Payment confirmation is push-first; the fetch is a safety net. Polling open sessions aggressively will hit rate limits and delay the customers who are actually waiting.

**Do not match on amount.** Covered above, and worth repeating because it looks like it works right up until the day two customers pay the same figure.

**Do not treat a webhook you cannot verify as proof.** If a payload arrives from an unexpected source, or you are unsure whether a retry is genuine, verify it against the endpoints here before you fulfil. Every event we send has a signature, and every payment we report can be confirmed independently.

---

## Source: https://docs.zevpaycheckout.com/
<!-- file: index.md -->

---
layout: home
hero:
  name: ZevPay Checkout
  text: Accept Payments in Nigeria
  tagline: Integrate secure payment collection via bank transfer, PayID, and cards with just a few lines of code.
  actions:
    - theme: brand
      text: Get Started
      link: /guide/quick-start
    - theme: alt
      text: API Reference
      link: /api/overview

features:
  - title: Bank Transfer
    details: Generate temporary virtual accounts for one-time payments. Customers transfer from any bank and payments are confirmed automatically.
  - title: ZevPay ID
    details: Accept instant peer-to-peer payments via dynamic PayIDs. Customers pay directly from the ZevPay app.
  - title: Inline & Standard Checkout
    details: Drop-in modal for your website or redirect to a hosted checkout page. Both options are fully customizable.
  - title: Webhooks
    details: Get real-time notifications when payments are completed, failed, or expired. Signed with HMAC-SHA256.
  - title: Test Mode
    details: Use test API keys to build and test your integration without processing real payments.
  - title: Dashboard
    details: Monitor transactions, manage API keys, configure payment methods, and view analytics from the merchant dashboard.
---

---

## Source: https://docs.zevpaycheckout.com/payment-methods/bank-transfer
<!-- file: payment-methods/bank-transfer.md -->

---
title: Bank Transfer
description: How the ZevPay Checkout bank transfer method works. A temporary virtual account is created per session and the payment confirms automatically once the transfer lands.
---

# Bank Transfer

Bank transfer is the most common way to pay in Nigeria. When the customer picks it, we create a temporary bank account for the session. The customer transfers the exact amount from any Nigerian bank, and the payment confirms automatically once the transfer arrives.

Identifier: `bank_transfer` (or `bank` in the inline SDK).

## How it works

1. The customer selects Bank Transfer.
2. We create a temporary virtual account scoped to the session.
3. The customer sees the account number, bank name, and account name.
4. The customer transfers the exact amount from their banking app.
5. We detect the transfer and confirm the payment.
6. The session moves to completed and your webhook fires.

## What the customer sees

Selecting the method returns the account details for the transfer:

```json
{
  "payment_method": "bank_transfer",
  "account_number": "1234567890",
  "bank_name": "Providus Bank",
  "account_name": "ZevPay Checkout",
  "amount": 500000,
  "expires_at": "2026-01-01T12:30:00.000Z"
}
```

`amount` is in kobo. `bank_name` reflects the bank that issued the account. `account_name` is your business name where available, otherwise "ZevPay Checkout".

## Key details

- The account is valid for 30 minutes, matching the session.
- On a standard or inline session, the amount must match exactly. A different amount is rejected at the bank.
- On an [invoice](/checkout/invoice) that allows partial payments, the customer may pay any amount up to the remaining balance.
- Confirmation is automatic. Your integration does not poll the bank. We confirm the session and send a webhook.

## Verifying the payment

Confirm the payment from your server before fulfilling. See [Verify Session](/api/verify-session) and [Payment Lifecycle](/guide/payment-lifecycle).

## Related

- [ZevPay ID](/payment-methods/zevpay-id)
- [Payment Methods overview](/payment-methods/overview)
- [Virtual Accounts](/guide/virtual-accounts)

---

## Source: https://docs.zevpaycheckout.com/payment-methods/card
<!-- file: payment-methods/card.md -->

---
title: Card
description: Card payment for ZevPay Checkout is coming soon. This is a preview of how the integration will work so you can plan ahead, including the flow, minimum amount, and endpoints.
---

# Card

::: info Coming soon
Card payment is not live yet. We have it disabled at the platform level while we finish rolling it out. This page is a preview so you can plan your integration ahead of time. Please do not rely on card in production until we announce it here.
:::

Card lets a customer pay with a debit or credit card, with OTP and 3D Secure where the bank requires it. Identifier: `card`.

## Availability

- Card is not in the default method set. It has to be requested explicitly through `payment_methods` on the session, or configured on your key.
- While card is disabled at the platform level, requests to the card endpoints return `503`, and the method does not appear in the checkout UI.
- The minimum amount for card is ₦1,000 (100000 kobo), higher than the ₦1 session minimum. Below ₦1,000 the card option is hidden even where other methods are shown.

## Planned flow

1. The customer selects Card and enters their card number, expiry, CVV, and PIN.
2. Your integration calls the card initiate endpoint.
3. If the bank requires it, the customer completes an OTP step, a 3D Secure redirect, or both.
4. The integration polls the card status endpoint until the result is final.
5. On success, the session moves to completed and your webhook fires.

## Planned endpoints

These endpoints exist and will become usable once card is enabled. They mirror the session and hosted-page structure of the other methods.

| Purpose | Method | Path |
|---------|--------|------|
| Initiate a card payment | `POST` | `/v1/checkout/session/{sessionId}/card/initiate` |
| Validate an OTP | `POST` | `/v1/checkout/session/{sessionId}/card/validate-otp` |
| Poll card status | `GET` | `/v1/checkout/session/{sessionId}/card/status/{reference}` |

The hosted checkout page uses the same paths under `/v1/checkout/page/{sessionId}/card/...`.

Card details submitted to initiate are the card number, expiry (MMYY or MM/YY), CVV, and PIN. Raw card data is never stored, logged, or returned in any response.

## What to do now

If you plan to accept cards later, build against bank transfer and ZevPay ID today. Once we turn card on, adding it is a matter of enabling it on the session and handling the OTP and status steps above. We will announce the go-live date here, so check back or reach out to us if you want to prepare early.

## Related

- [Bank Transfer](/payment-methods/bank-transfer)
- [ZevPay ID](/payment-methods/zevpay-id)
- [Payment Methods overview](/payment-methods/overview)

---

## Source: https://docs.zevpaycheckout.com/payment-methods/crypto
<!-- file: payment-methods/crypto.md -->

---
title: Crypto
description: Accept stablecoin payments (USDT, USDC) on any ZevPay checkout, settled to you in Naira or in the same asset.
---

# Crypto

Customers can pay with stablecoins on any of our checkouts. Each supported asset is offered on a specific network (for example USDT on Tron, USDC on Base), the customer sends the exact quoted amount to a deposit address we generate, and the payment confirms once it lands on-chain. It works the same across [inline](/checkout/inline), [standard](/checkout/standard), and [invoice](/checkout/invoice) checkout.

::: info Rolling out gradually
Crypto is being enabled account by account. If you do not see the Pay with Crypto option on your API keys in the dashboard, contact support to request access.
:::

## Enabling crypto

Crypto is configured per API key, in the dashboard under the key's payment methods:

1. Toggle **Crypto (USDC / USDT)** on for the key.
2. Choose how you want to be settled:
   - **Settle in Naira**: we convert the crypto and pay you through your existing settlement (bank or ZevPay balance). No wallet needed.
   - **Settle in crypto**: we pay out the same asset to your verified crypto wallet. You need a verified wallet for each asset you accept; add them under Settlement, then Crypto wallets. New and changed wallets pass a short security review before payouts flow to them.

Both modes settle on our standard T+1 schedule, like every other method.

## How it appears to customers

When crypto is available on a session, each asset shows as its own option in the method list with its logo and an explicit network label, for example "USDT · Tron (TRC20)". After picking an asset the customer sees:

- The exact amount of the asset to send, locked to a quote.
- A deposit address with a QR code, plus a memo when the network requires one.
- A clear warning that funds must be sent as that asset on that network only.

The page then waits for the on-chain confirmation and completes automatically. If the quote window lapses before payment, the session expires the same way other methods do.

## Assets and networks

An asset is only ever identified together with its network. The same token on two networks is two different destinations, and a transfer sent on the wrong network cannot be recovered. Everywhere in the API, the dashboard, and webhooks, the unit is the pair `ASSET:NETWORK`.

| Asset | Network identifier | Shown to customers as | Address format | Memo |
|-------|--------------------|-----------------------|----------------|------|
| `USDT` | `TRON` | USDT · Tron (TRC20) | `T…` (34 chars) | No |
| `USDC` | `BASE` | USDC · Base | `0x…` (42 chars) | No |

Network identifiers are stable, uppercase, and ours: `TRON`, `BASE`, `ETHEREUM`, `BSC`, `SOLANA` are the values we use, whatever a wallet or exchange calls them (TRC20, ERC20, BEP20 and so on are shown to customers as the label, never used as the identifier).

Where you will meet the pair:

- **`crypto_assets`** on initialize, the inline SDK, and invoices: `"USDT:TRON"`. The bare form `"USDT"` means every network we offer for that asset **at the time of the request**. If your integration must be deterministic, always pin the network.
- **Initialize response** `crypto_assets`: each entry carries `assetCode` and `network` separately, plus a `displayName` for display only.
- **Webhooks** (`charge.success`): `crypto.asset` and `crypto.network`. Reconcile on both, never on the asset alone.
- **Dashboard, key settings**: each accepted asset is a row per network, and each payout wallet is registered for one `(asset, network)`. A USDT payout can only go to a wallet on the same network the customer paid on.

When we add a network for an existing asset, it appears as a new row in this table, a new entry in your key's accepted-assets list, and a new item in `crypto_assets` responses. Nothing about an existing pair changes, so integrations that key on the pair keep working unchanged.

## When crypto is offered

An asset appears on a checkout only when all of these hold:

- The API key has crypto enabled with a settlement mode set.
- Your account has crypto access.
- The checkout's value meets the minimum for that asset. Each asset has a platform minimum in its own units; a checkout worth less than the minimum (at the live rate) will not offer that asset.
- For settle-in-crypto keys: you have a verified, payout-eligible wallet for the asset.

The decision is made when the session is created, and the offered assets are fixed for that session's lifetime.

## Steering crypto per checkout

Crypto is added to a session automatically whenever the conditions above hold and your request passes no `payment_methods`, so nothing changes for existing integrations. An explicit `payment_methods` list is honoured exactly: include `"crypto"` (or pass `crypto_assets`) to offer it, and a list without either never shows crypto. When you want more control:

- Pass `payment_methods: ["crypto"]` for a crypto-only checkout (the fiat tiles are not shown).
- Pass `crypto_assets: ["USDT:TRON"]` to offer only that asset on that network, or `["USDT"]` for every network of the asset. The list can only narrow the assets enabled on your key. Identifiers are listed under [Assets and networks](#assets-and-networks).
- Both work on initialize, on the inline SDK (`paymentMethods: ['crypto']`, `cryptoAssets: [...]`), and on invoices.

If you ask for crypto and it is not eligible on that checkout, initialize fails with `400` rather than silently falling back to fiat. The full decision table is on the [Payment Methods](/payment-methods/overview#crypto) page.

## Integration

No extra integration is needed beyond what you already have. Crypto rides the same session and webhook machinery:

- The initialize response includes `"crypto"` in `enabled_payment_methods` and lists the offered assets in `crypto_assets`, each as `{ assetCode, network, displayName, decimals }`.
- A successful payment fires the same [`charge.success`](/webhooks/events#charge-success) webhook with `channel: "crypto"` and a `crypto` object carrying the asset, network, and asset amount. The `amount` field stays the NGN presentment value in kobo.
- [Verify](/api/verify-session) works unchanged; the session reports `completed` once the deposit confirms.
- Invoices record crypto payments like any other method, so `invoice.paid` and `invoice.payment_received` fire as usual.

Amounts you price stay in your presentment currency; we handle the conversion quote for the customer.

## Fees

Crypto payments use the same pricing configured for your account as our other methods, including the fee cap. With crypto settlement the fee is taken in the asset itself, and the naira cap is converted at that payment's own exchange rate, so a large payment never pays more than the cap's worth regardless of settlement mode.

### Withdrawal fee for crypto settlement

If you settle in crypto, each payout to your external wallet carries a flat withdrawal fee in the asset itself (for example a fixed amount of USDT), separate from the per-payment processing fee above. It covers the cost of the on-chain payout and is charged once per settlement payout, not per payment: all of a day's payments in the same asset and network batch into one payout, and the single fee comes off that batch total.

- The current fee per asset is shown in your dashboard on the key's crypto settings, next to each asset.
- Your payout breakdown (dashboard and email) itemises it: collected amount, withdrawal fee, net sent to your wallet.
- If a payout total is smaller than the fee, the payout is held and rolls into the next one until it clears the fee, so the fee can never consume a payout.
- Settling in Naira has no withdrawal fee; it follows your normal settlement rails.


## Reliability

Payment confirmation is webhook-driven with an automatic reconciliation sweep behind it, so a confirmed on-chain deposit completes the checkout even if a webhook delivery is delayed. If a customer reports paying without the page confirming, the payment resolves automatically once the deposit confirms; the transaction also appears in your dashboard like any other.

## Related

- [Payment Methods overview](/payment-methods/overview)
- [Webhook events](/webhooks/events)
- [Standard Checkout](/checkout/standard) · [Inline Checkout](/checkout/inline) · [Invoice Checkout](/checkout/invoice)

---

## Source: https://docs.zevpaycheckout.com/payment-methods/mobile-money
<!-- file: payment-methods/mobile-money.md -->

---
title: Mobile Money
description: Accept mobile money across Africa on any ZevPay checkout. Customers pay from their mobile wallet and approve on their handset; confirmation, webhooks and settlement work like every other method.
---

# Mobile Money

Customers pay from their mobile wallet. They enter their number, approve the request on their handset, and your checkout confirms automatically.

::: info Rolling out market by market
Mobile money is opened one market at a time. If you do not see it on your checkouts yet, contact support to ask about your market.
:::

## How it works

1. The customer picks **Mobile Money** and enters their phone number.
2. We work out which network the number is on, so they do not have to tell us.
3. They approve on their handset, usually by entering their PIN at a prompt.
4. Your checkout confirms the moment the payment lands.

Some networks work slightly differently. A few send the prompt automatically, a few require the customer to open their provider's menu first, and one or two approve on the provider's own page. Your checkout handles all three without any change on your side.

## Per surface

- **Standard (hosted) checkout**: the customer enters their number on the checkout page and waits there while they approve.
- **Inline**: the same, inside the modal, so your page never navigates away.
- **Invoice**: the same, in place on the invoice page, which then becomes the receipt.

## What this means for your integration

Nothing changes. The method rides the same session machinery as every other:

- `"mobile_money"` appears in `enabled_payment_methods` on the initialize response when it is available for that checkout's currency.
- You can steer it with `payment_methods` like any other method. An explicit list must include `"mobile_money"` to offer it, and `["mobile_money"]` alone makes the checkout mobile money only. See [choosing payment methods](/payment-methods/overview#how-availability-is-decided).
- A successful payment fires the usual [`charge.success`](/webhooks/events#charge-success) webhook with `channel: "mobile_money"`.
- [Verify](/api/verify-session) works unchanged; the session reports `completed` once the payment confirms.

## Currencies

Mobile money is collected in local currency, not naira. A checkout priced in Kenyan shillings is paid in shillings, and your customer sees their own currency throughout.

See [Currencies](/guide/currencies) for how to price a checkout in a currency other than naira, and what you get paid in.

::: warning Whole amounts on some networks
A few networks accept whole units only. M-Pesa, for example, takes whole shillings, so a charge of `KES 100.50` cannot be collected on it. Price in whole units for those markets. If an amount cannot be collected on the chosen network, the checkout says so before the customer enters anything, rather than failing after they have typed their number.
:::

## Amounts and limits

Each network sets its own minimum and maximum, and those change without notice from us. The checkout reads the current limits live and shows them next to the number field, so a customer is never asked to approve something the network will refuse.

## Getting paid

Mobile money collections settle in the currency they were collected in, to a mobile money number you nominate.

1. In your dashboard, go to **Settlement → Mobile money**.
2. Add the number that should receive settlements for that currency.
3. Payouts follow the same T+1 schedule as the rest of your money.

::: warning A new payout destination waits 24 hours
A number you have just added does not receive settlements for 24 hours. That delay is deliberate: changing where money goes is the most valuable thing an attacker can do with a dashboard, and the wait gives you time to notice a change you did not make. Add your destination before you start collecting, and the first payout is unaffected.
:::

If you collect in a currency with no destination configured, the money is held rather than paid out, and your dashboard says so. Nothing is lost; it goes out on the next payout once a destination exists.

## Reliability

Confirmation is webhook-driven with an automatic reconciliation sweep behind it. If a notification is delayed, the payment still confirms within minutes.

Mobile money has one behaviour worth knowing: when a request times out, the payment may still be going through. We never treat an unanswered request as a failure. The collection stays open and resolves to whatever actually happened, so a customer is not asked to pay twice for a payment that was already approved.

---

## Source: https://docs.zevpaycheckout.com/payment-methods/overview
<!-- file: payment-methods/overview.md -->

---
title: Payment Methods
description: The payment methods ZevPay Checkout supports, how method availability is decided per session, and how to control which methods a customer sees.
---

# Payment Methods

ZevPay Checkout supports these methods. They work the same across [inline](/checkout/inline), [standard](/checkout/standard), and [invoice](/checkout/invoice) checkout.

| Method | Identifier | Status |
|--------|------------|--------|
| [Bank Transfer](/payment-methods/bank-transfer) | `bank_transfer` | Available |
| [ZevPay ID](/payment-methods/zevpay-id) | `payid` | Available |
| [Crypto](/payment-methods/crypto) | `crypto` | Available (gradual rollout) |
| [PalmPay](/payment-methods/palmpay) | `palmpay` | Customer pays from their PalmPay account, approved on PalmPay's page. Rolling out gradually. |
| [Mobile Money](/payment-methods/mobile-money) | `mobile_money` | Customer pays from their mobile wallet and approves on their handset. Opening market by market. |
| [Card](/payment-methods/card) | `card` | Coming soon |

## How availability is decided

The methods a customer sees on a session come from, in order:

1. The `payment_methods` you pass when you create the session (or set on an invoice).
2. If you pass nothing, the methods configured on your API key in the dashboard.
3. If neither is set, the default of `["bank_transfer", "payid"]`.

Then platform rules are applied on top. A method you ask for is **offered, not guaranteed**:

- A method that is disabled platform-wide is removed from the session unless your account has been allow-listed for it. Card is the only method disabled today; bank transfer and ZevPay ID are always on.
- Crypto appears only when your key has crypto enabled and the checkout qualifies (see below) — and it is added automatically **only when you pass no `payment_methods` at all**. An explicit list is honoured exactly: name `"crypto"` (or pass `crypto_assets`) to include it, and a list without either never shows crypto, no matter what the key has enabled.
- If nothing survives, the initialize call fails with `400` and a message naming the problem, instead of showing the customer an empty picker.

The response tells you exactly what was offered in `enabled_payment_methods` (and `crypto_assets`), so you never have to guess.

```json
{
  "payment_methods": ["bank_transfer", "payid"]
}
```

In the inline SDK, the same choice is made with the `paymentMethods` option using the short names `bank`, `payid`, `card`, and `crypto`. See [Inline Checkout](/checkout/inline#choosing-payment-methods). Invoices accept the same `payment_methods` field when you create or update them. See [Invoice Checkout](/checkout/invoice#choosing-payment-methods).

### Crypto

Crypto is added automatically: when your key has crypto enabled and the checkout qualifies, `"crypto"` is appended to whatever fiat methods were resolved above. You do not have to list it. You can, however, steer it:

| You pass | Customer sees |
|----------|---------------|
| nothing | Your key's methods, plus crypto when eligible |
| `["bank_transfer", "payid"]` | Those two, plus crypto when eligible (unchanged for existing integrations) |
| `["bank_transfer", "crypto"]` | Bank transfer, plus crypto when eligible |
| `["crypto"]` | Crypto only. If crypto is not eligible on this checkout the call fails with `400` |
| `crypto_assets: ["USDT:TRON"]` | Only that asset, on that network, among the crypto options |
| `["crypto"]` + `crypto_assets: ["USDT"]` | Crypto only, USDT on every network your key accepts |

`crypto_assets` narrows; it never widens. An asset you have not enabled on the key cannot be surfaced this way. See [Crypto](/payment-methods/crypto) for the eligibility conditions.

To remove crypto from a key entirely, turn it off on the key in the dashboard.

## Identifiers

Use these exact values in `payment_methods`:

- `bank_transfer`
- `payid`
- `card`
- `crypto`

For `crypto_assets`, use `ASSET:NETWORK` (for example `USDT:TRON`, `USDC:BASE`) or the bare `ASSET` for every network of that asset. The full list of identifiers is on the [Crypto](/payment-methods/crypto#assets-and-networks) page; your key's accepted pairs are shown in the dashboard under the key's crypto settings, and the initialize response echoes the offered ones in `crypto_assets` with `assetCode` and `network` as separate fields.

## Minimum amounts

| Method | Minimum |
|--------|---------|
| Bank Transfer | ₦1 (100 kobo), the session minimum |
| ZevPay ID | ₦1 (100 kobo), the session minimum |
| Card | ₦1,000 (100000 kobo) |

## Amount matching

Bank Transfer and ZevPay ID both require the customer to pay the exact session amount, except on invoices that allow partial payments, where a bank transfer may be any amount up to the remaining balance. See each method page for detail.

## Related

- [Bank Transfer](/payment-methods/bank-transfer)
- [ZevPay ID](/payment-methods/zevpay-id)
- [Card](/payment-methods/card)
- [Payment Lifecycle](/guide/payment-lifecycle)

---

## Source: https://docs.zevpaycheckout.com/payment-methods/palmpay
<!-- file: payment-methods/palmpay.md -->

---
title: Pay with PalmPay
description: Let customers pay from their PalmPay account on any ZevPay checkout. Approval happens on PalmPay's page; confirmation and settlement work like every other method.
---

# Pay with PalmPay

Customers pay directly from their PalmPay wallet. When they pick PalmPay, they approve the payment on PalmPay's own page (or app), then return to your checkout, which confirms automatically.

::: info Rolling out gradually
Pay with PalmPay is being enabled account by account. If you do not see it on your checkouts yet, contact support to request access.
:::

## How it works per surface

- **Standard (hosted) checkout**: the customer is redirected to PalmPay to approve, then returned to the checkout page, which shows the confirmed payment.
- **Inline**: the approval opens in a new tab so your page never navigates away. The modal waits and confirms automatically the moment the payment lands.
- **Invoice**: same as inline; the invoice page confirms in place and becomes the receipt.

No integration changes are needed. The method rides the same session machinery:

- `"palmpay"` appears in `enabled_payment_methods` on the initialize response when it is available.
- You can steer it with `payment_methods` like any other method: an explicit list must include `"palmpay"` to offer it, and `["palmpay"]` alone makes the checkout PalmPay-only. See [choosing payment methods](/payment-methods/overview#how-availability-is-decided).
- A successful payment fires the same [`charge.success`](/webhooks/events#charge-success) webhook with `channel: "palmpay"`.
- [Verify](/api/verify-session) works unchanged; the session reports `completed` once the payment confirms.
- Invoices record PalmPay payments like any other method, so `invoice.paid` and `invoice.payment_received` fire as usual.

## Amounts, fees, settlement

- NGN only, same minimum as the rest of checkout (₦100).
- Fees follow the pricing configured for your account.
- Settlement is our standard T+1 schedule, to your existing settlement destination (bank or ZevPay balance). Nothing about your payout setup changes.

## Reliability

Payment confirmation is webhook-driven with an automatic reconciliation sweep behind it, so a completed PalmPay payment confirms your checkout even if a notification is delayed. If a customer reports paying without the page confirming, the payment resolves automatically within minutes and appears in your dashboard like any other.

---

## Source: https://docs.zevpaycheckout.com/payment-methods/zevpay-id
<!-- file: payment-methods/zevpay-id.md -->

---
title: ZevPay ID
description: How the ZevPay ID (PayID) method works. A dynamic PayID and QR code are created per session, and the customer pays from the ZevPay app for instant confirmation.
---

# ZevPay ID

ZevPay ID lets a customer pay from the ZevPay app. When they pick it, we create a dynamic PayID and a QR code for the session. The customer sends to the PayID or scans the QR code, and the payment confirms instantly.

Identifier: `payid` (also `payid` in the inline SDK).

## How it works

1. The customer selects ZevPay ID.
2. We create a dynamic PayID and a QR code for the session.
3. The customer opens the ZevPay app and sends to the PayID, or scans the QR code.
4. The payment confirms instantly.
5. The session moves to completed and your webhook fires.

## What the customer sees

Selecting the method returns the PayID and QR data:

```json
{
  "payment_method": "payid",
  "pay_id": "abc3.dypid",
  "qr_data": "https://zevpay.me/abc3.dypid",
  "amount": 500000,
  "expires_at": "2026-01-01T12:30:00.000Z"
}
```

`amount` is in kobo. `qr_data` is a URL you can render as a QR code for scanning.

## Key details

- The PayID is dynamic and expires with the session after 30 minutes.
- The amount must match exactly. The PayID accepts a single payment for the session amount.
- A QR code is provided for quick scanning.
- On an [invoice](/checkout/invoice) that requires full payment (`allow_partial_payments: false`), ZevPay ID is hidden, because a customer-initiated transfer cannot enforce an exact partial amount.

## Verifying the payment

Confirm the payment from your server before fulfilling. See [Verify Session](/api/verify-session) and [Payment Lifecycle](/guide/payment-lifecycle).

## Related

- [Bank Transfer](/payment-methods/bank-transfer)
- [Payment Methods overview](/payment-methods/overview)
- [Virtual PayID](/guide/virtual-payid)

---

## Source: https://docs.zevpaycheckout.com/sdks/cli
<!-- file: sdks/cli.md -->

# CLI

The ZevPay CLI lets you manage payments, test webhooks, and verify transactions from your terminal.

## Installation

```bash
npm install -g @zevpay/cli
```

Or use without installing:

```bash
npx @zevpay/cli <command>
```

Requires Node.js 18+.

## Authentication

```bash
zevpay login sk_test_your_secret_key
```

The key is stored locally. You can also use the `ZEVPAY_SECRET_KEY` environment variable.

```bash
export ZEVPAY_SECRET_KEY=sk_test_your_secret_key
```

## Commands

### verify

Verify a checkout session and display its status.

```bash
zevpay verify ses_abc123
```

```
  Checkout Session

  Session ID       ses_abc123
  Reference        REF-001
  Status           completed
  Amount           ₦5,000.00
  Currency         NGN
  Email            customer@example.com
  Payment Method   bank_transfer
  Paid At          3/11/2026, 2:30:00 PM
```

Add `--json` for raw JSON output:

```bash
zevpay verify ses_abc123 --json
```

### banks

List supported banks.

```bash
zevpay banks                  # List all
zevpay banks --search access  # Filter by name
zevpay banks --json           # Raw JSON
```

### resolve

Resolve a bank account (name enquiry).

```bash
zevpay resolve 0123456789 044
```

```
  Account Details

  Account Name     John Doe
  Account Number   0123456789
  Bank Code        044
```

### balance

Show your wallet balance.

```bash
zevpay balance
```

```
  Wallet Balance (test mode)

  ₦50,000.00 NGN
```

## Webhook testing

The CLI provides two commands for testing webhooks locally, similar to the Stripe CLI workflow.

### listen

Start a local HTTP server that receives webhook events. Configure this URL as your webhook endpoint in the [ZevPay Dashboard](https://dashboard.zevpaycheckout.com).

First, save your webhook secret:

```bash
zevpay webhook-secret whsec_your_secret
```

Then start listening:

```bash
zevpay listen                              # Listen on port 4242
zevpay listen -p 8080                      # Custom port
zevpay listen -f http://localhost:3000/api/webhooks  # Forward to your app
```

Output:

```
  ZevPay Webhook Listener

  Endpoint  http://localhost:4242/
  Forward   http://localhost:3000/api/webhooks
  Status    Ready, waiting for events

  ->  3/11/2026, 2:30:00 PM  charge.success  [sig verified]
      ref=TEST-A1B2C3D4  amount=500000  status=completed
      forwarded -> 200 OK
```

The listener verifies the `x-zevpay-signature` header and optionally forwards events to your application.

### trigger

Send a test webhook event with a valid signature to your listener or application.

```bash
zevpay trigger charge.success                              # To localhost:4242
zevpay trigger transfer.success -u http://localhost:3000/webhooks
```

Available event types:

| Event | Description |
|-------|-------------|
| `charge.success` | Successful payment |
| `transfer.success` | Successful transfer |
| `transfer.failed` | Failed transfer |
| `transfer.reversed` | Reversed transfer |
| `invoice.created` | Invoice created |
| `invoice.paid` | Invoice paid |

### Typical webhook testing workflow

```bash
# Terminal 1: Start your app
npm run dev

# Terminal 2: Start the webhook listener, forwarding to your app
zevpay listen -f http://localhost:3000/api/webhooks

# Terminal 3: Trigger test events
zevpay trigger charge.success
zevpay trigger transfer.failed
```

## Environment variables

| Variable | Description |
|----------|-------------|
| `ZEVPAY_SECRET_KEY` | API secret key (alternative to `zevpay login`) |
| `ZEVPAY_WEBHOOK_SECRET` | Webhook signing secret (alternative to `zevpay webhook-secret`) |

## Resources

- [API Reference](/api/overview): Full endpoint documentation
- [Node.js SDK](/sdks/nodejs): Underlying server-side SDK
- [Webhook Events](/webhooks/events): All event types
- [npm](https://www.npmjs.com/package/@zevpay/cli): Package registry

---

## Source: https://docs.zevpaycheckout.com/sdks/flutter
<!-- file: sdks/flutter.md -->

# Flutter SDK

Official Flutter SDK for integrating ZevPay Checkout in mobile apps. Opens the standard checkout page in a WebView and returns the result to your app.

## Installation

Add to your `pubspec.yaml`:

```yaml
dependencies:
  zevpay_checkout: ^1.0.0
```

Then run:

```bash
flutter pub get
```

Requires Flutter 3.10+ and Dart 3.0+.

## Quick start

```dart
import 'package:zevpay_checkout/zevpay_checkout.dart';

final result = await ZevPayCheckout.open(
  context: context,
  options: CheckoutOptions(
    apiKey: 'pk_test_your_public_key',
    email: 'customer@example.com',
    amount: 500000, // ₦5,000 in kobo
  ),
);

if (result.isSuccess) {
  print('Payment successful! Ref: ${result.reference}');
}
```

## How it works

1. `ZevPayCheckout.open()` calls the initialize endpoint to create a session
2. Opens the ZevPay standard checkout page in a WebView
3. Customer selects a payment method and completes payment
4. SDK intercepts the callback redirect and returns a `CheckoutResult`

::: warning Public keys only
The Flutter SDK only accepts public keys (`pk_live_*` or `pk_test_*`). Secret keys must not be used in mobile apps.
:::

## Open checkout

```dart
try {
  final result = await ZevPayCheckout.open(
    context: context,
    options: CheckoutOptions(
      apiKey: 'pk_test_your_public_key',
      email: 'customer@example.com',
      amount: 500000,
      currency: 'NGN',
      reference: 'ORDER-123',
      firstName: 'John',
      lastName: 'Doe',
      metadata: {'order_id': '123'},
      paymentMethods: ['bank_transfer', 'payid'],
      theme: CheckoutTheme(
        appBarColor: Colors.teal,
        appBarTitle: 'Pay Now',
      ),
    ),
  );

  switch (result.status) {
    case CheckoutStatus.success:
      // Verify on your server, then fulfill the order
      await verifyOnServer(result.reference!);
      break;
    case CheckoutStatus.cancelled:
      print('User cancelled');
      break;
    case CheckoutStatus.expired:
      print('Session expired');
      break;
    case CheckoutStatus.error:
      print('Error: ${result.error?.message}');
      break;
  }
} on CheckoutError catch (e) {
  print('Initialization failed: ${e.message}');
}
```

## CheckoutOptions

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `apiKey` | `String` | Yes |  | Public API key (`pk_live_*` or `pk_test_*`) |
| `email` | `String` | Yes |  | Customer's email address |
| `amount` | `int` | Yes |  | Amount in kobo (min 10000 = ₦100) |
| `currency` | `String` | No | `'NGN'` | Currency code |
| `reference` | `String?` | No | Auto | Your transaction reference |
| `firstName` | `String?` | No |  | Customer's first name |
| `lastName` | `String?` | No |  | Customer's last name |
| `metadata` | `Map?` | No |  | Custom metadata |
| `paymentMethods` | `List<String>?` | No | All | `['bank_transfer', 'payid']` |
| `theme` | `CheckoutTheme?` | No | Default | Visual customization |

## CheckoutResult

| Property | Type | Description |
|----------|------|-------------|
| `status` | `CheckoutStatus` | `success`, `cancelled`, `expired`, or `error` |
| `reference` | `String?` | Transaction reference (success only) |
| `sessionId` | `String` | Session ID |
| `error` | `CheckoutError?` | Error details (error only) |
| `isSuccess` | `bool` | Convenience getter |
| `isCancelled` | `bool` | Convenience getter |

## Customize the checkout screen

Control the appearance of the WebView screen:

```dart
CheckoutTheme(
  appBarColor: Colors.indigo,           // App bar background
  appBarForegroundColor: Colors.white,  // Title and icon color
  appBarTitle: 'Complete Payment',       // Title text
  showAppBar: true,                      // Show/hide app bar
  showLoadingIndicator: true,            // Progress bar in app bar
  loadingWidget: MyCustomSpinner(),      // Custom loading widget
)
```

| Property | Type | Default | Description |
|----------|------|---------|-------------|
| `appBarColor` | `Color?` | ZevPay teal | Background color |
| `appBarForegroundColor` | `Color?` | White | Title and icon color |
| `appBarTitle` | `String?` | `"ZevPay Checkout"` | Title text |
| `showAppBar` | `bool` | `true` | Show/hide the app bar |
| `showLoadingIndicator` | `bool` | `true` | Show progress bar while loading |
| `loadingWidget` | `Widget?` | Default spinner | Custom loading widget |

## Verify payment

After a successful checkout, verify the payment on your **server** using a secret key:

```dart
// Dart backend only — never use secret keys in mobile apps
final verified = await ZevPayCheckout.verify(
  secretKey: 'sk_test_your_secret_key',
  sessionId: result.sessionId,
);

if (verified.isCompleted) {
  print('Confirmed! Paid at: ${verified.paidAt}');
  print('Method: ${verified.paymentMethod}');
}
```

::: warning Server-side only
`verify()` requires a secret key and should only be called from your Dart backend (dart_frog, shelf, etc.). For mobile apps, call your own backend API to verify the payment.
:::

## Webhook verification

Verify incoming webhook signatures on your Dart backend:

```dart
import 'dart:io';
import 'package:zevpay_checkout/zevpay_checkout.dart';

final isValid = ZevPayWebhook.verifySignature(
  payload: requestBody,
  signature: request.headers['x-zevpay-signature']!,
  webhookSecret: Platform.environment['ZEVPAY_WEBHOOK_SECRET']!,
);

if (isValid) {
  final event = jsonDecode(requestBody);
  switch (event['event']) {
    case 'charge.success':
      // Handle successful payment
      break;
    case 'transfer.success':
      // Handle successful transfer
      break;
  }
}
```

::: warning Always verify
Never process webhook events without verifying the signature. See [Verifying Signatures](/webhooks/signatures) for details.
:::

## Error handling

`ZevPayCheckout.open()` throws `CheckoutError` for initialization failures. Cancellation and expiry are returned in the `CheckoutResult`, not as exceptions.

```dart
try {
  final result = await ZevPayCheckout.open(...);
  // result.status is success, cancelled, expired, or error
} on CheckoutError catch (e) {
  // Initialization failed
  print('${e.code}: ${e.message}');
}
```

| Error code | When |
|------------|------|
| `MISSING_API_KEY` | No API key provided |
| `INVALID_API_KEY` | Secret key used instead of public key |
| `MISSING_EMAIL` | No email provided |
| `INVALID_AMOUNT` | Amount below 10,000 kobo |
| `INITIALIZATION_FAILED` | API returned an error |
| `NETWORK_ERROR` | Network or timeout error |
| `API_ERROR` | Server returned non-2xx status |

## Full example

```dart
import 'package:flutter/material.dart';
import 'package:zevpay_checkout/zevpay_checkout.dart';

class PaymentPage extends StatefulWidget {
  const PaymentPage({super.key});

  @override
  State<PaymentPage> createState() => _PaymentPageState();
}

class _PaymentPageState extends State<PaymentPage> {
  Future<void> _pay() async {
    try {
      final result = await ZevPayCheckout.open(
        context: context,
        options: CheckoutOptions(
          apiKey: 'pk_test_your_public_key',
          email: 'customer@example.com',
          amount: 500000,
          reference: 'order_${DateTime.now().millisecondsSinceEpoch}',
          theme: const CheckoutTheme(
            appBarTitle: 'Complete Payment',
          ),
        ),
      );

      if (!mounted) return;

      if (result.isSuccess) {
        ScaffoldMessenger.of(context).showSnackBar(
          SnackBar(content: Text('Paid! Ref: ${result.reference}')),
        );
        // Call your backend to verify and fulfill the order
      } else if (result.isCancelled) {
        ScaffoldMessenger.of(context).showSnackBar(
          const SnackBar(content: Text('Payment cancelled')),
        );
      }
    } on CheckoutError catch (e) {
      if (!mounted) return;
      ScaffoldMessenger.of(context).showSnackBar(
        SnackBar(content: Text('Error: ${e.message}')),
      );
    }
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Checkout')),
      body: Center(
        child: ElevatedButton(
          onPressed: _pay,
          child: const Text('Pay ₦5,000'),
        ),
      ),
    );
  }
}
```

## Platform support

| Platform | Support |
|----------|---------|
| Android | Supported |
| iOS | Supported |
| Web | Not supported. Use [Inline Checkout](/checkout/inline) or [React](/sdks/react) |
| Desktop | Not supported |

## Resources

- [API Reference](/api/overview): Full endpoint documentation
- [Webhook Events](/webhooks/events): All event types
- [pub.dev](https://pub.dev/packages/zevpay_checkout): Package registry

---

## Source: https://docs.zevpaycheckout.com/sdks/laravel
<!-- file: sdks/laravel.md -->

# Laravel

Official Laravel integration for ZevPay Checkout. Provides a service provider, facade, webhook handling with signature verification, and event dispatching.

## Installation

```bash
composer require zevpay/laravel
```

The package uses Laravel auto-discovery, so no manual provider registration is needed.

Publish the config file:

```bash
php artisan vendor:publish --tag=zevpay-config
```

Requires PHP 8.1+ and Laravel 10, 11, or 12.

## Configuration

Add your API keys to `.env`:

```env
ZEVPAY_SECRET_KEY=sk_live_your_secret_key
ZEVPAY_PUBLIC_KEY=pk_live_your_public_key
ZEVPAY_WEBHOOK_SECRET=whsec_your_webhook_secret
```

Get your keys from the [ZevPay Dashboard](https://dashboard.zevpaycheckout.com).

The published config file (`config/zevpay.php`) supports these options:

| Variable | Default | Description |
|----------|---------|-------------|
| `ZEVPAY_SECRET_KEY` |  | Your `sk_live_*` or `sk_test_*` key |
| `ZEVPAY_PUBLIC_KEY` |  | Your `pk_live_*` or `pk_test_*` key (optional, for frontend) |
| `ZEVPAY_WEBHOOK_SECRET` |  | Webhook signing secret from Dashboard |
| `ZEVPAY_WEBHOOK_PATH` | `webhooks/zevpay` | Webhook endpoint path |
| `ZEVPAY_BASE_URL` | `https://api.zevpaycheckout.com` | API base URL |
| `ZEVPAY_TIMEOUT` | `30` | Request timeout in seconds |
| `ZEVPAY_MAX_RETRIES` | `2` | Retries on 5xx errors |

## Usage

### Facade

```php
use ZevPay\Laravel\Facades\ZevPay;

// Initialize a checkout session
$session = ZevPay::checkout()->initialize([
    'amount' => 500000, // ₦5,000 in kobo
    'email' => 'customer@example.com',
    'reference' => 'ORDER-123',
    'callback_url' => 'https://yoursite.com/callback',
]);

return redirect($session['checkout_url']);
```

### Dependency injection

```php
use ZevPay\ZevPay;

class PaymentController extends Controller
{
    public function checkout(ZevPay $zevpay)
    {
        $session = $zevpay->checkout->initialize([
            'amount' => 500000,
            'email' => 'customer@example.com',
        ]);

        return redirect($session['checkout_url']);
    }
}
```

### Available resources

| Resource | Facade | Methods |
|----------|--------|---------|
| Checkout | `ZevPay::checkout()` | `initialize`, `verify`, `get`, `selectPaymentMethod` |
| Transfers | `ZevPay::transfers()` | `create`, `list`, `get`, `verify`, `listBanks`, `resolveAccount`, `calculateCharges`, `getBalance` |
| Invoices | `ZevPay::invoices()` | `create`, `list`, `get`, `update`, `send`, `cancel` |
| Static PayID | `ZevPay::staticPayId()` | `create`, `list`, `get`, `update`, `deactivate`, `reactivate` |
| Dynamic PayID | `ZevPay::dynamicPayId()` | `create`, `list`, `get`, `deactivate` |
| Virtual Accounts | `ZevPay::virtualAccounts()` | `create`, `list`, `get` |
| Wallet | `ZevPay::wallet()` | `get`, `update`, `listMembers`, `addMember`, `removeMember`, `updateMember` |

## Webhooks

The package registers a webhook route at `POST /webhooks/zevpay` with automatic HMAC-SHA256 signature verification.

### Setup

1. Copy the webhook URL: `https://yoursite.com/webhooks/zevpay`
2. Go to your [ZevPay Dashboard](https://dashboard.zevpaycheckout.com) webhook settings
3. Paste the URL and save
4. Copy the **webhook secret** and add it to `.env` as `ZEVPAY_WEBHOOK_SECRET`

::: warning Always configure webhooks
Webhooks provide reliable server-to-server payment confirmation. Client-side callbacks may fail if the customer closes their browser.
:::

### Listening to events

Register listeners in your `EventServiceProvider` or use closures:

```php
use ZevPay\Laravel\Events\ChargeSuccess;
use ZevPay\Laravel\Events\WebhookReceived;

// Listen to a specific event
class HandleChargeSuccess
{
    public function handle(ChargeSuccess $event): void
    {
        $reference = $event->payload['data']['reference'];
        $amount = $event->payload['data']['amount'];

        // Update your order, send receipt, etc.
        Order::where('reference', $reference)->update([
            'status' => 'paid',
        ]);
    }
}

// Or listen to all webhook events
class LogAllWebhooks
{
    public function handle(WebhookReceived $event): void
    {
        logger()->info("ZevPay: {$event->eventType}", $event->payload);
    }
}
```

### Available events

| Event class | Webhook type |
|-------------|-------------|
| `ChargeSuccess` | `charge.success` |
| `TransferSuccess` | `transfer.success` |
| `TransferFailed` | `transfer.failed` |
| `TransferReversed` | `transfer.reversed` |
| `InvoiceCreated` | `invoice.created` |
| `InvoiceSent` | `invoice.sent` |
| `InvoicePaymentReceived` | `invoice.payment_received` |
| `InvoicePaid` | `invoice.paid` |
| `InvoiceOverdue` | `invoice.overdue` |
| `InvoiceCancelled` | `invoice.cancelled` |
| `WebhookReceived` | All events (generic catch-all) |

All specific event classes extend `WebhookEvent` and have a `$payload` property containing the raw webhook data.

### Custom webhook path

```env
ZEVPAY_WEBHOOK_PATH=api/webhooks/zevpay
```

### CSRF exemption

The webhook route uses `VerifyWebhookSignature` middleware instead of CSRF. For Laravel 10 and older, add the path to your `VerifyCsrfToken` middleware `$except` array:

```php
protected $except = [
    'webhooks/zevpay',
];
```

Laravel 11+ handles this automatically.

## Artisan commands

### Verify API keys

```bash
php artisan zevpay:verify-keys
```

Checks that your keys are configured, have valid format (`sk_*`, `pk_*`), and tests API connectivity.

### Test webhook

```bash
php artisan zevpay:webhook-test
php artisan zevpay:webhook-test transfer.success
```

Sends a signed test webhook payload to your local endpoint. Useful for testing your event listeners during development.

## Error handling

The package uses the [PHP SDK](/sdks/php) exception hierarchy:

```php
use ZevPay\Laravel\Facades\ZevPay;
use ZevPay\Exceptions\ValidationException;
use ZevPay\Exceptions\AuthenticationException;
use ZevPay\Exceptions\NotFoundException;
use ZevPay\Exceptions\RateLimitException;

try {
    $session = ZevPay::checkout()->initialize([
        'amount' => 500000,
        'email' => 'customer@example.com',
    ]);
} catch (ValidationException $e) {
    // $e->details contains field-level errors
    // e.g. ['email' => 'Email is required']
} catch (AuthenticationException $e) {
    // Invalid API key
} catch (NotFoundException $e) {
    // Resource not found
} catch (RateLimitException $e) {
    // $e->retryAfter — seconds to wait
}
```

## Resources

- [API Reference](/api/overview): Full endpoint documentation
- [PHP SDK](/sdks/php): Underlying server-side SDK
- [Webhook Events](/webhooks/events): All event types
- [Packagist](https://packagist.org/packages/zevpay/laravel): Package registry

---

## Source: https://docs.zevpaycheckout.com/sdks/nodejs
<!-- file: sdks/nodejs.md -->

# Node.js SDK

Official server-side SDK for integrating ZevPay Checkout in Node.js applications. Provides full REST API coverage with TypeScript support.

## Installation

```bash
npm install @zevpay/node
```

Requires Node.js 18 or later.

## Quick start

```typescript
import ZevPay from '@zevpay/node';

const zevpay = new ZevPay('sk_test_your_secret_key');

// Initialize a checkout session
const session = await zevpay.checkout.initialize({
  amount: 500000, // ₦5,000 in kobo
  email: 'customer@example.com',
  reference: 'ORDER-123',
  callbackUrl: 'https://yoursite.com/callback',
});

console.log(session.checkoutUrl);
// → https://secure.zevpaycheckout.com/ses_abc123...
```

## Configuration

```typescript
const zevpay = new ZevPay('sk_live_xxx', {
  baseUrl: 'https://api.zevpaycheckout.com', // default
  timeout: 30000,  // 30s request timeout (default)
  maxRetries: 2,   // retries on 5xx errors (default)
});
```

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `baseUrl` | string | `https://api.zevpaycheckout.com` | API base URL |
| `timeout` | number | `30000` | Request timeout in ms |
| `maxRetries` | number | `2` | Max retries on server errors |

::: warning Secret keys only
The SDK only accepts secret keys (`sk_live_*` or `sk_test_*`). Public keys cannot be used server-side.
:::

## Checkout sessions

### Initialize a session

```typescript
const session = await zevpay.checkout.initialize({
  amount: 500000,
  email: 'customer@example.com',
  currency: 'NGN',
  reference: 'ORDER-123',
  callbackUrl: 'https://yoursite.com/callback',
  metadata: { orderId: '123' },
  paymentMethods: ['bank_transfer', 'payid'],
});

// Redirect your customer to:
console.log(session.checkoutUrl);
```

### Verify a payment

```typescript
const result = await zevpay.checkout.verify(session.sessionId);

if (result.status === 'completed') {
  console.log('Payment confirmed at:', result.paidAt);
}
```

### Get session details

```typescript
const details = await zevpay.checkout.get('ses_abc123');
```

## Transfers

### Bank transfer

```typescript
const transfer = await zevpay.transfers.create({
  type: 'bank_transfer',
  amount: 1000000, // ₦10,000
  accountNumber: '0123456789',
  bankCode: '044',
  accountName: 'John Doe',
  narration: 'Payout',
  reference: 'TXN-123',
});
```

### PayID transfer

```typescript
const transfer = await zevpay.transfers.create({
  type: 'payid',
  amount: 500000,
  payId: 'johndoe',
  narration: 'Payment',
});
```

### List transfers

```typescript
const transfers = await zevpay.transfers.list({
  page: 1,
  pageSize: 20,
  status: 'completed',
  type: 'bank_transfer',
});
```

### Verify a transfer

```typescript
const result = await zevpay.transfers.verify('TXN-123');
```

### List banks

```typescript
const banks = await zevpay.transfers.listBanks();
// [{ code: '044', name: 'Access Bank', slug: 'access-bank' }, ...]
```

### Resolve bank account

```typescript
const account = await zevpay.transfers.resolveAccount({
  accountNumber: '0123456789',
  bankCode: '044',
});

console.log(account.accountName); // 'JOHN DOE'
```

### Calculate fees

```typescript
const charges = await zevpay.transfers.calculateCharges({
  amount: 1000000,
  bankCode: '044',
});

console.log(charges.fee);   // Fee in kobo
console.log(charges.total); // Amount + all charges
```

### Get wallet balance

```typescript
const balance = await zevpay.transfers.getBalance();
console.log(balance.availableBalance); // Balance in kobo
```

## Invoices

### Create an invoice

```typescript
const invoice = await zevpay.invoices.create({
  customerName: 'Jane Doe',
  customerEmail: 'jane@example.com',
  dueDate: '2026-04-01',
  lineItems: [
    { description: 'Web Design', quantity: 1, unitPrice: 5000000 },
    { description: 'Hosting (1yr)', quantity: 1, unitPrice: 1200000 },
  ],
  taxRate: 7.5,
  note: 'Thank you for your business',
});

// Send to customer:
console.log(invoice.paymentUrl);
```

### Send, list, cancel

```typescript
// Send invoice (draft → sent)
await zevpay.invoices.send(invoice.publicId);

// List invoices
const invoices = await zevpay.invoices.list({ status: 'sent' });

// Cancel invoice
await zevpay.invoices.cancel(invoice.publicId);
```

## Static PayIDs

```typescript
// Create
const payid = await zevpay.staticPayId.create({
  payId: 'mystore',
  suffix: '.spid',
  name: 'My Store',
  description: 'Accept payments to my store',
});

// List
const payids = await zevpay.staticPayId.list();

// Update
await zevpay.staticPayId.update(payid.id, { name: 'New Name' });

// Deactivate / Reactivate
await zevpay.staticPayId.deactivate(payid.id);
await zevpay.staticPayId.reactivate(payid.id);
```

## Dynamic PayIDs

```typescript
// Create a time-limited payment link
const dpayid = await zevpay.dynamicPayId.create({
  amount: 1000000,
  name: 'Donation Drive',
  expiresInMinutes: 60,
  amountValidation: 'A0',
});

console.log(dpayid.fullPayId); // e.g. 'donation-drive-xyz.dpay'

// List active
const active = await zevpay.dynamicPayId.list({ status: 'active' });

// Deactivate
await zevpay.dynamicPayId.deactivate(dpayid.id);
```

## Virtual accounts

```typescript
// Create
const va = await zevpay.virtualAccounts.create({
  amount: 1000000,
  validityMinutes: 60,
});

console.log(va.accountNumber); // Customer pays to this account

// List
const accounts = await zevpay.virtualAccounts.list({ status: 'pending' });
```

## Wallet

```typescript
// Get wallet details
const wallet = await zevpay.wallet.get();

// List members
const members = await zevpay.wallet.listMembers();

// Add / remove members
await zevpay.wallet.addMember({ payId: 'johndoe' });
await zevpay.wallet.removeMember('johndoe');
```

## Webhook verification

Verify incoming webhook signatures using your webhook secret:

::: code-group

```typescript [Express]
import ZevPay from '@zevpay/node';

app.post('/webhooks/zevpay', express.raw({ type: 'application/json' }), (req, res) => {
  const signature = req.headers['x-zevpay-signature'] as string;

  try {
    const event = ZevPay.webhooks.constructEvent(
      req.body,
      signature,
      process.env.ZEVPAY_WEBHOOK_SECRET!,
    );

    switch (event.event) {
      case 'charge.success':
        // Handle successful checkout payment
        break;
      case 'transfer.success':
        // Handle successful transfer
        break;
      case 'transfer.failed':
        // Handle failed transfer
        break;
      case 'invoice.paid':
        // Handle paid invoice
        break;
    }

    res.sendStatus(200);
  } catch (err) {
    res.status(400).send('Invalid signature');
  }
});
```

```typescript [Manual verification]
const isValid = ZevPay.webhooks.verify(
  rawBody,
  signature,
  webhookSecret,
);
```

:::

::: warning Always verify
Never process webhook events without verifying the signature. See [Verifying Signatures](/webhooks/signatures) for details.
:::

## Error handling

All API errors throw typed exceptions:

```typescript
import ZevPay, {
  ZevPayError,
  ZevPayValidationError,
  ZevPayAuthenticationError,
  ZevPayNotFoundError,
  ZevPayRateLimitError,
  ZevPayConflictError,
} from '@zevpay/node';

try {
  await zevpay.transfers.create({ /* ... */ });
} catch (err) {
  if (err instanceof ZevPayValidationError) {
    // 400 — invalid parameters
    console.log(err.code);    // e.g. 'VALIDATION_ERROR'
    console.log(err.message); // Human-readable message
    console.log(err.details); // Field-level errors
  } else if (err instanceof ZevPayAuthenticationError) {
    // 401 — invalid API key
  } else if (err instanceof ZevPayNotFoundError) {
    // 404 — resource not found
  } else if (err instanceof ZevPayConflictError) {
    // 409 — duplicate transaction
  } else if (err instanceof ZevPayRateLimitError) {
    // 429 — rate limit exceeded
    console.log(err.retryAfter); // seconds to wait
  }
}
```

| Error class | Status | When |
|-------------|--------|------|
| `ZevPayValidationError` | 400 | Invalid request parameters |
| `ZevPayAuthenticationError` | 401 | Invalid or missing API key |
| `ZevPayPermissionError` | 403 | Insufficient permissions |
| `ZevPayNotFoundError` | 404 | Resource not found |
| `ZevPayConflictError` | 409 | Duplicate resource |
| `ZevPayRateLimitError` | 429 | Too many requests |
| `ZevPayApiError` | 500+ | Server error |

## Full example: Express.js

```typescript
import express from 'express';
import ZevPay from '@zevpay/node';

const app = express();
const zevpay = new ZevPay(process.env.ZEVPAY_SECRET_KEY!);

// Initialize payment
app.post('/api/pay', express.json(), async (req, res) => {
  const session = await zevpay.checkout.initialize({
    amount: req.body.amount,
    email: req.body.email,
    reference: `ORDER-${Date.now()}`,
    callbackUrl: `${req.protocol}://${req.get('host')}/api/callback`,
  });

  res.json({ checkoutUrl: session.checkoutUrl });
});

// Verify after callback
app.get('/api/callback', async (req, res) => {
  const sessionId = req.query.session_id as string;
  const result = await zevpay.checkout.verify(sessionId);

  if (result.status === 'completed') {
    res.send('Payment successful!');
  } else {
    res.send('Payment not completed yet.');
  }
});

// Receive webhooks
app.post('/webhooks/zevpay', express.raw({ type: 'application/json' }), (req, res) => {
  try {
    const event = ZevPay.webhooks.constructEvent(
      req.body,
      req.headers['x-zevpay-signature'] as string,
      process.env.ZEVPAY_WEBHOOK_SECRET!,
    );

    console.log('Webhook received:', event.event, event.data);
    res.sendStatus(200);
  } catch {
    res.status(400).send('Invalid signature');
  }
});

app.listen(3000);
```

## Resources

- [API Reference](/api/overview): Full endpoint documentation
- [Webhook Events](/webhooks/events): All event types
- [GitHub](https://github.com/zevpay/zevpay-node): Source code
- [npm](https://www.npmjs.com/package/@zevpay/node): Package registry

---

## Source: https://docs.zevpaycheckout.com/sdks/overview
<!-- file: sdks/overview.md -->

# SDKs Overview

We provide client-side SDKs for collecting payments and server-side SDKs for managing transactions from your backend.

Looking for the checkout integration itself? The three options (inline, standard, and invoice) live in the [Checkout section](/checkout/overview). This page covers the language and framework wrappers around them.

## Integration options

| Feature | Inline Checkout | Standard Checkout | React | Flutter | Node.js SDK | PHP SDK | Python SDK | Laravel | WooCommerce |
|---------|----------------|-------------------|-------|---------|-------------|---------|------------|---------|-------------|
| **Integration** | JavaScript SDK on your page | Redirect to hosted page | React components/hooks | WebView in mobile app | Server-side library | Server-side library | Server-side library | Laravel package | WordPress plugin |
| **User experience** | Modal overlay, user stays on your site | Full-page checkout on ZevPay | Modal overlay (React) | In-app WebView checkout | Backend API calls | Backend API calls | Backend API calls | Backend API calls | Inline modal or redirect |
| **Session creation** | Client-side (SDK handles it) | Server-side (you create, then redirect) | Client-side (SDK handles it) | Client-side (SDK handles it) | Server-side | Server-side | Server-side | Server-side | Plugin handles it |
| **API key type** | Public key only | Public key (page) + Secret key (server) | Public key only | Public key only | Secret key only | Secret key only | Secret key only | Secret key only | Both (configured in settings) |
| **Callbacks** | JavaScript functions | URL query parameters | React props / hooks | Dart async/await | Promises / async-await | Return values / exceptions | Return values / exceptions | Events / exceptions | WooCommerce order lifecycle |
| **Best for** | Vanilla JS, jQuery sites | E-commerce carts, invoices, email payments | React / Next.js apps | Flutter mobile apps | Node.js / Express / NestJS | WordPress, any PHP app | Django, FastAPI, Flask apps | Laravel apps | WooCommerce stores |

## Inline Checkout

Embed a payment modal directly on your website. The SDK handles session creation, payment method selection, and polling. All you need is a public API key.

```html
<script src="https://js.zevpaycheckout.com/v1/inline.js"></script>
<script>
  var checkout = new ZevPay.ZevPayCheckout();
  checkout.checkout({
    apiKey: 'pk_test_your_public_key',
    email: 'customer@example.com',
    amount: 500000, // ₦5,000 in kobo
    onSuccess: function(reference) {
      alert('Payment complete! Ref: ' + reference);
    },
  });
</script>
```

[Full Inline Checkout guide](/checkout/inline)

## React

React components and hooks wrapping the Inline SDK. Use `<ZevPayButton>` for a drop-in button or `useZevPayCheckout()` for full control.

```tsx
import { ZevPayButton } from '@zevpay/react';

function CheckoutPage() {
  return (
    <ZevPayButton
      apiKey="pk_test_your_public_key"
      email="customer@example.com"
      amount={500000}
      onSuccess={(ref) => verifyPayment(ref)}
    >
      Pay ₦5,000
    </ZevPayButton>
  );
}
```

[Full React SDK documentation →](./react)

## Flutter

Accept payments in your Flutter mobile app. The SDK opens the standard checkout page in a WebView and returns the result via async/await.

```dart
import 'package:zevpay_checkout/zevpay_checkout.dart';

final result = await ZevPayCheckout.open(
  context: context,
  options: CheckoutOptions(
    apiKey: 'pk_test_your_public_key',
    email: 'customer@example.com',
    amount: 500000, // ₦5,000 in kobo
  ),
);

if (result.isSuccess) {
  print('Paid! Reference: ${result.reference}');
}
```

[Full Flutter SDK documentation →](./flutter)

## Standard Checkout

Redirect customers to a hosted checkout page. Create a session on your server, then redirect the customer using the returned URL.

```js
// Your server
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,
    currency: 'NGN',
    email: 'customer@example.com',
    callback_url: 'https://yoursite.com/payment/callback',
  }),
});

const { data } = await response.json();
// Redirect customer to: data.checkout_url
```

[Full Standard Checkout guide](/checkout/standard)

## Node.js SDK

Full REST API coverage from your server. Handle checkout sessions, transfers, invoices, PayIDs, virtual accounts, and webhook verification, all with TypeScript support.

```typescript
import ZevPay from '@zevpay/node';

const zevpay = new ZevPay('sk_test_your_secret_key');

// Initialize a checkout session
const session = await zevpay.checkout.initialize({
  amount: 500000, // ₦5,000 in kobo
  email: 'customer@example.com',
  reference: 'ORDER-123',
  callbackUrl: 'https://yoursite.com/callback',
});

// Send a bank transfer
const transfer = await zevpay.transfers.create({
  type: 'bank_transfer',
  amount: 1000000,
  accountNumber: '0123456789',
  bankCode: '044',
  accountName: 'John Doe',
  narration: 'Payout',
});
```

[Full Node.js SDK documentation →](./nodejs)

## PHP SDK

Full REST API coverage for PHP applications. Works with Laravel, WordPress, and any PHP 8.1+ project.

```php
use ZevPay\ZevPay;

$zevpay = new ZevPay('sk_test_your_secret_key');

$session = $zevpay->checkout->initialize([
    'amount' => 500000, // ₦5,000 in kobo
    'email' => 'customer@example.com',
    'reference' => 'ORDER-123',
    'callback_url' => 'https://yoursite.com/callback',
]);

echo $session['checkout_url'];
```

[Full PHP SDK documentation →](./php)

## Python SDK

Full REST API coverage for Python applications. Works with Django, FastAPI, Flask, and any Python 3.8+ project.

```python
from zevpay import ZevPay

client = ZevPay("sk_test_your_secret_key")

session = client.checkout.initialize(
    amount=500000,  # ₦5,000 in kobo
    email="customer@example.com",
    reference="ORDER-123",
    callback_url="https://yoursite.com/callback",
)

print(session["checkout_url"])
```

[Full Python SDK documentation →](./python)

## Laravel

Laravel integration wrapping the PHP SDK. Provides a service provider, facade, webhook controller with signature verification middleware, and event dispatching for all webhook types.

```php
use ZevPay\Laravel\Facades\ZevPay;

// Initialize a checkout session
$session = ZevPay::checkout()->initialize([
    'amount' => 500000, // ₦5,000 in kobo
    'email' => 'customer@example.com',
    'callback_url' => 'https://yoursite.com/callback',
]);

return redirect($session['checkout_url']);
```

- **Facade**: `ZevPay::checkout()`, `ZevPay::transfers()`, etc.
- **Webhooks**: Auto-registered route with signature verification
- **Events**: `ChargeSuccess`, `TransferSuccess`, `InvoicePaid`, etc.
- **Artisan**: `zevpay:verify-keys`, `zevpay:webhook-test`

[Full Laravel documentation →](./laravel)

## WooCommerce

Accept ZevPay payments in your WooCommerce store. Supports inline modal and standard (redirect) checkout modes, configurable payment methods, and webhook verification.

```php
// Automatic — just install, configure API keys, and choose your checkout mode.
// The plugin handles session creation, payment verification, and order updates.
```

- **Inline Mode**: Modal overlay on your checkout page
- **Standard Mode**: Redirect to ZevPay hosted checkout
- Configure payment methods per store or use Dashboard settings
- WooCommerce Blocks and HPOS compatible

[Full WooCommerce plugin documentation →](./woocommerce)

## Payment methods

Both SDKs support the same payment methods:

| Method | Key | Description |
|--------|-----|-------------|
| Bank Transfer | `bank` | Customer transfers to a virtual account |
| ZevPay ID | `payid` | Customer pays via ZevPay ID (P2P) |
| Card | `card` | Card payment (coming soon) |

## Amount format

All amounts are in **kobo** (the smallest currency unit for NGN):

| Naira amount | Kobo value |
|--------------|------------|
| ₦100 | `10000` |
| ₦1,000 | `100000` |
| ₦5,000 | `500000` |
| ₦50,000 | `5000000` |

::: warning
Minimum transaction amount is ₦100 (10,000 kobo).
:::

---

## Source: https://docs.zevpaycheckout.com/sdks/php
<!-- file: sdks/php.md -->

# PHP SDK

Official server-side SDK for integrating ZevPay Checkout in PHP applications. Provides full REST API coverage with Guzzle HTTP client.

## Installation

```bash
composer require zevpay/zevpay-php
```

Requires PHP 8.1 or later.

## Quick start

```php
use ZevPay\ZevPay;

$zevpay = new ZevPay('sk_test_your_secret_key');

// Initialize a checkout session
$session = $zevpay->checkout->initialize([
    'amount' => 500000, // ₦5,000 in kobo
    'email' => 'customer@example.com',
    'reference' => 'ORDER-123',
    'callback_url' => 'https://yoursite.com/callback',
]);

echo $session['checkout_url'];
```

## Configuration

```php
$zevpay = new ZevPay('sk_live_xxx', [
    'base_url' => 'https://api.zevpaycheckout.com', // default
    'timeout' => 30,     // 30s request timeout (default)
    'max_retries' => 2,  // retries on 5xx errors (default)
]);
```

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `base_url` | string | `https://api.zevpaycheckout.com` | API base URL |
| `timeout` | int | `30` | Request timeout in seconds |
| `max_retries` | int | `2` | Max retries on server errors |

::: warning Secret keys only
The SDK only accepts secret keys (`sk_live_*` or `sk_test_*`). Public keys cannot be used server-side.
:::

## Checkout sessions

### Initialize a session

```php
$session = $zevpay->checkout->initialize([
    'amount' => 500000,
    'email' => 'customer@example.com',
    'currency' => 'NGN',
    'reference' => 'ORDER-123',
    'callback_url' => 'https://yoursite.com/callback',
    'metadata' => ['order_id' => '123'],
    'payment_methods' => ['bank_transfer', 'payid'],
]);

// Redirect your customer to:
echo $session['checkout_url'];
```

### Verify a payment

```php
$result = $zevpay->checkout->verify($session['session_id']);

if ($result['status'] === 'completed') {
    echo 'Payment confirmed at: ' . $result['paid_at'];
}
```

### Get session details

```php
$details = $zevpay->checkout->get('ses_abc123');
```

## Transfers

### Bank transfer

```php
$transfer = $zevpay->transfers->create([
    'type' => 'bank_transfer',
    'amount' => 1000000, // ₦10,000
    'account_number' => '0123456789',
    'bank_code' => '044',
    'account_name' => 'John Doe',
    'narration' => 'Payout',
    'reference' => 'TXN-123',
]);
```

### PayID transfer

```php
$transfer = $zevpay->transfers->create([
    'type' => 'payid',
    'amount' => 500000,
    'pay_id' => 'johndoe',
    'narration' => 'Payment',
]);
```

### List, verify, resolve

```php
// List transfers
$transfers = $zevpay->transfers->list([
    'page' => 1,
    'page_size' => 20,
    'status' => 'completed',
]);

// Verify a transfer
$result = $zevpay->transfers->verify('TXN-123');

// List banks
$banks = $zevpay->transfers->listBanks();

// Resolve bank account
$account = $zevpay->transfers->resolveAccount([
    'account_number' => '0123456789',
    'bank_code' => '044',
]);
echo $account['account_name']; // 'JOHN DOE'

// Calculate fees
$charges = $zevpay->transfers->calculateCharges(['amount' => 1000000]);

// Get wallet balance
$balance = $zevpay->transfers->getBalance();
```

## Invoices

```php
// Create
$invoice = $zevpay->invoices->create([
    'customer_name' => 'Jane Doe',
    'customer_email' => 'jane@example.com',
    'due_date' => '2026-04-01',
    'line_items' => [
        ['description' => 'Web Design', 'quantity' => 1, 'unit_price' => 5000000],
        ['description' => 'Hosting (1yr)', 'quantity' => 1, 'unit_price' => 1200000],
    ],
    'tax_rate' => 7.5,
]);

// Send (draft → sent)
$zevpay->invoices->send($invoice['public_id']);

// List
$invoices = $zevpay->invoices->list(['status' => 'sent']);

// Cancel
$zevpay->invoices->cancel($invoice['public_id']);
```

## Static PayIDs

```php
// Create
$payid = $zevpay->staticPayId->create([
    'pay_id' => 'mystore',
    'name' => 'My Store',
    'description' => 'Accept payments to my store',
]);

// Deactivate / Reactivate
$zevpay->staticPayId->deactivate($payid['id']);
$zevpay->staticPayId->reactivate($payid['id']);
```

## Dynamic PayIDs

```php
// Create a time-limited payment link
$dpayid = $zevpay->dynamicPayId->create([
    'amount' => 1000000,
    'name' => 'Donation Drive',
    'expires_in_minutes' => 60,
]);

echo $dpayid['full_pay_id']; // e.g. 'donation-drive-xyz.dpay'

// Deactivate
$zevpay->dynamicPayId->deactivate($dpayid['id']);
```

## Virtual accounts

```php
// Create
$va = $zevpay->virtualAccounts->create([
    'amount' => 1000000,
    'validity_minutes' => 60,
]);

echo $va['account_number']; // Customer pays to this account

// List
$accounts = $zevpay->virtualAccounts->list(['status' => 'pending']);
```

## Wallet

```php
// Get wallet details
$wallet = $zevpay->wallet->get();

// List members
$members = $zevpay->wallet->listMembers();

// Add / remove members
$zevpay->wallet->addMember(['pay_id' => 'johndoe']);
$zevpay->wallet->removeMember('johndoe');
```

## Webhook verification

Verify incoming webhook signatures using your webhook secret:

```php
use ZevPay\Webhook;

$payload = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_ZEVPAY_SIGNATURE'] ?? '';
$secret = getenv('ZEVPAY_WEBHOOK_SECRET');

try {
    $event = Webhook::constructEvent($payload, $signature, $secret);

    switch ($event['event']) {
        case 'charge.success':
            // Handle successful checkout payment
            break;
        case 'transfer.success':
            // Handle successful transfer
            break;
        case 'transfer.failed':
            // Handle failed transfer
            break;
        case 'invoice.paid':
            // Handle paid invoice
            break;
    }

    http_response_code(200);
    echo 'OK';
} catch (\ZevPay\Exceptions\ZevPayException $e) {
    http_response_code(400);
    echo 'Invalid signature';
}
```

::: warning Always verify
Never process webhook events without verifying the signature. See [Verifying Signatures](/webhooks/signatures) for details.
:::

## Error handling

All API errors throw typed exceptions:

```php
use ZevPay\Exceptions\ValidationException;
use ZevPay\Exceptions\AuthenticationException;
use ZevPay\Exceptions\NotFoundException;
use ZevPay\Exceptions\ConflictException;
use ZevPay\Exceptions\RateLimitException;
use ZevPay\Exceptions\ApiException;

try {
    $zevpay->transfers->create([/* ... */]);
} catch (ValidationException $e) {
    // 400 — invalid parameters
    echo $e->errorCode;   // e.g. 'VALIDATION_ERROR'
    echo $e->getMessage(); // Human-readable message
    print_r($e->details);  // Field-level errors
} catch (AuthenticationException $e) {
    // 401 — invalid API key
} catch (NotFoundException $e) {
    // 404 — resource not found
} catch (ConflictException $e) {
    // 409 — duplicate transaction
} catch (RateLimitException $e) {
    // 429 — rate limit exceeded
    echo $e->retryAfter; // seconds to wait
} catch (ApiException $e) {
    // 500+ — server error
}
```

| Exception class | Status | When |
|-----------------|--------|------|
| `ValidationException` | 400 | Invalid request parameters |
| `AuthenticationException` | 401 | Invalid or missing API key |
| `PermissionException` | 403 | Insufficient permissions |
| `NotFoundException` | 404 | Resource not found |
| `ConflictException` | 409 | Duplicate resource |
| `RateLimitException` | 429 | Too many requests |
| `ApiException` | 500+ | Server error |

## Full example: Laravel

```php
// routes/web.php
use Illuminate\Http\Request;
use ZevPay\ZevPay;
use ZevPay\Webhook;

Route::post('/api/pay', function (Request $request) {
    $zevpay = new ZevPay(config('services.zevpay.secret'));

    $session = $zevpay->checkout->initialize([
        'amount' => $request->input('amount'),
        'email' => $request->input('email'),
        'reference' => 'ORDER-' . time(),
        'callback_url' => url('/api/callback'),
    ]);

    return response()->json(['checkout_url' => $session['checkout_url']]);
});

Route::get('/api/callback', function (Request $request) {
    $zevpay = new ZevPay(config('services.zevpay.secret'));
    $result = $zevpay->checkout->verify($request->query('session_id'));

    if ($result['status'] === 'completed') {
        return 'Payment successful!';
    }

    return 'Payment not completed yet.';
});

Route::post('/webhooks/zevpay', function (Request $request) {
    try {
        $event = Webhook::constructEvent(
            $request->getContent(),
            $request->header('x-zevpay-signature', ''),
            config('services.zevpay.webhook_secret'),
        );

        logger()->info('Webhook received', $event);
        return response('OK', 200);
    } catch (\Exception $e) {
        return response('Invalid signature', 400);
    }
});
```

## Resources

- [API Reference](/api/overview): Full endpoint documentation
- [Webhook Events](/webhooks/events): All event types
- [Packagist](https://packagist.org/packages/zevpay/zevpay-php): Package registry

---

## Source: https://docs.zevpaycheckout.com/sdks/python
<!-- file: sdks/python.md -->

# Python SDK

Official server-side SDK for integrating ZevPay Checkout in Python applications. Provides full REST API coverage with httpx HTTP client.

## Installation

```bash
pip install zevpay
```

Requires Python 3.8 or later.

## Quick start

```python
from zevpay import ZevPay

client = ZevPay("sk_test_your_secret_key")

# Initialize a checkout session
session = client.checkout.initialize(
    amount=500000,  # ₦5,000 in kobo
    email="customer@example.com",
    reference="ORDER-123",
    callback_url="https://yoursite.com/callback",
)

print(session["checkout_url"])
```

## Configuration

```python
client = ZevPay(
    "sk_live_xxx",
    base_url="https://api.zevpaycheckout.com",  # default
    timeout=30,      # 30s request timeout (default)
    max_retries=2,   # retries on 5xx errors (default)
)
```

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `base_url` | str | `https://api.zevpaycheckout.com` | API base URL |
| `timeout` | int | `30` | Request timeout in seconds |
| `max_retries` | int | `2` | Max retries on server errors |

::: warning Secret keys only
The SDK only accepts secret keys (`sk_live_*` or `sk_test_*`). Public keys cannot be used server-side.
:::

## Checkout sessions

### Initialize a session

```python
session = client.checkout.initialize(
    amount=500000,
    email="customer@example.com",
    currency="NGN",
    reference="ORDER-123",
    callback_url="https://yoursite.com/callback",
    metadata={"order_id": "123"},
    payment_methods=["bank_transfer", "payid"],
)

# Redirect your customer to:
print(session["checkout_url"])
```

### Verify a payment

```python
result = client.checkout.verify(session["session_id"])

if result["status"] == "completed":
    print(f"Payment confirmed at: {result['paid_at']}")
```

### Get session details

```python
details = client.checkout.get("ses_abc123")
```

## Transfers

### Bank transfer

```python
transfer = client.transfers.create(
    type="bank_transfer",
    amount=1000000,  # ₦10,000
    account_number="0123456789",
    bank_code="044",
    account_name="John Doe",
    narration="Payout",
    reference="TXN-123",
)
```

### PayID transfer

```python
transfer = client.transfers.create(
    type="payid",
    amount=500000,
    pay_id="johndoe",
    narration="Payment",
)
```

### List, verify, resolve

```python
# List transfers
transfers = client.transfers.list(
    page=1,
    page_size=20,
    status="completed",
)

# Verify a transfer
result = client.transfers.verify("TXN-123")

# List banks
banks = client.transfers.list_banks()

# Resolve bank account
account = client.transfers.resolve_account(
    account_number="0123456789",
    bank_code="044",
)
print(account["account_name"])  # 'JOHN DOE'

# Calculate fees
charges = client.transfers.calculate_charges(amount=1000000)

# Get wallet balance
balance = client.transfers.get_balance()
```

## Invoices

```python
# Create
invoice = client.invoices.create(
    customer_name="Jane Doe",
    customer_email="jane@example.com",
    due_date="2026-04-01",
    line_items=[
        {"description": "Web Design", "quantity": 1, "unit_price": 5000000},
        {"description": "Hosting (1yr)", "quantity": 1, "unit_price": 1200000},
    ],
    tax_rate=7.5,
)

# Send (draft → sent)
client.invoices.send(invoice["public_id"])

# List
invoices = client.invoices.list(status="sent")

# Cancel
client.invoices.cancel(invoice["public_id"])
```

## Static PayIDs

```python
# Create
payid = client.static_payid.create(
    pay_id="mystore",
    name="My Store",
    description="Accept payments to my store",
)

# Deactivate / Reactivate
client.static_payid.deactivate(payid["id"])
client.static_payid.reactivate(payid["id"])
```

## Dynamic PayIDs

```python
# Create a time-limited payment link
dpayid = client.dynamic_payid.create(
    amount=1000000,
    name="Donation Drive",
    expires_in_minutes=60,
)

print(dpayid["full_pay_id"])  # e.g. 'donation-drive-xyz.dpay'

# Deactivate
client.dynamic_payid.deactivate(dpayid["id"])
```

## Virtual accounts

```python
# Create
va = client.virtual_accounts.create(
    amount=1000000,
    validity_minutes=60,
)

print(va["account_number"])  # Customer pays to this account

# List
accounts = client.virtual_accounts.list(status="pending")
```

## Wallet

```python
# Get wallet details
wallet = client.wallet.get()

# List members
members = client.wallet.list_members()

# Add / remove members
client.wallet.add_member(pay_id="johndoe")
client.wallet.remove_member("johndoe")
```

## Webhook verification

Verify incoming webhook signatures using your webhook secret:

```python
import os
from zevpay import Webhook, ZevPayError

# In your webhook handler (e.g. Flask, Django, FastAPI)
payload = request.get_data(as_text=True)
signature = request.headers.get("x-zevpay-signature", "")
secret = os.environ["ZEVPAY_WEBHOOK_SECRET"]

try:
    event = Webhook.construct_event(payload, signature, secret)

    if event["event"] == "charge.success":
        # Handle successful checkout payment
        pass
    elif event["event"] == "transfer.success":
        # Handle successful transfer
        pass
    elif event["event"] == "transfer.failed":
        # Handle failed transfer
        pass
    elif event["event"] == "invoice.paid":
        # Handle paid invoice
        pass

    return "OK", 200
except ZevPayError:
    return "Invalid signature", 400
```

::: warning Always verify
Never process webhook events without verifying the signature. See [Verifying Signatures](/webhooks/signatures) for details.
:::

## Error handling

All API errors raise typed exceptions:

```python
from zevpay import (
    ZevPay,
    ValidationError,
    AuthenticationError,
    NotFoundError,
    ConflictError,
    RateLimitError,
    ApiError,
)

client = ZevPay("sk_test_your_secret_key")

try:
    client.transfers.create(type="bank_transfer", amount=1000000)
except ValidationError as e:
    # 400 — invalid parameters
    print(e.code)     # e.g. 'VALIDATION_ERROR'
    print(e.message)  # Human-readable message
except AuthenticationError:
    # 401 — invalid API key
    pass
except NotFoundError:
    # 404 — resource not found
    pass
except ConflictError:
    # 409 — duplicate transaction
    pass
except RateLimitError:
    # 429 — rate limit exceeded
    pass
except ApiError:
    # 500+ — server error
    pass
```

| Exception class | Status | When |
|-----------------|--------|------|
| `ValidationError` | 400 | Invalid request parameters |
| `AuthenticationError` | 401 | Invalid or missing API key |
| `ForbiddenError` | 403 | Insufficient permissions |
| `NotFoundError` | 404 | Resource not found |
| `ConflictError` | 409 | Duplicate resource |
| `RateLimitError` | 429 | Too many requests |
| `ApiError` | 500+ | Server error |

## Context manager

The client can be used as a context manager to ensure the HTTP connection is properly closed:

```python
with ZevPay("sk_test_your_secret_key") as client:
    session = client.checkout.initialize(
        amount=500000,
        email="customer@example.com",
    )
```

## Full example: FastAPI

```python
import os
from fastapi import FastAPI, Request
from fastapi.responses import JSONResponse, RedirectResponse
from zevpay import ZevPay, Webhook, ZevPayError

app = FastAPI()
zevpay = ZevPay(os.environ["ZEVPAY_SECRET_KEY"])


@app.post("/api/pay")
async def create_payment(request: Request):
    body = await request.json()

    session = zevpay.checkout.initialize(
        amount=body["amount"],
        email=body["email"],
        reference=f"ORDER-{body['order_id']}",
        callback_url=str(request.url_for("payment_callback")),
    )

    return {"checkout_url": session["checkout_url"]}


@app.get("/api/callback")
async def payment_callback(session_id: str):
    result = zevpay.checkout.verify(session_id)

    if result["status"] == "completed":
        return {"message": "Payment successful!"}

    return {"message": "Payment not completed yet."}


@app.post("/webhooks/zevpay")
async def webhook_handler(request: Request):
    payload = (await request.body()).decode()
    signature = request.headers.get("x-zevpay-signature", "")

    try:
        event = Webhook.construct_event(
            payload, signature, os.environ["ZEVPAY_WEBHOOK_SECRET"]
        )
        print(f"Webhook received: {event['event']}")
        return {"status": "ok"}
    except ZevPayError:
        return JSONResponse({"error": "Invalid signature"}, status_code=400)
```

## Resources

- [API Reference](/api/overview): Full endpoint documentation
- [Webhook Events](/webhooks/events): All event types
- [PyPI](https://pypi.org/project/zevpay/): Package registry

---

## Source: https://docs.zevpaycheckout.com/sdks/react-native
<!-- file: sdks/react-native.md -->

# React Native

Accept payments in your React Native app. The SDK opens the ZevPay checkout page in a WebView modal and returns the result when payment completes.

## Installation

```bash
npm install @zevpay/react-native react-native-webview
```

For iOS:

```bash
cd ios && pod install
```

Requires React Native 0.72+ and `react-native-webview` 13+.

## Quick start

```tsx
import { useState } from 'react';
import { Button } from 'react-native';
import { ZevPayCheckout } from '@zevpay/react-native';

function CheckoutScreen() {
  const [visible, setVisible] = useState(false);

  return (
    <>
      <Button title="Pay ₦5,000" onPress={() => setVisible(true)} />

      <ZevPayCheckout
        visible={visible}
        publicKey="pk_test_your_public_key"
        email="customer@example.com"
        amount={500000}
        onSuccess={(data) => {
          setVisible(false);
          console.log('Paid! Reference:', data.reference);
          // Verify payment on your server
        }}
        onCancel={() => setVisible(false)}
      />
    </>
  );
}
```

## Component API

### `<ZevPayCheckout>`

A modal component that renders the checkout page in a WebView.

```tsx
<ZevPayCheckout
  visible={true}
  publicKey="pk_test_xxx"
  email="customer@example.com"
  amount={500000}
  reference="ORDER-123"
  firstName="John"
  lastName="Doe"
  metadata={{ orderId: '123' }}
  paymentMethods={['bank_transfer', 'payid']}
  onSuccess={(data) => console.log(data.reference)}
  onCancel={() => setVisible(false)}
  onError={(error) => console.error(error)}
/>
```

### Props

| Prop | Type | Required | Description |
|------|------|----------|-------------|
| `visible` | `boolean` | Yes | Show/hide the modal |
| `publicKey` | `string` | Yes | Your public key (`pk_live_*` or `pk_test_*`) |
| `email` | `string` | Yes | Customer email |
| `amount` | `number` | Yes | Amount in kobo (₦1 = 100 kobo) |
| `currency` | `string` | No | Currency code (default: `NGN`) |
| `reference` | `string` | No | Your unique transaction reference |
| `firstName` | `string` | No | Customer first name |
| `lastName` | `string` | No | Customer last name |
| `metadata` | `object` | No | Additional metadata |
| `paymentMethods` | `string[]` | No | `bank_transfer`, `payid`, `card` |
| `onSuccess` | `function` | Yes | Called with `{ reference, params }` |
| `onCancel` | `function` | Yes | Called when user closes the modal |
| `onError` | `function` | No | Called on WebView errors |

## Hook API

### `useZevPayCheckout()`

A Promise-based hook for imperative checkout flow.

```tsx
import { ZevPayCheckout, useZevPayCheckout } from '@zevpay/react-native';

function CheckoutScreen() {
  const checkout = useZevPayCheckout();

  const handlePay = async () => {
    const result = await checkout.open({
      publicKey: 'pk_test_your_public_key',
      email: 'customer@example.com',
      amount: 500000,
    });

    if (result.success) {
      console.log('Paid!', result.reference);
      // Verify payment on your server
    } else if (result.cancelled) {
      console.log('User cancelled');
    } else if (result.error) {
      console.error('Error:', result.error);
    }
  };

  return (
    <>
      <Button title="Pay" onPress={handlePay} />

      {checkout.options && (
        <ZevPayCheckout
          visible={checkout.visible}
          onSuccess={checkout.onSuccess}
          onCancel={checkout.onCancel}
          onError={checkout.onError}
          {...checkout.options}
        />
      )}
    </>
  );
}
```

### Return value

| Property | Type | Description |
|----------|------|-------------|
| `open` | `(options) => Promise<CheckoutResult>` | Opens checkout, resolves on completion |
| `close` | `() => void` | Programmatically close the modal |
| `visible` | `boolean` | Current modal visibility |
| `options` | `CheckoutOptions \| null` | Current checkout options |
| `onSuccess` | `function` | Pass to `<ZevPayCheckout>` |
| `onCancel` | `function` | Pass to `<ZevPayCheckout>` |
| `onError` | `function` | Pass to `<ZevPayCheckout>` |

### `CheckoutResult`

```typescript
interface CheckoutResult {
  success: boolean;     // Payment was successful
  cancelled: boolean;   // User cancelled
  reference?: string;   // Payment reference (when successful)
  error?: Error;        // Error (when failed)
}
```

## Server-side verification

::: warning Always verify on your server
The client-side callback only indicates the user completed the flow. Always verify the payment on your server using the reference.
:::

```typescript
// Your server (Node.js example)
import ZevPay from '@zevpay/node';

const zevpay = new ZevPay('sk_test_your_secret_key');
const session = await zevpay.checkout.verify(reference);

if (session.status === 'completed') {
  // Payment is confirmed
}
```

## Resources

- [API Reference](/api/overview): Full endpoint documentation
- [Standard Checkout](/checkout/standard) is the underlying checkout flow
- [Webhook Events](/webhooks/events): All event types
- [npm](https://www.npmjs.com/package/@zevpay/react-native): Package registry

---

## Source: https://docs.zevpaycheckout.com/sdks/react
<!-- file: sdks/react.md -->

# React SDK

React components and hooks for integrating ZevPay Checkout. Wraps [Inline Checkout](/checkout/inline) with idiomatic React APIs.

## Installation

```bash
npm install @zevpay/react @zevpay/inline
```

Requires React 18 or later.

## Quick start

### Button component

The simplest way to add checkout. It renders a button that opens the payment modal on click:

```tsx
import { ZevPayButton } from '@zevpay/react';

function CheckoutPage() {
  return (
    <ZevPayButton
      apiKey="pk_test_your_public_key"
      email="customer@example.com"
      amount={500000} // ₦5,000 in kobo
      onSuccess={(reference) => {
        console.log('Payment successful:', reference);
        // Verify payment on your server
      }}
    >
      Pay ₦5,000
    </ZevPayButton>
  );
}
```

### Hook

For custom UI, call `openCheckout()` from any event handler:

```tsx
import { useZevPayCheckout } from '@zevpay/react';

function CheckoutPage() {
  const { openCheckout } = useZevPayCheckout({
    apiKey: 'pk_test_your_public_key',
    onSuccess: (reference) => {
      console.log('Paid:', reference);
    },
    onClose: () => {
      console.log('Modal closed');
    },
  });

  return (
    <button onClick={() => openCheckout({
      email: 'customer@example.com',
      amount: 500000,
      reference: 'ORDER-123',
      firstName: 'John',
      lastName: 'Doe',
    })}>
      Pay ₦5,000
    </button>
  );
}
```

### Provider (shared API key)

Wrap your app in `<ZevPayProvider>` to avoid repeating `apiKey` on every component:

```tsx
import { ZevPayProvider, ZevPayButton } from '@zevpay/react';

function App() {
  return (
    <ZevPayProvider apiKey="pk_test_your_public_key">
      <StorePage />
    </ZevPayProvider>
  );
}

function StorePage() {
  // No apiKey needed — inherited from provider
  return (
    <ZevPayButton email="customer@example.com" amount={500000}>
      Pay ₦5,000
    </ZevPayButton>
  );
}
```

## `<ZevPayButton />`

A button that opens ZevPay Checkout on click.

### Props

| Prop | Type | Required | Description |
|------|------|----------|-------------|
| `apiKey` | `string` | Yes* | Your public API key (`pk_live_*` or `pk_test_*`) |
| `email` | `string` | Yes | Customer email address |
| `amount` | `number` | Yes | Amount in kobo (₦1 = 100 kobo) |
| `currency` | `string` | No | Currency code. Default: `"NGN"` |
| `reference` | `string` | No | Your unique transaction reference |
| `firstName` | `string` | No | Customer first name |
| `lastName` | `string` | No | Customer last name |
| `metadata` | `object` | No | Custom metadata attached to the transaction |
| `paymentMethods` | `"all"` \| `string[]` | No | Payment methods to show |
| `onSuccess` | `(reference: string) => void` | No | Called when payment is confirmed |
| `onClose` | `() => void` | No | Called when the modal closes |
| `onError` | `(error: Error) => void` | No | Called on error |
| `onFailure` | `(error?: Error) => void` | No | Called when payment fails |
| `onExpired` | `() => void` | No | Called when session expires |
| `onInitialize` | `() => void` | No | Called when session initializes |
| `children` | `ReactNode` | No | Button content. Default: `"Pay Now"` |
| `className` | `string` | No | CSS class name for the button |
| `disabled` | `boolean` | No | Whether the button is disabled |

*Required unless `<ZevPayProvider>` is used.

### Examples

```tsx
// Minimal
<ZevPayButton
  apiKey="pk_test_xxx"
  email="customer@example.com"
  amount={500000}
  onSuccess={(ref) => verifyPayment(ref)}
>
  Pay
</ZevPayButton>

// With all options
<ZevPayButton
  apiKey="pk_test_xxx"
  email="customer@example.com"
  amount={500000}
  currency="NGN"
  reference="ORDER-123"
  firstName="John"
  lastName="Doe"
  metadata={{ orderId: '123' }}
  paymentMethods={['bank', 'payid']}
  className="btn btn-primary"
  onSuccess={(ref) => verifyPayment(ref)}
  onClose={() => console.log('closed')}
  onError={(err) => console.error(err)}
>
  Pay ₦5,000
</ZevPayButton>
```

## `useZevPayCheckout(config)`

Hook for imperative checkout control.

### Config

Shared options that persist across calls:

| Option | Type | Description |
|--------|------|-------------|
| `apiKey` | `string` | Public API key (or use `<ZevPayProvider>`) |
| `currency` | `string` | Currency code |
| `paymentMethods` | `"all"` \| `string[]` | Payment methods to enable |
| `onSuccess` | `function` | Success callback |
| `onClose` | `function` | Close callback |
| `onError` | `function` | Error callback |
| `onFailure` | `function` | Failure callback |
| `onExpired` | `function` | Expiry callback |
| `onInitialize` | `function` | Init callback |

### Return value

| Property | Type | Description |
|----------|------|-------------|
| `openCheckout` | `(params) => void` | Opens the checkout modal |

### `openCheckout` params

Per-call parameters:

| Param | Type | Required | Description |
|-------|------|----------|-------------|
| `email` | `string` | Yes | Customer email |
| `amount` | `number` | Yes | Amount in kobo |
| `reference` | `string` | No | Transaction reference |
| `firstName` | `string` | No | Customer first name |
| `lastName` | `string` | No | Customer last name |
| `metadata` | `object` | No | Custom metadata |

### Example

```tsx
function DonationPage() {
  const [email, setEmail] = useState('');
  const [amount, setAmount] = useState(0);

  const { openCheckout } = useZevPayCheckout({
    apiKey: 'pk_test_xxx',
    onSuccess: (reference) => {
      fetch('/api/verify', {
        method: 'POST',
        body: JSON.stringify({ reference }),
      });
    },
  });

  return (
    <form onSubmit={(e) => {
      e.preventDefault();
      openCheckout({ email, amount: amount * 100 });
    }}>
      <input
        type="email"
        value={email}
        onChange={(e) => setEmail(e.target.value)}
        placeholder="Your email"
      />
      <input
        type="number"
        value={amount}
        onChange={(e) => setAmount(Number(e.target.value))}
        placeholder="Amount in Naira"
      />
      <button type="submit">Donate</button>
    </form>
  );
}
```

## `<ZevPayProvider>`

Context provider for sharing configuration across components.

| Prop | Type | Required | Description |
|------|------|----------|-------------|
| `apiKey` | `string` | Yes | Shared public API key |
| `children` | `ReactNode` | Yes | Child components |

Both `<ZevPayButton>` and `useZevPayCheckout()` will inherit the API key from the nearest provider. A direct `apiKey` prop/config always takes priority over the provider.

## Payment methods

```tsx
// All methods (default)
<ZevPayButton paymentMethods="all" ... />

// Specific methods
<ZevPayButton paymentMethods={['bank', 'payid']} ... />

// Bank transfer only
<ZevPayButton paymentMethods={['bank']} ... />
```

| Method | Value | Status |
|--------|-------|--------|
| Bank Transfer | `"bank"` | Available |
| ZevPay ID | `"payid"` | Available |
| Card | `"card"` | Coming soon |

## Verify payments

::: warning Always verify server-side
Never trust the client-side `onSuccess` callback alone. Always verify the payment on your server.
:::

```typescript
// Server-side (Node.js)
import ZevPay from '@zevpay/node';

const zevpay = new ZevPay('sk_live_xxx');
const result = await zevpay.checkout.verify(sessionId);

if (result.status === 'completed') {
  // Payment confirmed — fulfill the order
}
```

## TypeScript

All types are exported:

```tsx
import type {
  ZevPayCheckoutOptions,
  ZevPayButtonProps,
  UseZevPayConfig,
  OpenCheckoutParams,
  UseZevPayReturn,
  PaymentMethodOption,
} from '@zevpay/react';
```

Error types from the inline SDK are also re-exported:

```tsx
import { CheckoutError } from '@zevpay/react';
```

## Resources

- [API Reference](/api/overview): Full endpoint documentation
- [Inline Checkout](/checkout/inline) is the underlying checkout SDK
- [Webhook Events](/webhooks/events): All event types
- [npm](https://www.npmjs.com/package/@zevpay/react): Package registry

---

## Source: https://docs.zevpaycheckout.com/sdks/woocommerce
<!-- file: sdks/woocommerce.md -->

# WooCommerce

Official WooCommerce payment gateway plugin for ZevPay Checkout. Supports inline modal and standard (redirect) checkout flows.

## Installation

1. Download the plugin from the [WordPress Plugin Directory](https://wordpress.org/plugins/zevpay-checkout-for-woocommerce/) or install via **Plugins > Add New** in WordPress
2. Activate the plugin
3. Go to **WooCommerce > Settings > Payments > ZevPay Checkout**
4. Enter your API keys

Requires WordPress 5.8+, WooCommerce 7.0+, and PHP 7.4+.

## Configuration

### API keys

Enter your public and secret keys from the [ZevPay Dashboard](https://dashboard.zevpaycheckout.com):

| Field | Description |
|-------|-------------|
| Public API Key | `pk_live_*` or `pk_test_*` |
| Secret API Key | `sk_live_*` or `sk_test_*` |
| Webhook Secret | Signing secret from your Dashboard |

### Checkout mode

Choose between two checkout experiences:

| Mode | Description |
|------|-------------|
| **Inline Modal** | Opens the ZevPay payment form in a modal overlay on your site. The customer never leaves your checkout page. |
| **Standard (Redirect)** | Redirects the customer to the ZevPay hosted checkout page to complete payment. |

### Payment methods

Select which payment methods to offer:

- **Bank Transfer**: Customer transfers to a virtual account
- **PayID**: Customer pays via ZevPay ID
- **Card**: Card payment

Leave the selection empty to use whatever methods you configured in your ZevPay Dashboard.

### Pass order details (Standard mode)

When enabled, the plugin forwards order metadata to the hosted checkout page:

- Customer name and email
- Order reference
- Order ID and key in metadata

## How it works

### Inline flow

```
Customer → Checkout → Order Pay Page → "Pay with ZevPay" button
         → Modal opens → Customer pays → AJAX verify → Order complete
         → Webhook confirms asynchronously
```

1. Customer selects ZevPay Checkout as their payment method
2. After placing the order, they are redirected to the order-pay page
3. Clicking "Pay with ZevPay" loads the inline SDK and opens the payment modal
4. Customer completes payment in the modal
5. The frontend sends an AJAX request to verify the payment via the ZevPay API
6. If verified, the order is marked as paid and the customer sees the thank-you page
7. A webhook event confirms the payment asynchronously

### Standard flow

```
Customer → Checkout → Server initializes session → Redirect to ZevPay
         → Customer pays on hosted page → Redirect back → Verify → Order complete
         → Webhook confirms asynchronously
```

1. Customer selects ZevPay Checkout as their payment method
2. The plugin initializes a checkout session via the ZevPay API (using the [PHP SDK](/sdks/php))
3. Customer is redirected to the ZevPay hosted checkout page
4. Customer completes payment
5. Redirected back to WooCommerce where the session is verified
6. Order is marked as paid
7. A webhook event confirms the payment asynchronously

## Webhook setup

1. In the plugin settings page, copy the **webhook URL** shown in the info box
2. Go to your [ZevPay Dashboard](https://dashboard.zevpaycheckout.com) webhook settings
3. Paste the URL and save
4. Copy the **webhook secret** and paste it in the plugin's "Webhook Secret" field

The plugin uses the [PHP SDK's `Webhook::constructEvent()`](/sdks/php#webhook-verification) to verify the `x-zevpay-signature` header.

::: warning Always configure webhooks
Webhooks provide reliable server-to-server payment confirmation. The inline callback and standard redirect are customer-initiated and may fail if the customer closes their browser. Webhooks ensure your orders are always updated.
:::

## Settings reference

| Setting | Type | Default | Description |
|---------|------|---------|-------------|
| Enable/Disable | Checkbox | Off | Enable the gateway |
| Title | Text | "ZevPay Checkout" | Payment method title at checkout |
| Description | Textarea | "Pay securely..." | Description below the title |
| Public API Key | Text | None | Your `pk_live_*` or `pk_test_*` key |
| Secret API Key | Password | None | Your `sk_live_*` or `sk_test_*` key |
| Webhook Secret | Password | None | Webhook signing secret |
| Checkout Mode | Select | Inline | `inline` or `standard` |
| Payment Methods | Multiselect | None | Bank Transfer, PayID, Card (empty = Dashboard settings) |
| Pass Order Details | Checkbox | On | Send order info in Standard mode |
| Logging | Checkbox | Off | Debug logs in WooCommerce > Status > Logs |

## Compatibility

| Feature | Status |
|---------|--------|
| WooCommerce Blocks | Supported |
| HPOS (High-Performance Order Storage) | Supported |
| Classic checkout | Supported |
| WordPress Multisite | Supported |

## Troubleshooting

### Gateway not appearing at checkout

- Verify the gateway is enabled in **WooCommerce > Settings > Payments**
- Confirm your store currency is set to **NGN** (Nigerian Naira)
- Check that both public and secret API keys are entered

### Payment not confirming

- Verify your webhook URL is correctly configured in the ZevPay Dashboard
- Check the webhook secret matches
- Enable logging and check **WooCommerce > Status > Logs** for errors

### Debug logging

Enable "Logging" in the plugin settings. Logs appear in **WooCommerce > Status > Logs** with source `zevpay_checkout`.

## Resources

- [API Reference](/api/overview): Full endpoint documentation
- [PHP SDK](/sdks/php): Server-side SDK used by this plugin
- [Webhook Events](/webhooks/events): All event types
- [WordPress Plugin Directory](https://wordpress.org/plugins/zevpay-checkout-for-woocommerce/): Plugin page

---

## Source: https://docs.zevpaycheckout.com/webhooks/events
<!-- file: webhooks/events.md -->

# Events Reference

::: tip If a webhook never arrives
Every payment we report can also be fetched. See [Recovering from a missed webhook](/guide/webhook-recovery) for the endpoint to call per payment type, and why your handler should be idempotent before you add a reconciliation pass.
:::


This page documents all webhook event types, their payloads, and when they are triggered.

## charge.success

Sent when a checkout payment is completed successfully. This is the primary event you should handle to fulfill orders.

### When it fires

Any successful checkout payment, whichever method the customer used:

- Customer completes a bank transfer to the virtual account (`channel: "bank_transfer"`)
- Customer sends payment via ZevPay ID (`channel: "payid"`)
- Customer pays with a card (`channel: "card"`)
- Customer pays with crypto (`channel: "crypto"`)
- Customer pays with PalmPay (`channel: "palmpay"`)
- A transfer lands in one of your [Static NGN Accounts](/guide/static-accounts) (`channel: "static_account"`)

The payload is the same shape for every channel; only `channel` and the `payer` object differ.

### Payload

```json
{
  "event": "charge.success",
  "data": {
    "reference": "ZVP-CKO-S-abc123",
    "merchant_reference": "order_12345",
    "amount": 500000,
    "currency": "NGN",
    "status": "completed",
    "channel": "bank_transfer",
    "customer": {
      "email": "customer@example.com",
      "name": "John Doe"
    },
    "metadata": {
      "orderId": "12345"
    },
    "paid_at": "2026-03-07T19:42:00.000Z",
    "fees": 7500,
    "payer": {
      "name": "John Doe",
      "bank": "GTBank",
      "account": "0123456789"
    }
  }
}
```

### Fields

| Field | Type | Description |
|-------|------|-------------|
| `reference` | string | ZevPay transaction reference |
| `merchant_reference` | string \| null | Your custom reference (if provided during initialization) |
| `amount` | integer | Amount in kobo |
| `currency` | string | Currency code (e.g., `"NGN"`) |
| `status` | string | Always `"completed"` for this event |
| `channel` | string | Payment channel: `"bank_transfer"`, `"payid"`, `"card"`, `"crypto"`, `"palmpay"`, or `"static_account"` |
| `customer.email` | string | Customer's email address |
| `customer.name` | string \| null | Customer's name |
| `metadata` | object \| null | Custom metadata from session initialization |
| `line_items` | array \| null | The session's line items, if any were set at initialization |
| `paid_at` | string | ISO 8601 timestamp of payment confirmation |
| `fees` | integer | Transaction fees in kobo |
| `payer` | object | Payer information (varies by channel) |

### Payer object by channel

#### Bank transfer

When `channel` is `"bank_transfer"`:

```json
{
  "payer": {
    "name": "John Doe",
    "bank": "GTBank",
    "account": "0123456789"
  },
  "fees": 7500
}
```

| Field | Type | Description |
|-------|------|-------------|
| `payer.name` | string | Sender's name |
| `payer.bank` | string | Sender's bank name |
| `payer.account` | string | Sender's account number |
| `fees` | integer | Transaction fees in kobo |

#### PayID

When `channel` is `"payid"`:

```json
{
  "payer": {
    "name": "John Doe"
  }
}
```

| Field | Type | Description |
|-------|------|-------------|
| `payer.name` | string | Sender's ZevPay name |

::: info
PayID payments do not include `fees`, `payer.bank`, or `payer.account` fields.
:::

#### Card

When `channel` is `"card"`, the event carries a `card` object (no `payer.bank`/`payer.account`):

```json
{
  "payer": {
    "name": "John Doe"
  },
  "card": {
    "masked_pan": "506066******7699",
    "card_type": "verve"
  },
  "fees": 5000
}
```

| Field | Type | Description |
|-------|------|-------------|
| `card.masked_pan` | string | Masked card number (first 6 + last 4). Never the full PAN. |
| `card.card_type` | string | Card scheme, e.g. `verve`, `mastercard`, `visa`. |
| `fees` | integer | Transaction fees in kobo |

#### Crypto

When `channel` is `"crypto"`, the event carries a `crypto` object:

```json
{
  "payer": {
    "name": "John Doe"
  },
  "crypto": {
    "asset": "USDT",
    "network": "TRON",
    "amount": "10.500000"
  },
  "fees": 5000
}
```

| Field | Type | Description |
|-------|------|-------------|
| `crypto.asset` | string | Asset the customer paid with, e.g. `USDT`. |
| `crypto.network` | string | Network the payment arrived on, e.g. `TRON`. Uses our network identifiers, see [Assets and networks](/payment-methods/crypto#assets-and-networks). The same asset on another network is a different pair; reconcile on `asset` and `network` together. |
| `crypto.amount` | string | Amount in the crypto asset's own units, as a decimal string. |
| `fees` | integer | Transaction fees in kobo |

#### Static NGN Account

When `channel` is `"static_account"`, the payment came into a permanent account you issued to a customer. There is no checkout session: `reference` is the payment's transaction reference, `merchant_reference` is the account's `reference`, and `customer` and `metadata` come from the account. A `static_account` object identifies the account:

```json
{
  "event": "charge.success",
  "data": {
    "reference": "ZVP-CKOTX-1789...",
    "merchant_reference": "customer-1042",
    "amount": 2500000,
    "currency": "NGN",
    "status": "completed",
    "channel": "static_account",
    "customer": { "email": "adaeze@example.com", "name": "Adaeze Okafor" },
    "metadata": { "plan": "pro" },
    "line_items": null,
    "paid_at": "2026-09-08T09:12:45.000Z",
    "fees": 37500,
    "net_amount": 2462500,
    "static_account": {
      "id": "V1StGXR8_Z5jdHi6B-myT",
      "account_number": "6641234567",
      "account_name": "Adaeze Okafor",
      "bank_name": "PalmPay",
      "reference": "customer-1042",
      "customer_name": "Adaeze Okafor"
    },
    "payer": { "name": "ADAEZE OKAFOR", "bank": "GTBank", "account": "0123456789" },
    "narration": "Top up",
    "session_id": "000013250908091200000123456789"
  }
}
```

| Field | Type | Description |
|-------|------|-------------|
| `static_account.id` | string | The account that was paid. Use it to look the customer up on your side |
| `static_account.account_number` | string | The NUBAN that received the transfer |
| `static_account.reference` | string \| null | Your reference on the account (also in `merchant_reference`) |
| `net_amount` | integer | Amount after fees, in kobo |
| `payer` | object | Sender's name, bank and account number as reported by the bank |
| `narration` | string \| null | Transfer narration, when the sender's bank supplied one |
| `session_id` | string \| null | NIP session id, when the channel returned one |

The same transfer never fires twice; retries of a delivery carry the same `reference`, so deduplicate on it.

## charge.refunded

Sent when a payment has been returned to the payer after a [refund request](/guide/payment-lifecycle#refunds). The `reference` is the same one you received on `charge.success`; the transaction now shows as `refunded` and is excluded from settlement.

`channel` tells you which rail was refunded: `"bank_transfer"`, `"card"`, `"palmpay"` or `"static_account"`. The `static_account` object below is present only on that rail. A declined refund fires no event: the payment simply settles to you as normal.

### Payload

```json
{
  "event": "charge.refunded",
  "data": {
    "reference": "ZVP-CKOTX-1789...",
    "merchant_reference": "customer-1042",
    "amount": 2500000,
    "refunded_amount": 2500000,
    "currency": "NGN",
    "status": "refunded",
    "channel": "static_account",
    "refund": {
      "id": "V1StGXR8_Z5jdHi6B-myT",
      "reason": "Duplicate payment",
      "requested_at": "2026-09-08T10:02:11.000Z",
      "completed_at": "2026-09-08T10:41:57.000Z"
    },
    "static_account": {
      "id": "V1StGXR8_Z5jdHi6B-myT",
      "account_number": "6641234567",
      "account_name": "Adaeze Okafor",
      "bank_name": "PalmPay",
      "reference": "customer-1042",
      "customer_name": "Adaeze Okafor"
    },
    "payer": { "name": "ADAEZE OKAFOR", "bank": "GTBank", "account": "0123456789" },
    "refunded_at": "2026-09-08T10:41:57.000Z"
  }
}
```

| Field | Type | Description |
|-------|------|-------------|
| `reference` | string | The original payment's reference |
| `refunded_amount` | integer | Amount returned to the payer, in kobo |
| `refund.id` | string | The refund id from the [refund API](/api/static-account#refunds) |

The example above is a Static NGN Account refund. On other rails the payload is identical minus `static_account`, with `channel` set to the rail the customer paid on.

## Invoice events: base fields

All invoice webhook events share the same base payload structure. These fields are always present:

| Field | Type | Description |
|-------|------|-------------|
| `public_id` | string | Unique public identifier for the invoice |
| `invoice_number` | string | Invoice number (auto-generated or custom) |
| `status` | string | Current status: `draft`, `sent`, `partial`, `paid`, `overdue`, `cancelled` |
| `customer_name` | string | Customer name |
| `customer_email` | string | Customer email |
| `subtotal` | integer | Subtotal in kobo (before tax) |
| `tax_rate` | number | Tax rate percentage (e.g., `7.5`) |
| `tax_amount` | integer | Tax amount in kobo |
| `total` | integer | Total in kobo (subtotal + tax) |
| `amount_paid` | integer | Cumulative amount paid so far in kobo |
| `currency` | string | Currency code (always `"NGN"`) |
| `due_date` | string | Due date (ISO 8601) |
| `issued_at` | string \| null | Timestamp when invoice was sent (null for drafts) |
| `paid_at` | string \| null | Timestamp when invoice was fully paid |
| `merchant_reference` | string \| null | Your custom reference (if provided at creation) |
| `metadata` | object \| null | Your custom key-value metadata |
| `payment_url` | string | URL for customer to pay the invoice |

## invoice.created

Sent when a new invoice is created via the API.

### When it fires

- A new invoice is created via `POST /v1/checkout/invoice`

### Payload

```json
{
  "event": "invoice.created",
  "data": {
    "public_id": "abc123def456ghi78",
    "invoice_number": "INV-202603-001",
    "status": "draft",
    "customer_name": "Chidi Okonkwo",
    "customer_email": "chidi@example.com",
    "subtotal": 41000000,
    "tax_rate": 7.5,
    "tax_amount": 3075000,
    "total": 44075000,
    "amount_paid": 0,
    "currency": "NGN",
    "due_date": "2026-03-31T00:00:00.000Z",
    "issued_at": null,
    "paid_at": null,
    "merchant_reference": "order_12345",
    "metadata": { "orderId": "12345" },
    "payment_url": "https://secure.zevpaycheckout.com/inv/abc123def456ghi78"
  }
}
```

## invoice.sent

Sent when an invoice is transitioned from `draft` to `sent`, making it payable.

### When it fires

- Invoice is sent via `POST /v1/checkout/invoice/:publicId/send`

### Payload

```json
{
  "event": "invoice.sent",
  "data": {
    "public_id": "abc123def456ghi78",
    "invoice_number": "INV-202603-001",
    "status": "sent",
    "customer_name": "Chidi Okonkwo",
    "customer_email": "chidi@example.com",
    "subtotal": 41000000,
    "tax_rate": 7.5,
    "tax_amount": 3075000,
    "total": 44075000,
    "amount_paid": 0,
    "currency": "NGN",
    "due_date": "2026-03-31T00:00:00.000Z",
    "issued_at": "2026-03-08T10:30:00.000Z",
    "paid_at": null,
    "merchant_reference": "order_12345",
    "metadata": { "orderId": "12345" },
    "payment_url": "https://secure.zevpaycheckout.com/inv/abc123def456ghi78"
  }
}
```

::: tip
The `issued_at` timestamp is set when the invoice is sent. Use this to track when an invoice became active.
:::

## invoice.payment_received

Sent when a payment is received on an invoice (partial or full). This is the most important event for tracking payment progress. It fires for **every** payment, including the final one that fully pays the invoice.

### When it fires

- Customer completes a bank transfer for an invoice payment
- Customer sends payment via PayID for an invoice payment

### Additional fields

In addition to the [base fields](#invoice-events-base-fields), this event includes:

| Field | Type | Description |
|-------|------|-------------|
| `payment_amount` | integer | This specific payment's amount in kobo |
| `amount_paid` | integer | **Cumulative** amount paid on the invoice so far in kobo (includes this payment) |
| `amount_remaining` | integer | Remaining balance after this payment in kobo |
| `total` | integer | Invoice total in kobo (mirrors the base `total`, included here for convenience in payment handlers) |
| `is_partial` | boolean | `true` if this payment brought `amount_paid` to less than `total` (partial settlement). `false` if this payment fully paid the invoice. |
| `is_fully_paid` | boolean | `true` only when this payment brought `amount_paid` to `>= total`. Always the negation of `is_partial`. |
| `invoice_status` | string | The invoice's status AFTER this payment. `"partial"` for a partial payment, `"paid"` for a full payment, `"overdue"` if past due + still partial after the payment. |
| `allow_partial_payments` | boolean | Whether the invoice itself accepts partial payments. Useful for logic that wants to special-case strict-payment invoices. |
| `payer_name` | string | Name of the person who made the payment |
| `payment_channel` | string | Payment channel: `"bank_transfer"` or `"payid"` |

### Payload (partial payment)

```json
{
  "event": "invoice.payment_received",
  "data": {
    "public_id": "abc123def456ghi78",
    "invoice_number": "INV-202603-001",
    "status": "partial",
    "customer_name": "Chidi Okonkwo",
    "customer_email": "chidi@example.com",
    "subtotal": 41000000,
    "tax_rate": 7.5,
    "tax_amount": 3075000,
    "total": 44075000,
    "amount_paid": 20000000,
    "currency": "NGN",
    "due_date": "2026-03-31T00:00:00.000Z",
    "issued_at": "2026-03-08T10:30:00.000Z",
    "paid_at": null,
    "merchant_reference": "order_12345",
    "metadata": { "orderId": "12345" },
    "payment_url": "https://secure.zevpaycheckout.com/inv/abc123def456ghi78",
    "payment_amount": 20000000,
    "amount_remaining": 24075000,
    "is_partial": true,
    "is_fully_paid": false,
    "invoice_status": "partial",
    "allow_partial_payments": true,
    "payer_name": "CHIDI OKONKWO",
    "payment_channel": "bank_transfer"
  }
}
```

::: danger Don't mistake a partial for a full payment
`invoice.payment_received` fires on **every** payment, including partial ones. Always check `is_fully_paid` (or equivalently `is_partial`) before fulfilling an order or marking the customer's account as paid. If you only need the "fully paid" signal, listen for `invoice.paid` instead.

A common bug is dispatching fulfillment off `invoice.payment_received` without checking `is_fully_paid`, which leads to orders shipped against partial payments.
:::

::: info
When the payment fully pays the invoice, `status` will be `"paid"`, `amount_remaining` will be `0`, `is_fully_paid` will be `true`, and `paid_at` will be set. You will also receive a separate `invoice.paid` event immediately after.
:::

## invoice.paid

Sent when an invoice is fully paid (cumulative payments reach or exceed the total). This event always follows an `invoice.payment_received` event for the final payment.

### When it fires

- A payment completes that brings `amount_paid` to equal or exceed `total`

### Payload

```json
{
  "event": "invoice.paid",
  "data": {
    "public_id": "abc123def456ghi78",
    "invoice_number": "INV-202603-001",
    "status": "paid",
    "customer_name": "Chidi Okonkwo",
    "customer_email": "chidi@example.com",
    "subtotal": 41000000,
    "tax_rate": 7.5,
    "tax_amount": 3075000,
    "total": 44075000,
    "amount_paid": 44075000,
    "currency": "NGN",
    "due_date": "2026-03-31T00:00:00.000Z",
    "issued_at": "2026-03-08T10:30:00.000Z",
    "paid_at": "2026-03-10T14:22:00.000Z",
    "merchant_reference": "order_12345",
    "metadata": { "orderId": "12345" },
    "payment_url": "https://secure.zevpaycheckout.com/inv/abc123def456ghi78"
  }
}
```

::: tip
Use `invoice.paid` to trigger order fulfillment. The `paid_at` timestamp tells you exactly when the invoice was fully settled. The `payment_url` now resolves to a receipt page.
:::

## invoice.paused

Sent when a merchant stops collection on an invoice without closing it.

### When it fires

- `POST /v1/checkout/invoice/:publicId/pause`
- An invoice reaches its due date with `due_date_action: "pause"`

### Payload

```json
{
  "event": "invoice.paused",
  "data": {
    "public_id": "abc123def456ghi78",
    "invoice_number": "INV-202603-001",
    "status": "partial",
    "total": 44075000,
    "amount_paid": 20000000,
    "currency": "NGN"
  }
}
```

::: info Paused is not cancelled
The invoice keeps its status and its link, and the customer can still open it and see everything they have already paid. Only new payment stops. Do not treat this as a lost sale.
:::

---

## invoice.resumed

Sent when collection restarts on a paused invoice.

Same payload shape as `invoice.paused`. The invoice is accepting payment again from this moment.

---

## invoice.reminder_sent

Sent when a reminder email goes out to the customer.

### When it fires

- `POST /v1/checkout/invoice/:publicId/remind`

### Payload

```json
{
  "event": "invoice.reminder_sent",
  "data": {
    "public_id": "abc123def456ghi78",
    "invoice_number": "INV-202603-001",
    "status": "partial",
    "total": 44075000,
    "amount_paid": 20000000,
    "currency": "NGN"
  }
}
```

Useful for logging chase activity against your own customer record, so your team can see the invoice has already been chased before they call.

---

## invoice.overdue

Sent when an invoice is automatically marked as overdue.

### When it fires

- Invoice `due_date` has passed and invoice is not fully paid (checked hourly by the system)

### Payload

```json
{
  "event": "invoice.overdue",
  "data": {
    "public_id": "abc123def456ghi78",
    "invoice_number": "INV-202603-001",
    "status": "overdue",
    "customer_name": "Chidi Okonkwo",
    "customer_email": "chidi@example.com",
    "subtotal": 41000000,
    "tax_rate": 7.5,
    "tax_amount": 3075000,
    "total": 44075000,
    "amount_paid": 20000000,
    "currency": "NGN",
    "due_date": "2026-03-31T00:00:00.000Z",
    "issued_at": "2026-03-08T10:30:00.000Z",
    "paid_at": null,
    "merchant_reference": "order_12345",
    "metadata": { "orderId": "12345" },
    "payment_url": "https://secure.zevpaycheckout.com/inv/abc123def456ghi78"
  }
}
```

::: info
Overdue invoices can still receive payments. If the customer pays the full remaining balance, the invoice transitions to `paid` and you'll receive `invoice.payment_received` and `invoice.paid` events. Use this event to send payment reminders to your customers.
:::

## invoice.cancelled

Sent when an invoice is cancelled by the merchant.

### When it fires

- Invoice is cancelled via `POST /v1/checkout/invoice/:publicId/cancel`

### Payload

```json
{
  "event": "invoice.cancelled",
  "data": {
    "public_id": "abc123def456ghi78",
    "invoice_number": "INV-202603-001",
    "status": "cancelled",
    "customer_name": "Chidi Okonkwo",
    "customer_email": "chidi@example.com",
    "subtotal": 41000000,
    "tax_rate": 7.5,
    "tax_amount": 3075000,
    "total": 44075000,
    "amount_paid": 0,
    "currency": "NGN",
    "due_date": "2026-03-31T00:00:00.000Z",
    "issued_at": "2026-03-08T10:30:00.000Z",
    "paid_at": null,
    "merchant_reference": "order_12345",
    "metadata": { "orderId": "12345" },
    "payment_url": "https://secure.zevpaycheckout.com/inv/abc123def456ghi78"
  }
}
```

## transfer.success

Sent when a transfer is completed successfully. Funds have been delivered to the recipient.

### When it fires

- Bank transfer is confirmed by the banking provider
- PayID transfer completes instantly

### Payload

```json
{
  "event": "transfer.success",
  "data": {
    "reference": "ZVP-TRF-abc123def456",
    "public_id": "xK9mQ2pL4vR7nW3jY",
    "type": "bank_transfer",
    "status": "completed",
    "amount": 500000,
    "fees": 2625,
    "currency": "NGN",
    "narration": "Vendor payment",
    "recipient": {
      "name": "JOHN DOE",
      "bank": "Guaranty Trust Bank",
      "account_number": "0123456789"
    },
    "merchant_reference": "payout_001",
    "metadata": {
      "invoice_id": "INV-2026-001"
    },
    "created_at": "2026-03-08T14:30:00.000Z",
    "completed_at": "2026-03-08T14:30:02.000Z"
  }
}
```

### Fields

| Field | Type | Description |
|-------|------|-------------|
| `reference` | string | ZevPay transaction reference |
| `public_id` | string | Public transaction identifier |
| `type` | string | `"bank_transfer"` or `"payid"` |
| `status` | string | Always `"completed"` for this event |
| `amount` | integer | Transfer amount in kobo |
| `fees` | integer | Transfer fees in kobo (0 for PayID) |
| `currency` | string | Currency code (`"NGN"`) |
| `narration` | string \| null | Transfer description |
| `recipient.name` | string | Recipient name |
| `recipient.bank` | string \| null | Recipient bank (bank transfers only) |
| `recipient.account_number` | string \| null | Recipient account (bank transfers only) |
| `merchant_reference` | string \| null | Your custom reference |
| `metadata` | object \| null | Your custom metadata |
| `created_at` | string | ISO 8601 creation timestamp |
| `completed_at` | string | ISO 8601 completion timestamp |

## transfer.failed

Sent when a bank transfer fails. The debited amount is automatically reversed to the source wallet.

### When it fires

- Bank rejects the transfer (invalid account, bank downtime, etc.)

### Payload

```json
{
  "event": "transfer.failed",
  "data": {
    "reference": "ZVP-TRF-xyz789ghi012",
    "public_id": "aB3cD4eF5gH6iJ7kL",
    "type": "bank_transfer",
    "status": "failed",
    "amount": 500000,
    "fees": 2625,
    "currency": "NGN",
    "narration": "Vendor payment",
    "recipient": {
      "name": "JOHN DOE",
      "bank": "Guaranty Trust Bank",
      "account_number": "0123456789"
    },
    "merchant_reference": "payout_002",
    "metadata": null,
    "created_at": "2026-03-08T15:00:00.000Z",
    "completed_at": null
  }
}
```

::: info
When a transfer fails, the full amount (including fees) is reversed to your wallet. You do not need to handle the reversal manually. PayID transfers cannot fail. They either succeed instantly or are rejected before debiting.
:::

## transfer.reversed

Sent when a previously completed transfer is reversed (e.g., by admin action or bank recall).

### When it fires

- Admin initiates a transfer reversal
- Bank recalls a completed transfer

### Payload

```json
{
  "event": "transfer.reversed",
  "data": {
    "reference": "ZVP-TRF-abc123def456",
    "public_id": "xK9mQ2pL4vR7nW3jY",
    "type": "bank_transfer",
    "status": "reversed",
    "amount": 500000,
    "fees": 2625,
    "currency": "NGN",
    "narration": "Vendor payment",
    "recipient": {
      "name": "JOHN DOE",
      "bank": "Guaranty Trust Bank",
      "account_number": "0123456789"
    },
    "merchant_reference": "payout_001",
    "metadata": null,
    "created_at": "2026-03-08T14:30:00.000Z",
    "completed_at": null
  }
}
```

## Handling events

```js
app.post('/webhooks/zevpay', (req, res) => {
  // Verify signature first (see Verifying Signatures)

  const { event, data } = req.body;

  switch (event) {
    case 'charge.success':
      handleSuccessfulPayment(data);
      break;
    case 'invoice.paid':
      handleInvoicePaid(data);
      break;
    case 'invoice.payment_received':
      handleInvoicePayment(data);
      break;
    case 'transfer.success':
      handleTransferSuccess(data);
      break;
    case 'transfer.failed':
      handleTransferFailed(data);
      break;
    default:
      console.log('Unhandled event:', event);
  }

  res.status(200).send('OK');
});

async function handleSuccessfulPayment(data) {
  // Check if already processed (idempotency)
  const existing = await db.findOrder({ reference: data.reference });
  if (existing?.fulfilled) return;

  // Fulfill the order
  await db.updateOrder({
    reference: data.reference,
    status: 'paid',
    amount: data.amount,
    paidAt: data.paid_at,
    channel: data.channel,
    payerName: data.payer.name,
    fulfilled: true,
  });

  // Send confirmation email
  await sendConfirmationEmail(data.customer.email, data);
}
```

## Testing webhooks

### Test mode

Use your test mode API keys to trigger test webhooks. Test transactions behave the same as live transactions but use test credentials.

### Local development

To receive webhooks locally during development, use a tunneling tool:

```bash
# Using ngrok
ngrok http 3000

# Set webhook URL in dashboard to:
# https://your-id.ngrok.io/webhooks/zevpay
```

### Webhook logs

View delivery logs in the ZevPay Dashboard under **Transactions → Webhook Logs**. Each log entry shows:

- Event type
- Delivery status (delivered / failed)
- HTTP status code
- Response time
- Request and response bodies

---

## Source: https://docs.zevpaycheckout.com/webhooks/overview
<!-- file: webhooks/overview.md -->

# Webhooks Overview

Webhooks notify your server in real time when payment events occur. Instead of polling the API, we send an HTTP POST request to your configured webhook URL.

## How webhooks work

1. A payment event occurs (e.g., customer completes a transfer)
2. We send a POST request to the webhook URL configured on your API key
3. Your server processes the event and responds with a `2xx` status code

```
Customer pays → we confirm → POST to your webhook URL → You fulfill the order
```

## Setting up webhooks

Configure your webhook URL in the ZevPay Dashboard under **Settings → API Keys**. Each API key pair (secret + public) shares a webhook URL and webhook secret.

### Requirements

- Your endpoint must be publicly accessible (HTTPS recommended for production)
- Your endpoint must respond with a `2xx` status code within 30 seconds
- Your endpoint should accept `POST` requests with `Content-Type: application/json`

## Webhook payload

All webhook payloads follow this structure:

```json
{
  "event": "charge.success",
  "livemode": true,
  "data": {
    "reference": "ZVP-CKO-S-abc123",
    "amount": 500000,
    "currency": "NGN",
    "status": "completed",
    // ... event-specific fields
  }
}
```

| Field | Type | Description |
|-------|------|-------------|
| `event` | string | The event type (e.g., `"charge.success"`) |
| `livemode` | boolean | `false` for events from [test mode](/guide/test-mode). Set from the API key, never from the request. Fulfil only when `true` |
| `data` | object | Event-specific payload |

## Security

Every webhook request includes an HMAC-SHA256 signature in the `x-zevpay-signature` header. **Always verify this signature** before processing the event.

```
x-zevpay-signature: a1b2c3d4e5f6...
```

The signature is computed using your webhook secret (available in the dashboard). See [Verifying Signatures](./signatures) for implementation details.

## Webhook URL requirements

Your endpoint must be reachable from the internet over `https://` (recommended) or `http://`. We refuse, both when you save the URL and when we deliver:

- `localhost` and names ending in `.local`, `.localhost` or `.internal`;
- private, loopback, link-local and other reserved IP addresses, including names that resolve to them;
- URLs containing a username or password.

Redirects are not followed: a `3xx` answer counts as a failed delivery. To receive webhooks on your own machine while developing, use a tunnel such as ngrok and set its public URL.

## Webhook delivery

| Property | Value |
|----------|-------|
| **Method** | POST |
| **Content-Type** | application/json |
| **Timeout** | 30 seconds |
| **Signature header** | `x-zevpay-signature` |
| **Max retries** | 5 |
| **Deduplication** | Per event + reference |

### Automatic retries

If your server fails to respond with a `2xx` status code (or doesn't respond within 30 seconds), we will automatically retry the delivery with exponential backoff:

| Retry | Delay after previous attempt |
|-------|------------------------------|
| 1st retry | ~4 minutes |
| 2nd retry | ~9 minutes |
| 3rd retry | ~16 minutes |
| 4th retry | ~25 minutes |
| 5th retry | ~36 minutes |

After 5 failed retries, the webhook is marked as permanently failed. You can manually retry failed webhooks from the dashboard.

::: warning
Make sure your webhook endpoint is reliable and responds quickly. If your server is consistently unresponsive, webhook deliveries will be lost after the retry window expires.
:::

### Deduplication

We prevent duplicate webhook deliveries. If a webhook for the same event and transaction reference has already been successfully delivered to your endpoint, it will not be sent again. This protects against accidental double-processing on our end.

However, you should still implement idempotent handlers on your side. See [Handle duplicates](#handle-duplicates) below.

### Delivery logging

All webhook deliveries are logged with:
- Delivery status (`delivered`, `failed`, or `pending`)
- HTTP status code from your server
- Response time in milliseconds
- Retry count and last attempt timestamp
- Request and response body

You can view webhook delivery logs in the dashboard.

## Best practices

### Respond quickly

Return a `2xx` response as fast as possible. Process the event asynchronously if needed:

```js
app.post('/webhooks/zevpay', (req, res) => {
  // Respond immediately
  res.status(200).send('OK');

  // Process asynchronously
  processEvent(req.body).catch(console.error);
});
```

### Handle duplicates

Design your webhook handler to be **idempotent**. Use the `reference` field to detect and skip duplicate events:

```js
async function processEvent(payload) {
  const existing = await db.findByReference(payload.data.reference);
  if (existing) return; // Already processed

  // Process the event
  await fulfillOrder(payload.data);
}
```

### Verify signatures

Always verify the `x-zevpay-signature` header before processing events. See [Verifying Signatures](./signatures).

### Use HTTPS

Always use HTTPS for your webhook endpoint in production to prevent payload interception.

## Events reference

| Event | Description |
|-------|-------------|
| `charge.success` | Payment completed successfully |

See [Events Reference](./events) for detailed payload documentation.

---

## Source: https://docs.zevpaycheckout.com/webhooks/signatures
<!-- file: webhooks/signatures.md -->

# Verifying Signatures

Every webhook request includes an HMAC-SHA256 signature in the `x-zevpay-signature` header. Verify this signature to ensure the request is genuinely from us and hasn't been tampered with.

## How it works

1. We compute an HMAC-SHA256 hash of the request body using your **webhook secret**
2. The hash is sent as a hex string in the `x-zevpay-signature` header
3. You recompute the hash on your end and compare it to the header value

## Your webhook secret

Find your webhook secret in the ZevPay Dashboard under **Settings → API Keys**. It's shared between the public and secret key in each pair.

::: warning Keep it secret
Never expose your webhook secret in client-side code, public repositories, or logs.
:::

## Verification examples

::: code-group

```js [Node.js]
const crypto = require('crypto');

function verifyWebhookSignature(req, webhookSecret) {
  const signature = req.headers['x-zevpay-signature'];
  if (!signature) return false;

  const body = JSON.stringify(req.body);
  const expectedSignature = crypto
    .createHmac('sha256', webhookSecret)
    .update(body)
    .digest('hex');

  return crypto.timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(expectedSignature)
  );
}

// Express.js example
app.post('/webhooks/zevpay', express.json(), (req, res) => {
  const isValid = verifyWebhookSignature(req, process.env.ZEVPAY_WEBHOOK_SECRET);

  if (!isValid) {
    return res.status(401).send('Invalid signature');
  }

  // Process the event
  const { event, data } = req.body;
  console.log(`Received ${event}:`, data.reference);

  res.status(200).send('OK');
});
```

```python [Python]
import hmac
import hashlib
import json

def verify_webhook_signature(payload_body, signature, webhook_secret):
    expected = hmac.new(
        webhook_secret.encode('utf-8'),
        payload_body.encode('utf-8'),
        hashlib.sha256,
    ).hexdigest()

    return hmac.compare_digest(expected, signature)

# Flask example
from flask import Flask, request, jsonify

app = Flask(__name__)

@app.route('/webhooks/zevpay', methods=['POST'])
def webhook():
    signature = request.headers.get('x-zevpay-signature', '')
    is_valid = verify_webhook_signature(
        request.get_data(as_text=True),
        signature,
        os.environ['ZEVPAY_WEBHOOK_SECRET'],
    )

    if not is_valid:
        return jsonify({'error': 'Invalid signature'}), 401

    payload = request.get_json()
    print(f"Received {payload['event']}: {payload['data']['reference']}")

    return 'OK', 200
```

```php [PHP]
<?php

function verifyWebhookSignature($payload, $signature, $webhookSecret) {
    $expected = hash_hmac('sha256', $payload, $webhookSecret);
    return hash_equals($expected, $signature);
}

// Usage
$payload = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_ZEVPAY_SIGNATURE'] ?? '';
$webhookSecret = getenv('ZEVPAY_WEBHOOK_SECRET');

if (!verifyWebhookSignature($payload, $signature, $webhookSecret)) {
    http_response_code(401);
    echo 'Invalid signature';
    exit;
}

$event = json_decode($payload, true);
error_log("Received {$event['event']}: {$event['data']['reference']}");

http_response_code(200);
echo 'OK';
```

```go [Go]
package main

import (
	"crypto/hmac"
	"crypto/sha256"
	"encoding/hex"
	"io"
	"net/http"
	"os"
)

func verifySignature(body []byte, signature, secret string) bool {
	mac := hmac.New(sha256.New, []byte(secret))
	mac.Write(body)
	expected := hex.EncodeToString(mac.Sum(nil))
	return hmac.Equal([]byte(expected), []byte(signature))
}

func webhookHandler(w http.ResponseWriter, r *http.Request) {
	body, _ := io.ReadAll(r.Body)
	signature := r.Header.Get("x-zevpay-signature")
	secret := os.Getenv("ZEVPAY_WEBHOOK_SECRET")

	if !verifySignature(body, signature, secret) {
		http.Error(w, "Invalid signature", http.StatusUnauthorized)
		return
	}

	// Process event...
	w.WriteHeader(http.StatusOK)
	w.Write([]byte("OK"))
}
```

:::

## Important notes

### Use timing-safe comparison

Always use a constant-time comparison function (e.g., `crypto.timingSafeEqual` in Node.js, `hmac.compare_digest` in Python, `hash_equals` in PHP) to prevent timing attacks.

### Parse the raw body

The signature is computed over the **raw JSON string** of the request body. If your framework parses the body before you access it, make sure to re-serialize it identically, or access the raw body directly.

```js
// Express.js — ensure raw body is available
app.use('/webhooks/zevpay', express.raw({ type: 'application/json' }));

app.post('/webhooks/zevpay', (req, res) => {
  const rawBody = req.body.toString();
  // Use rawBody for signature verification
});
```

### Test with your webhook secret

Use your **test mode** webhook secret during development. Test and live mode use separate secrets.