Skip to content

generatePrizeReceipt(claim_id)

Purpose

Generates a formal prize receipt for a user’s winning ticket.
Used for confirmation screens, downloadable PDFs, and tax-prep exports.


Endpoint

GET /api/generate-receipt/{claim_id}


Authorization

  • Required Scope: user.read or user.download
  • Token: Bearer Token from authenticated user session

Parameters

Name Type Required Description
claim_id string Unique ID of the user's claim

Response: Success (200 OK)

JSON Format

{
  "claim_id": "claim_092",
  "user_id": "user123",
  "prize_amount": 400.00,
  "draw_date": "2025-06-25",
  "game": "powerball",
  "redemption_method": "wallet_credit",
  "receipt_id": "rcpt-9129c4",
  "generated_at": "2025-06-26T10:12:00Z"
}

HTML Format (Optional Content-Type: text/html)

<html>
  <head><title>Prize Receipt</title></head>
  <body>
    <h1>Drawn Prize Receipt</h1>
    <p>Receipt ID: rcpt-9129c4</p>
    <p>User: user123</p>
    <p>Game: Powerball</p>
    <p>Draw Date: June 25, 2025</p>
    <p>Prize: $400.00</p>
    <p>Redemption: Wallet Credit</p>
    <p>Generated At: June 26, 2025</p>
  </body>
</html>

Error States

HTTP Code Error Key Description
404 claim_not_found No claim exists with that ID
403 unauthorized User not permitted to access receipt

Integration Notes

  • May be rendered in-app or emailed as a downloadable HTML/PDF.
  • Triggered post-payout for any prize tier.
  • Supports dual format rendering: application/json or text/html.

UX Notes

  • Include this as a downloadable “receipt” option on the Prize Summary screen.
  • Recommended to also email this as part of post-redemption flow.