Endpoint
Description
Creates a reservation associated with a payment. This endpoint extracts the payment ID from the request body. If no payment ID is found, it returns a success status without creating the reservation. See implementation inserver/src/modules/reservations/reservations.controller.ts:43-56.
Authentication
This endpoint requires Bearer token authentication. Include your access token in the
Authorization header.Request Body
The request body should include payment information along with reservation details. The exact structure depends on the payment provider (e.g., MercadoPago).Payment ID from the payment provider (extracted automatically from the request)
ID of the client making the reservation
ID of the professional
Start time in ISO 8601 format
End time in ISO 8601 format
Reservation status (typically
CONFIRMED for paid reservations)Session type:
Virtual, Presencial, or empty stringResponse
HTTP status code (200 for success)
The created reservation object with payment information
Example Request
Example Response
Error Responses
Missing Payment ID
If no payment ID is found in the request:Bad Request
Unauthorized
Workflow
- Create a payment preference using the Create Payment Preference endpoint
- Process the payment with your payment provider (e.g., MercadoPago)
- Call this endpoint with the payment information to create the reservation
- The reservation is created with status
CONFIRMED
Notes
- Payment ID is extracted automatically from the request body
- Reservations created with payment are typically confirmed immediately
- Ensure the payment is processed before calling this endpoint