Overview
Pepay supports multiple auth modes depending on the surface area (merchant, commerce, payor/session) and whether the request is server-side or browser-side. If you’re getting started, log in to the Dashboard to obtain API keys: .Authentication
Server-to-server (merchant + commerce)
- Merchant API key:
x-api-key: pk_...(scope=merchant) - Commerce API key:
x-commerce-api-key: ck_...(scope=commerce) - Dashboard JWT (for key-management endpoints):
Authorization: Bearer <jwt>
Browser-safe (payor/session)
Payor session endpoints use:x-session-token: pst_...x-signature: sig_...
WebSocket auth (browser/mobile)
For websocket streams in client contexts, mint a short-livedws_token server-to-server:
POST /api/v1/ws/token
wss://.../ws/merchant/events?token=<ws_token>wss://.../ws/commerce/events?token=<ws_token>
Request
Example (merchant API key):Response
Authentication is not a standalone endpoint — response shapes depend on the route you call. Below is a representative success response fromPOST /api/v1/ws/token.
Errors
Common causes:401missing or invalid credentials403wrong auth mode for the endpoint (for example, usingx-api-keywherex-session-tokenis required)400invalid signatures or invalid request bodies
Examples
- Do not send
x-api-keyorx-commerce-api-keyfrom browsers. - If you need client-side access, use payment sessions (
x-session-token+x-signature) or mint aws_tokenserver-side.

