Skip to main content
GET
Transaction status (real-time, Server-Sent Events)
Use this endpoint for real-time transaction status updates using Server-Sent Events (SSE). The response is not one JSON object. It is an SSE stream (text/event-stream) containing multiple events over time.

how SSE works

  • Your client opens one long-lived HTTP GET request 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.
Do not run 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 call POST /erp/check-txn with the same billRefNo for manual status check.

implementation notes

  • Include the x-api-secret header.
  • Use a request timeout and reconnect strategy in your client.
  • Do not open multiple SSE streams for the same billRefNo unless needed.

raw SSE stream example

Query Parameters

billRefNo
string
required

Bill reference to subscribe to. Example call format: /txn-sse?billRefNo=T584KP095O.

Example:

"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).