qbirr agent 39c9d97420 Document tolerance, max_age_hours and payer_error
The API accepts per-call overrides for the underpayment limit ("25" = 25 ETB,
"1%" = one percent) and the receipt age limit (hours, 0 disables), and returns
payer_error alongside error. None of it was in this SDK.

payer_error is the payer-facing wording: show it to the customer, because error
is written for the merchant and can name their own saved accounts.
2026-10-06 19:34:10 +03:00
2026-07-17 16:42:27 +02:00

qbirr (Python)

Verify Ethiopian bank transfer receipts in real time.

Install

pip install "git+https://git.qbirr.com/admin/sdk-python.git"

These packages are not on the public registries yet, so the command above installs straight from the repository.

Quick start

from qbirr import Qbirr

qb = Qbirr(api_key="your_key_from_dashboard")

r = qb.verify(
    provider="cbe",
    ref="FT23001234ABC",
    amount=500,
    receiver_name="YOUR FULL NAME",
    receiver_account="1000123456789",
)

if r.verified:
    print(f"✓ Paid by {r.payer}, amount: {r.amount}")
else:
    print(f"✗ {r.error}")

Providers

provider Notes
cbe Needs receiver_account. ref = full receipt link, v2-… token, or just the token
telebirr —
abyssinia Needs receiver_account
dashen —
mpesa —
awash ref = SMS URL or its token
ebirr ref = "tenant/token" or full URL

Reference formats

ref accepts whatever the customer pasted. For CBE, all of these are the same payment, and qbirr reduces them to a single identity so one receipt cannot be verified twice:

What the customer pasted Example
The full receipt link https://mbreciept.cbe.com.et/v2-hfHCxHoqlCB1LfGG6kJY
The token with its v2- prefix v2-hfHCxHoqlCB1LfGG6kJY
Just the token hfHCxHoqlCB1LfGG6kJY
The legacy FT… reference FT262693ZS18

Case is ignored when deciding whether a receipt has already been used. Awash takes the SMS URL or its token; eBirr takes the URL or "tenant/token".

Webhooks

Subscribe from the dashboard. qbirr POSTs verification.created for both outcomes, so always read data.verified — never treat delivery alone as payment.

X-Qbirr-Signature: sha256=<hex>   # HMAC-SHA256(secret, "<timestamp>.<raw body>")
X-Qbirr-Timestamp: <unix seconds>
X-Qbirr-Event:     verification.created
X-Qbirr-Delivery:  <delivery id>

data.client_ref echoes the tag your own upload sent, so an order can be found without inferring it from the provider and amount. It is null if you did not send one.

Answer 2xx once you have processed the event. A 4xx is final — qbirr will not retry a request your endpoint refused. Return 5xx (or time out) to have it retried with exponential backoff.

Quota

Only verified lookups count against your monthly quota. A failed, retryable or duplicate lookup does not consume quota.

Errors

from qbirr import Qbirr, QbirrError

try:
    r = qb.verify(...)
except QbirrError as e:
    print(f"API error {e.status}: {e}")

Verification failures (wrong amount, wrong receiver) are NOT exceptions — they're returned as VerifyResult(verified=False, error="...").

License

MIT

S
Description
qbirr SDK - sdk-python
Readme 46 KiB
Languages
Python 100%