Skip to main content

Make Booking

Introduction

The make booking API allows users to create a booking for an event by providing the necessary details such as ticket ID, slot ID, quantity, and attendee information as per the expected_payload parameter on the response from the Get Booking Payload API. This API generates a payment URL that users can use to complete the booking process.

Making a Booking

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

Endpoint

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

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
    {
"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"
}
}

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/make' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data-raw '{
"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"
}
}'

Example of a successful response


{
"success": true,
"payment_url": "https://global.paydexp.com/pay/b98414ffe66ba27e870a7be5adddd99a",
"message": "Booking created successfully. Make Payment via the payment URL provided to complete the booking."
}

Conclusion