Skip to main content

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: https://pepay.io/sign-in.

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-lived ws_token server-to-server:
  • POST /api/v1/ws/token
Then connect using:
  • wss://.../ws/merchant/events?token=<ws_token>
  • wss://.../ws/commerce/events?token=<ws_token>

Request

Example (merchant API key):
Example (payor/session headers):
Example (mint a ws_token):

Response

Authentication is not a standalone endpoint — response shapes depend on the route you call. Below is a representative success response from POST /api/v1/ws/token.

Errors

Common causes:
  • 401 missing or invalid credentials
  • 403 wrong auth mode for the endpoint (for example, using x-api-key where x-session-token is required)
  • 400 invalid signatures or invalid request bodies
Example (invalid API key):

Examples

  • Do not send x-api-key or x-commerce-api-key from browsers.
  • If you need client-side access, use payment sessions (x-session-token + x-signature) or mint a ws_token server-side.
Next: Rate limits