H5 C2B Web Payment
C2B (Customer-to-Business) is Telebirr’s web checkout flow. The customer pays on your website, gets redirected to the Telebirr payment page, enters their phone and PIN, and comes back. Your server gets a signed notification when the payment completes.
What actually happens
1. Customer clicks "Pay with Telebirr" on your site
2. Your server creates an order with Telebirr → gets a prepay_id
3. Your server builds a signed checkout URL → redirects the browser to it
4. Telebirr shows their payment page (phone number + PIN)
5. Customer pays
6. Telebirr POSTs a signed notification to your notify_url
7. Telebirr redirects the customer back to your redirect_url
8. You verify the notification and fulfill the orderThe PHP library compresses steps 2–3 into a single call:
$result = (new Telebirr($config))->createCheckoutUrl('Order #42', '199.99');
header('Location: ' . $result->getCheckoutUrl());Steps 4–5 happen on Telebirr’s side. You handle step 6 and 7.
The pieces
| Part | Your responsibility |
|---|---|
| Apply Fabric Token | Get a bearer token (library does this) |
| Create Order | POST to Telebirr → get prepay_id |
| Checkout URL | Build signed URL, redirect customer |
| Notification | Verify signature, fulfill order |
RSA keys are required. Every request you make is signed with your private key. Telebirr verifies it using the public key you provide during onboarding. See Request Signature for how signing works.
Test vs production
| Test (Developer Portal) | Production | |
|---|---|---|
| Base URL | developerportal.ethiotelebirr.et:38443/apiaccess/payment/gateway | superapp.ethiomobilemoney.et:38443/apiaccess/payment/gateway |
| PHP config | Config::forTest([...]) | Config::forProduction([...]) |
The test environment has a self-signed TLS cert. The library’s Config::forTest() disables SSL verification for you.