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.
| Environment | Base URL | Key starts with | Money |
|---|---|---|---|
| Sandbox | https://sandbox.api.billpay.et | BPG_TEST- | Simulated. Nothing real moves. |
| Production | https://api.billpay.et | BPG_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
- Sign in to the merchant portal.
- Choose Test or Live with the switch at the top of the page.
- Go to Developers → API keys and create a key.
- 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"
}
| Field | Meaning |
|---|---|
merchantId | Your merchant account ID. |
businessName | Your business name, as shown to customers on checkout. |
shortCode | Your merchant short code. |
onboardingStatus | Where your account is in onboarding, for example SANDBOX. |
environment | Which environment the key belongs to, for example SANDBOX. |
canTakePayments | Whether this account can create payments right now. |
defaultCurrency | Used when you leave currency out of a payment. |
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
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.
BILLPAY_BASE_URL=https://sandbox.api.billpay.et
BILLPAY_API_KEY=BPG_TEST-xxxxxxxxxxxxxxxx
Add .env to your .gitignore so it's never committed.