Redeem

Redemption Workflow: The redemption process follows these steps:

  1. Validate the voucher exists and is active
  2. Check redemption eligibility (not already redeemed, not expired)
  3. Mark voucher as "booking" to prevent concurrent redemption
  4. Publish redemption event for downstream processing
  5. Return acceptance confirmation
Concurrency Control: The system implements optimistic concurrency control by immediately updating the voucher status to "booking" upon redemption request. This prevents double-spending scenarios in high-concurrency environments.

Event-Driven Processing: The actual redemption processing occurs asynchronously through domain events. This allows for complex business logic, external service integration, and proper error handling without blocking the API response.

Validation Rules:

  1. Voucher must exist in the system
  2. Voucher cannot be already redeemed
  3. Voucher must not be expired or voided
  4. Operator must have appropriate permissions

Language
URL
Response
Click Try It! to start a request and see the response here!