# 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 [Business Dashboard](https://business.zevpay.ng).
:::

## 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://business.zevpay.ng).
:::

### 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 | — | 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' },
  ]"
/>
