Buy raffle tickets
Builds a purchase of ticketCount tickets in the raffle at raffleKey, signed and paid for by buyer.
Rejected with 400 when the raffle has ended or is sold out, when the purchase would push the wallet past the raffle's per-wallet limit, or past the hard cap of 40% of total tickets per wallet. Holder-only raffles are not yet supported on this route.
When the raffle is denominated in SOL, wrapped-SOL setup instructions (create the token account if needed, transfer, sync) are prepended automatically.
Authorization
ApiKeyAuth In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Buys raffle tickets. For SOL-denominated raffles, wrapped-SOL setup instructions are prepended automatically.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v2/tx/raffles/buy-tickets" \ -H "Content-Type: application/json" \ -d '{ "buyer": "string", "raffleKey": "string", "ticketCount": 0 }'{ "result": { "tx": "string" }}