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:
| Key | Used for |
|---|---|
| Integration key | Sent as the authorization header on every API request |
| Encryption key | Encrypting requests and decrypting responses — see the Encryption Guide |
Sandbox vs live keys
Section titled “Sandbox vs live keys”You use one Pesepay login for both, but the two pairs come from different places, and each works only against its own environment:
| Keys | Where you find them | Base URL they work against |
|---|---|---|
| Test | The 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/... |
| Live | Each 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.
Keep requests server-side
Section titled “Keep requests server-side”If a key is compromised
Section titled “If a key is compromised”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 keys
Section titled “Rotating keys”Rotating a key changes what your live servers need to encrypt/decrypt with — plan rotations as a deploy, not a dashboard-only change:
- Generate the new key in the dashboard.
- Deploy your servers with the new key.
- Confirm new transactions encrypt/decrypt correctly.
- Deactivate the old key.