Transaction status (SSE)
Opens an SSE (text/event-stream) connection that pushes status updates for the given billRefNo in real time. Typical events include an initial status (for example UNPAID), then updates when the payment completes. A final event may include "_closed": true.
Request format example: /txn-sse?billRefNo=T584KP095O (gateway route in this spec: /erp/api/txn-sse?billRefNo=...).
Important: the full HTTP response is an SSE stream, not one JSON object. Parse each data: event payload as JSON.
Raw text/event-stream example:
data: {"status":"UNPAID"}
data: {"amount":1,"billRefNo":"T584KP095O","externalReference":"DE50JURNL0","merchantId":"698856835bf6c24fd5ff3dac","merchantName":"jimma merchant","paymentChannel":"USSD_PUSH","status":"PAID","transactionId":"a407e6fa-3a77-49db-93fb-02e8a9c2d28f","paidAt":"05 May 2026, 8:15 AM","customerName":"tesfaye","customerPhoneNumber":"+251944719460","commissionAmount":0.02,"redirectUrl":"","paidAmount":0.98,"updatedAt":"2026-05-05T05:15:41.341Z"}
data: {"amount":1,"status":"PAID","_closed":true}
If you do not receive a definitive update within 15 seconds, close the stream and use POST /erp/check-txn with the same billRefNo to poll status.
text/event-stream) containing multiple events over time.
how SSE works
- Your client opens one long-lived HTTP
GETrequest to/erp/api/txn-sse?billRefNo=.... - Accepted query format is
/txn-sse?billRefNo=T584KP095O(gateway route:/erp/api/txn-sse?billRefNo=...). - The server keeps the connection open and pushes updates as event lines:
data: {"status":"UNPAID"}data: {"status":"PAID", ...}
- Parse each
data:line as JSON. - A final event can include
_closed: true.
JSON.parse() on the entire HTTP response body. Parse each data: event payload separately.
when to use fallback
If SSE does not provide a definitive result within 15 seconds, close the stream and callPOST /erp/check-txn with the same billRefNo for manual status check.
implementation notes
- Include the
x-api-secretheader. - Use a request timeout and reconnect strategy in your client.
- Do not open multiple SSE streams for the same
billRefNounless needed.
raw SSE stream example
Query Parameters
Bill reference to subscribe to. Example call format: /txn-sse?billRefNo=T584KP095O.
"T584KP095O"
Response
Open SSE stream. Each event is one or more lines of the form data: <json> per the Server-Sent Events format. Do not parse the entire stream as one JSON object.
SSE text stream payload. This is protocol framing, not a single JSON document. Parse each data: payload as JSON; shape varies (minimal status only, full payment detail, or final object with _closed).