Skip to main content

API Keys & Environments

BillPay has two separate environments. Build and test everything in the sandbox. To go live, you change two values: the base URL and the key.

EnvironmentBase URLKey starts withMoney
Sandboxhttps://sandbox.api.billpay.etBPG_TEST-Simulated. Nothing real moves.
Productionhttps://api.billpay.etBPG_PROD-Real payments.

A key works only in the environment it was created for. A sandbox key sent to production, or a production key sent to the sandbox, returns 401 with the message Invalid API key.

Create a key​

  1. Sign in to the merchant portal.
  2. Choose Test or Live with the switch at the top of the page.
  3. Go to Developers → API keys and create a key.
  4. Copy the key right away. BillPay shows it only once.

If you lose a key, you can't view it again. Regenerate it from the same page, then update the key on your server.

Production keys​

You can create production payments only after BillPay approves your business. Until then, creating a payment in production returns 422. Complete Verification in the portal to get approved.

Send the key​

Put the key in the x-api-key header of every request:

curl https://sandbox.api.billpay.et/api/v1/checkout/me \
-H "x-api-key: $BILLPAY_API_KEY"

A 200 means the key works. The response tells you which account and environment the key belongs to:

{
"statusCode": 200,
"message": "Integration context fetched successfully",
"body": {
"merchantId": "7d3e9b14-2c5a-4f8e-b6d1-0a9c4e2f7b35",
"businessName": "Abebe Electronics",
"shortCode": "123456",
"onboardingStatus": "SANDBOX",
"environment": "SANDBOX",
"canTakePayments": true,
"defaultCurrency": "ETB",
"paymentFee": null
},
"timestamp": "2026-10-31T15:58:31.470+00:00"
}
FieldMeaning
merchantIdYour merchant account ID.
businessNameYour business name, as shown to customers on checkout.
shortCodeYour merchant short code.
onboardingStatusWhere your account is in onboarding, for example SANDBOX.
environmentWhich environment the key belongs to, for example SANDBOX.
canTakePaymentsWhether this account can create payments right now.
defaultCurrencyUsed when you leave currency out of a payment.
tip

Call this endpoint when your server starts, and check environment. It's an easy way to catch a production server that's using a sandbox key by mistake.

Keep keys on your server​

danger

Your API key can create payments, refunds, and payouts on your account. Never put it in a browser, a mobile app, or a Git repository.

Store the key and the base URL as environment variables. Then going live only means changing configuration, not code.

.env
BILLPAY_BASE_URL=https://sandbox.api.billpay.et
BILLPAY_API_KEY=BPG_TEST-xxxxxxxxxxxxxxxx

Add .env to your .gitignore so it's never committed.