Critical flow
At what point can a successful external payment establish a seat entitlement?
The critical flow begins when the payment service reports Z-17 as successful after H-17 has expired and S-42 has a new hold. The API verifies the signature, deduplicates and persists the event in the inbox, then responds 2xx. The worker subsequently decides between confirmation and compensation in a transaction.
Starting point The starting point is the architecture with inbox, worker and transactional sales inventory.
Assumptions for the example case
Example design for one event with 1,000 numbered seats. Each order contains exactly one seat. Hold, sale, payment and ticket are separate entities. All figures and targets are illustrative assumptions, not provider metrics. Admission scanning, resale, dynamic pricing and multi-seat orders are outside scope. Sources checked on 8 September 2026. The order model covers successful payments, including delayed success; final unpaid cancellations need their own terminal state before implementation.
Check payment feedback as normal, late payment and duplicate
The still valid hold H-17 is paid for and generates exactly one ticket T-17.
- Payment service returns success asynchronously
Result: The ticket API acknowledges event ingestion to the payment service; ticket confirmation occurs only in the local commit with a valid hold and remains protected as a sale allocation.
Critical time points
| Timestamp | Local impact | Permitted result |
|---|---|---|
| Webhook arrives | Signature and eventId are checked; Inbox is committed before 2xx. | Payment service is allowed to resend; no promise arises in the reply. |
| Worker reads Inbox | Hold, active binding and B-17 are loaded for decision. | Valid H-17 can be confirmed. |
| Hold has expired | S-42 may belong to a new hold. | B-17 becomes compensation_pending; no T-17 arises. |
| Crash after commit | B-17, T-17 or Outbox and Inbox completion remain permanent. | Restart detects closure and does not produce a second effect. |
Webhook arrives
- Local impact
- Signature and eventId are checked; Inbox is committed before 2xx.
- Permitted result
- Payment service is allowed to resend; no promise arises in the reply.
Worker reads Inbox
- Local impact
- Hold, active binding and B-17 are loaded for decision.
- Permitted result
- Valid H-17 can be confirmed.
Hold has expired
- Local impact
- S-42 may belong to a new hold.
- Permitted result
- B-17 becomes compensation_pending; no T-17 arises.
Crash after commit
- Local impact
- B-17, T-17 or Outbox and Inbox completion remain permanent.
- Permitted result
- Restart detects closure and does not produce a second effect.
Why 2xx does not confirm a ticket
- Durable acceptance
- 2xx follows only after the deduplicated event is committed to local storage. A crash before that point leads to a retry rather than loss.
- Domain validation
- The worker checks the current hold at commit. An old or duplicate event creates no new allocation.
- Settlement
- Late payment success triggers an idempotent refund through the outbox. If it fails, B-17 remains compensation_pending with an assigned investigation owner.
Terms in this step
- At least once
- External messages can arrive repeatedly. Deduplication and idempotent effect still limit the business effect.
- Compensation
- A compensation compensates for an external effect that has already occurred if the desired local commitment is no longer permissible.
Try it yourself
Describe late payment success in at least eight messages or local actions. Mark the inbox commit, validation transaction and refund outbox.
A hint for your attempt
The payment service needs a quick acceptance. The local decision must see the current state of H-17 and S-42.
Compare with a possible solution
- 1–4: Durable ingestion
- 1. Payment service → API: EV-17 reports Z-17 as successful. 2. API checks the signature. 3. API → store: write a deduplicated inbox entry and wait for the commit. 4. API → payment service: 2xx.
- 5–8: Local decision
- 5. Worker → store: read and lock the inbox, B-17, H-17 and seat allocation. 6. The worker validates the payment association and detects expired H-17. 7. It writes compensation_pending, a uniquely keyed refund outbox entry and inbox completion without T-17. 8. The store confirms the joint commit; the new seat allocation is preserved.
- 9–12: compensation
- 9. Worker → payment service: refund with a stable key. 10. Payment service → API: confirmed refund EV-18. 11. The API validates and persists EV-18 in the inbox, waits for commit, then responds 2xx. 12. The worker writes refunded and inbox completion atomically. A timeout or failure leaves compensation_pending for retry or investigation.
Apply to your project
What external effect can occur in your system after the local authorization expires?