Skip to content

Authentication

All API requests must include an API key. ZevPay uses a key pair model: each pair consists of a secret key and a public key.

API key types

Key TypePrefixUse onPurpose
Secret keysk_live_ or sk_test_Server onlyFull access — initialize sessions, verify payments, manage resources
Public keypk_live_ or pk_test_Client (browser)Initialize sessions (inline checkout), load checkout UI, select payment methods

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

EndpointSecret keyPublic key
Initialize sessionYesYes (with origin validation)
Select payment methodYesYes (with origin validation)
Get sessionYesYes (with origin validation)
Verify sessionYesYes
All other endpointsYesNo

Public keys can initialize checkout sessions directly from the browser — this is how the Inline Checkout SDK 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 Business Dashboard.

Available permissions

PermissionProductsAccount typeDescription
checkoutCheckout SessionsAllInitialize and manage checkout payment sessions
invoicesInvoicesBusiness onlyCreate and manage programmable invoices
virtual_payidStatic PayID, Dynamic PayIDAllCreate and manage virtual PayIDs
virtual_accountVirtual AccountsAllCreate temporary bank accounts for collecting payments
transfersTransfersBusiness onlyProgrammatically send money from a wallet

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:

ProductPersonal accountBusiness account
Checkout SessionsYesYes
Virtual PayIDYesYes
Virtual AccountsYesYes
InvoicesNoYes
TransfersNoYes

How permissions are assigned

  • Checkout, invoices, virtual_payid, virtual_account — Configured when creating or editing an API key in the Business Dashboard
  • Transfers — Granted automatically when a programmable-debit wallet 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 Business Dashboard > Developers > API Keys section.

Matching rules

PatternMatchesExample
example.comExact domain onlyhttps://example.com
*.example.comAny subdomain + the domain itselfhttps://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

Recommendation

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

Live vs test mode

ModeKey prefixReal money?Purpose
Testsk_test_ / pk_test_NoDevelopment and testing
Livesk_live_ / pk_live_YesProduction payments

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 Business Dashboard
  • 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

ZevPay Checkout Developer Documentation