Player Bookings API
Manage your padel court bookings, create new reservations, and cancel existing bookings.
Get My Bookings
Retrieve all bookings for the authenticated player.
Endpoint
Response
Returns an array of booking objects.
Unique identifier for the booking
ID of the booked resource (court)
ID of the player who made the booking
Date of the booking in ISO format (YYYY-MM-DD)
Start time of the booking in ISO format (HH:MM:SS)
End time of the booking in ISO format (HH:MM:SS)
Amount paid for the booking
Currency code (e.g., EUR, USD)
Booking status: PENDING, CONFIRMED, CANCELLED, COMPLETED
Payment status: PENDING, PAID, FAILED, REFUNDED
Timestamp when the booking was cancelled (if applicable)
Reason provided for cancellation
createdAt
string (timestamp)
required
Timestamp when the booking was created
updatedAt
string (timestamp)
required
Timestamp when the booking was last updated
Expiration timestamp for pending bookings
Name of the booked resource
Name of the venue where the resource is located
City where the venue is located
Example Request
curl -X GET "https://api.hub.example.com/api/bookings/my" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
Example Response
[
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"resourceId": "660e8400-e29b-41d4-a716-446655440001",
"playerId": "770e8400-e29b-41d4-a716-446655440002",
"bookingDate": "2026-03-15",
"startTime": "10:00:00",
"endTime": "11:30:00",
"pricePaid": 35.00,
"currency": "EUR",
"status": "CONFIRMED",
"paymentStatus": "PAID",
"cancelledAt": null,
"cancelReason": null,
"createdAt": "2026-03-08T12:34:56Z",
"updatedAt": "2026-03-08T12:35:10Z",
"expiresAt": null,
"resourceName": "Court 1",
"venueName": "Padel Center Madrid",
"venueCity": "Madrid"
}
]
Create Booking
Create a new court booking and initiate payment.
Endpoint
Request Body
ID of the resource (court) to book
Date for the booking in ISO format (YYYY-MM-DD)
Start time for the booking in ISO format (HH:MM:SS)
Response
The created booking object (same structure as in Get My Bookings)
Payment client secret for completing the payment
Example Request
curl -X POST "https://api.hub.example.com/api/bookings" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"resourceId": "660e8400-e29b-41d4-a716-446655440001",
"bookingDate": "2026-03-20",
"startTime": "14:00:00"
}'
Example Response
{
"booking": {
"id": "880e8400-e29b-41d4-a716-446655440003",
"resourceId": "660e8400-e29b-41d4-a716-446655440001",
"playerId": "770e8400-e29b-41d4-a716-446655440002",
"bookingDate": "2026-03-20",
"startTime": "14:00:00",
"endTime": "15:30:00",
"pricePaid": 40.00,
"currency": "EUR",
"status": "PENDING",
"paymentStatus": "PENDING",
"cancelledAt": null,
"cancelReason": null,
"createdAt": "2026-03-08T15:30:00Z",
"updatedAt": "2026-03-08T15:30:00Z",
"expiresAt": "2026-03-08T15:45:00Z",
"resourceName": "Court 1",
"venueName": "Padel Center Madrid",
"venueCity": "Madrid"
},
"clientSecret": "pi_1ABC2DEF3GHI4JKL_secret_5MNO6PQR7STU8VWX"
}
The clientSecret should be used with your payment provider to complete the payment process. The booking will expire after 15 minutes if payment is not completed.
Cancel Booking
Cancel an existing booking.
Endpoint
PATCH /api/bookings/{id}/cancel
Path Parameters
ID of the booking to cancel
Request Body
Optional reason for cancelling the booking
Response
Returns the updated booking object with cancellation details.
Example Request
curl -X PATCH "https://api.hub.example.com/api/bookings/880e8400-e29b-41d4-a716-446655440003/cancel" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"reason": "Unable to attend due to injury"
}'
Example Response
{
"id": "880e8400-e29b-41d4-a716-446655440003",
"resourceId": "660e8400-e29b-41d4-a716-446655440001",
"playerId": "770e8400-e29b-41d4-a716-446655440002",
"bookingDate": "2026-03-20",
"startTime": "14:00:00",
"endTime": "15:30:00",
"pricePaid": 40.00,
"currency": "EUR",
"status": "CANCELLED",
"paymentStatus": "REFUNDED",
"cancelledAt": "2026-03-08T16:00:00Z",
"cancelReason": "Unable to attend due to injury",
"createdAt": "2026-03-08T15:30:00Z",
"updatedAt": "2026-03-08T16:00:00Z",
"expiresAt": null,
"resourceName": "Court 1",
"venueName": "Padel Center Madrid",
"venueCity": "Madrid"
}
Cancellation policies may vary by venue. Refunds are typically processed automatically if the booking is cancelled within the allowed timeframe.