Skip to content

API keys & credentials

Pesepay keys come in pairs, and you hold two pairs: test keys for the sandbox and live keys for production. Each pair has two keys:

KeyUsed for
Integration keySent as the authorization header on every API request
Encryption keyEncrypting requests and decrypting responses — see the Encryption Guide

You use one Pesepay login for both, but the two pairs come from different places, and each works only against its own environment:

KeysWhere you find themBase URL they work against
TestThe Your Test Keys card on the Merchant Control Panel’s home page, from the day you register (Get your test keys)https://api.test.sandbox.pesepay.com/payments-engine/...
LiveEach application’s Application Details tab, once your business is approved (Find your live keys)https://api.pesepay.com/api/payments-engine/...

Test keys belong to your login, so all your applications share one pair. Live keys belong to each application.

Label them unmistakably in your configuration — PESEPAY_SANDBOX_* and PESEPAY_LIVE_* rather than one PESEPAY_KEY that changes meaning per deploy — and never let a sandbox key reach a production build, or the reverse.

Deactivate the affected key from the dashboard and issue a new one immediately, then update it everywhere it’s used. There’s no grace period — treat any suspected exposure as urgent.

Rotating a key changes what your live servers need to encrypt/decrypt with — plan rotations as a deploy, not a dashboard-only change:

  1. Generate the new key in the dashboard.
  2. Deploy your servers with the new key.
  3. Confirm new transactions encrypt/decrypt correctly.
  4. Deactivate the old key.