ChapaChapa Docs

Test Mode vs Live Mode

Understand the differences between Test mode and Live mode and when to use them

In this document we'll cover the differences between Test mode and Live mode as well as when to utilize them.

Your Chapa merchant account can be used in one of two ways:

Live Mode

Live Mode: Actual money, actual exchanges, and actual results. After extensively testing your integration, switch to live mode.

Test Mode

Test Mode: No actual money is used in the test mode. Only our test cards and phone numbers can be used. The majority of the API's features remain the same, and we'll continue to send email notifications and webhooks.

Switching Between Modes

You can easily switch between Live and Test modes with the toggle button at the top right side of the page. When you switch between modes, we'll also switch the API keys shown. Test keys will always have CHAPUBK_TEST in the prefix (for example CHAPUBK_TEST-BbsIL9E0NillGIZ4beEuU9HNCXxlJ8dR).

Never mix test and live keys - this will result in authentication errors. Always use the appropriate keys for your current mode.

API Keys

When you sign up in the Chapa dashboard you're given two types of API keys:

Secret Key

Secret keys are the most powerful kind of keys and should never be made public because they have the power to authorize any action on your account.

Public Key

When writing "public" code, such as front-end JavaScript, you should use the public key.

Getting Your API Keys

To get to your keys:

  1. Log in to your Chapa Dashboard.
  2. Navigate to settings by clicking on the top right side circle icon with your name's first two letters on it.
  3. Select the API Keys on the horizontal tab to access both public and secret keys.

Security Best Practices

Don't take any chances: Suppose you think your keys may have been compromised (for instance, you accidentally committed them to Git). In that case, you should immediately generate new ones using the "Generate new keys" button on the Settings > API page on your dashboard. This will invalidate all existing keys and give you a new set, and you can then update your app to use the new ones.

Key Security Guidelines

  • Never commit keys to version control: Always use environment variables or secure key management systems
  • Use different keys for test and live: Keep your test and live keys separate
  • Rotate keys regularly: Generate new keys periodically for better security
  • Restrict key access: Only share keys with team members who need them
  • Monitor key usage: Regularly check your dashboard for any suspicious activity

When to Use Each Mode

Use Test Mode When:

  • Developing and testing your integration
  • Debugging payment flows
  • Training team members
  • Demonstrating features without real transactions
  • Running automated tests

Use Live Mode When:

  • Your integration is fully tested and ready
  • Processing real customer payments
  • Running your production application
  • Handling actual business transactions

Differences Summary

FeatureTest ModeLive Mode
MoneyNo real moneyReal money
CardsTest cards onlyReal cards
Phone NumbersTest numbers onlyReal phone numbers
Email NotificationsYesYes
WebhooksYesYes
API FeaturesSame as LiveFull production features
Key PrefixCHAPUBK_TESTCHAPUBK

Next Steps

On this page