Skip to main content

Get Booking Payload

Introduction

The Get Booking Payload API allows you to get the booking payload for a particular ticket and slot. This API is useful when you want to generate a form for attendees to fill in their details before booking a ticket. The booking payload includes the required fields for the form, such as first name, last name, email, phone number, and custom fields.

Generate Booking Payload

To get the booking payload, users need to make an HTTP POST request to the specified endpoint with the required parameters.

Endpoint

https://api.paydexp.com/v1/booking/payload

Authorization

Users need to include basic authentication credentials in the request headers.

AUTHORIZATION: Basic Auth

Username <username>
Password <password>

Request Body (Token Object)

The request body should include the necessary parameters for the request, such as the ticket_id, slot_id, and quantity.

json
{
"ticket_id": 118,
"slot_id": 49,
"quantity": 2
}

Code Examples

Below are code examples in different programming languages demonstrating how to get booking payload using HTTP POST requests.

   curl --location 'https://api.paydexp.com/api/v1/booking/payload' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••'
--data '{
"ticket_id": 118,
"slot_id": 49,
"quantity": 2
}'

Example of a successful response


{
"success": true,
"payload": [
{
"name": "attendee[0]first_name",
"label": "First Name",
"type": "text",
"required": true,
"options": []
},
{
"name": "attendee[0]last_name",
"label": "Last Name",
"type": "text",
"required": true,
"options": []
},
{
"name": "attendee[0]email",
"label": "Email",
"type": "email",
"required": true,
"options": []
},
{
"name": "attendee[0]phone",
"label": "Phone",
"type": "text",
"required": true,
"options": []
},
{
"name": "attendee[0]fields[66]",
"label": "Favourite Song",
"type": "select",
"required": 0,
"options": [
"Danger",
" Hatari"
]
},
{
"name": "attendee[1]first_name",
"label": "First Name",
"type": "text",
"required": true,
"options": []
},
{
"name": "attendee[1]last_name",
"label": "Last Name",
"type": "text",
"required": true,
"options": []
},
{
"name": "attendee[1]email",
"label": "Email",
"type": "email",
"required": true,
"options": []
},
{
"name": "attendee[1]phone",
"label": "Phone",
"type": "text",
"required": true,
"options": []
},
{
"name": "attendee[1]fields[66]",
"label": "Favourite Song",
"type": "select",
"required": 0,
"options": [
"Danger",
" Hatari"
]
}
],
"expected_payload": {
"callback_url": "https://example.com/callback",
"ticket_id": 118,
"slot_id": 49,
"quantity": 2,
"fields": {
"attendee[0]first_name": "John",
"attendee[0]last_name": "Doe",
"attendee[0]email": "johndoe@example.com",
"attendee[0]phone": "1234567890",
"attendee[0]fields[66]": "Danger",
"attendee[1]first_name": "John",
"attendee[1]last_name": "Doe",
"attendee[1]email": "johndoe@example.com",
"attendee[1]phone": "1234567890",
"attendee[1]fields[66]": "Danger"
}
},
"message": "Payload generated successfully. Fill in the required fields and submit the form."
}

Conclusion

This API allows users to get the booking payload for a particular ticket and slot. Users can use the booking payload to generate a form for attendees to fill in their details before booking a ticket. This API provides a seamless way to collect attendee information and process bookings.