Consume transaction events
Transaction POS Log (TPLA) moves transaction data into the event-driven space. Rather than long-polling a REST endpoint for new receipts, FiftyTwo pushes events to you as they arrive.
Why events
From the API’s own documentation, the trade this makes:
- No long polling. Less network traffic, no “have you got anything yet” loop.
- Real time. You react as the transaction happens, not on your next poll.
- Resilient. If your consumer goes down, the data is ordered and waiting when it comes back.
- Horizontally scalable. Add consumers to share a high-volume workload, round-robin.
- No status-code business logic. An event arriving is the data.
The event payload is identical to the one the REST endpoints return, so you can develop against REST and switch to events without reshaping your parser.
Transport: Apache Pulsar
FiftyTwo uses Apache Pulsar. Topics are structured:
Pulsar’s multi-tenancy is why the topic path carries the customer and chain: your data is namespaced from every other tenant’s.
You will need a Pulsar client for your language and the topic path plus credentials for your tenant. Ask your FiftyTwo consultant for those. They are provisioned per customer and are not in the OpenAPI spec.
Consuming
Design for redelivery
Pulsar gives you at-least-once delivery. Any event can arrive more than once: after a consumer restart, a negative ack, or a redelivery timeout. A handler that is not idempotent will double-count revenue.
Make the handler idempotent on the transaction’s own identity:
Ordering is per-topic-partition, not global. If your logic depends on sequence, key on the store’s session and sequence numbers rather than assuming arrival order.
The REST endpoints
Three endpoints remain, and they are the right tool for backfill and reconciliation rather than steady-state ingestion:
The lastTransactionPosLogId cursor makes these useful for catching up after an
extended outage, or for verifying that your event pipeline has not silently
dropped anything.
Migrating off the Receipt API
If you currently poll the Receipt API, this replaces it. See Migrating off the Receipt API for the endpoint mapping.