Skip to content
All questionsSecurity

How do you store payment API keys safely? | MULENPAY

Payment API keys belong on the server in environment variables or a secrets store — not in code, not in the repository, not in messengers. A key can create payments on behalf of your store, so a leak is equivalent to access to money.

Where to keep them

  • Environment variables on the server — the minimum acceptable option.
  • A secrets store — once the infrastructure is more than one server.
  • Never in the repository. Even a private repo is the wrong place: access is broader than it looks, and history keeps everything.
  • Never in the browser. A secret key must not reach client-side code under any circumstances.

Who should have access

The application needs the keys, plus one or two responsible people — not the whole team. A developer, a manager and an ad contractor should not share the same secret.

Lock down the dashboard too: staff permissions there deserve the same scoping.

If you suspect a leak

  1. Issue a new key and switch the application to it.
  2. Revoke the old one.
  3. Review transactions for the period the key could have been exposed.
  4. Work out how it leaked — otherwise it happens again.

Never collect card numbers yourself: that is a separate requirement, covered in what is PCI DSS. Verifying incoming notification signatures is covered in what is a webhook.

See how this works at MulenPay

Still have questions?

Write to us — we will answer and help you start accepting payments.

Telegram bot

@Mulenpay_support_bot

Quick answers 24/7

Legal address

RBY Commerce Ltd.

8 Copthall, Roseau Valley, 00152, Commonwealth of Dominica

Leave a request

Fill out the form — a manager will get in touch, tailor the terms and help with the integration.

By clicking the button, you agree to the processing of personal data.

TelegramTelegram