Skip to main content
Lyel Pay uses two authentication mechanisms depending on the context: API Keys and Bearer tokens (JWT). In most flows, both are used together.

API Keys

An API key identifies your merchant account. Every request must carry it.

Where to get your key

Go to your dashboard → Settings → API Keys. You can generate multiple keys and rotate them independently.

How to send it

API keys are sent as a request header, not in the URL or query string.
Never expose your API key in client-side JavaScript or a public repository. Use environment variables.

Bearer tokens (JWT)

Some endpoints — particularly those that act on behalf of a specific user (e.g., initiating a payment from a user’s wallet) — require a short-lived JWT in addition to the API key. The token is obtained by authenticating the user via the /auth/web endpoint:
Response:
Then pass both headers on subsequent requests:

OTP tokens

The four-step payment flow adds a third layer: an OTP-derived token that authorizes the specific transaction. In the browser SDK, the token is held in memory in the LyelPay instance (not persisted). It is scoped to one transaction.

Authentication by SDK


Security checklist

  • Store API keys in environment variables, never in source code
  • Use HTTPS for all requests (enforced by the API)
  • Validate webhook signatures on your server before processing events (see Webhooks)
  • Rotate API keys periodically from the dashboard