Docs / API reference
Events feed (sandbox)
Read payment events with a test key using GET /api/gateway/v1/events, so you can develop webhook logic without a public URL.
GET
/api/gateway/v1/eventsThe events feed returns your finished test payments as events, in the same format as webhooks. It lets you develop and test your payment logic on a machine that has no public URL.
Note The feed works only with a test key (
tk_test_…). A live key answers403 events_test_only.
Query parameters
| Parameter | Type | Description |
|---|---|---|
after |
string | The cursor to continue from: the next_cursor of your previous call. |
limit |
integer | Number of events, from 1 to 100. Default 50. |
Example
curl "https://api.tranzak.co/api/gateway/v1/events?limit=20" \
-H "X-Api-Key: $TRANZAK_API_KEY"
let cursor = null;
async function pollEvents() {
const url = new URL('https://api.tranzak.co/api/gateway/v1/events');
if (cursor) url.searchParams.set('after', cursor);
const res = await fetch(url, { headers: { 'X-Api-Key': process.env.TRANZAK_API_KEY } });
const body = await res.json();
for (const event of body.data) {
handleTranzakEvent(event); // the same function you use for real webhooks
}
cursor = body.next_cursor;
}
import os, requests
cursor = None
def poll_events():
global cursor
params = {"after": cursor} if cursor else {}
body = requests.get(
"https://api.tranzak.co/api/gateway/v1/events",
headers={"X-Api-Key": os.environ["TRANZAK_API_KEY"]},
params=params,
).json()
for event in body["data"]:
handle_tranzak_event(event) # the same function you use for real webhooks
cursor = body["next_cursor"]
Response
Events are ordered from oldest to newest.
{
"success": true,
"data": [
{
"id": "evt_17843268616389_success",
"event": "payment.success",
"created_at": "2026-10-04T14:03:10.000000Z",
"data": {
"transaction_id": "17843268616389",
"amount": "500.00",
"currency": "HTG",
"status": "completed",
"reference": "ORDER-4821"
}
}
],
"next_cursor": "MjAyNi0xMC0wNCAxNDowMDowMHwxMjM",
"has_more": false
}
| Field | Description |
|---|---|
event |
payment.success or payment.failed, the same names as webhooks. |
data |
The same shape as a retrieved payment. |
next_cursor |
Keep it and pass it as after on your next call. |
has_more |
true when more events are waiting. Call again straight away. |
An invalid cursor answers 422 invalid_cursor.
Good to know
- Use the feed during development. In production, use webhooks and reconciliation.
- Process each event with the same handler as a real webhook, and make it idempotent.