POST - buyTickets
Users can buy the ticket using buyTickets API.
Http method
POST
URL endpoint
https://api.ticbolt.com/v1/buyTickets
Request header
API token - The token can be easily copied from the partner dashboard for the project created.
Request body
Json object with the details of the event to be created.
Example structure :
{
"usersAddress": "[email protected]",
"contractAddress": "0xabcde12345...",
"ticketTypes": ["ticketType1", "ticketType2", ...],
"amount": [2, 3, ...],
"seatNumber": ["A1", "B2", ...]
}Parameter description :
userEmailAddress(String): The email address of the user making the purchase.contractAddress(String): The contract address of the event received after createEvent request.ticketTypes(Array of Strings): An array containing the types of tickets the user wishes to purchase.amount(Array of Integers): An array specifying the amount for each ticket type. It should align with theticketTypesarray. For instance, if "Type1" corresponds to 2 tickets, "Type2" corresponds to 3 tickets, the array would look like[2, 3].seatNumber(Array of Strings): An array that indicates the seat numbers for each ticket type, if applicable. This is required if theticketTypeisseated.
Response:
The API will respond with a JSON payload. Depending on the outcome of the request, the structure will differ:
Successful Response:
Parameter description :
ticketTransactionHash: On a successful request placed on to the blockchain, the server returns a transaction hash. The actual details, if ticket created successfully, will only be notified using the buyTicketStatus API.
Failed Response:
Error Response:
Last updated