Skip to main content

Endpoint

POST /api/reservations/create-without-payment

Description

Creates a reservation without requiring payment. This endpoint only works if:
  • The professional’s configuration does not require a deposit, OR
  • It’s a manual block (when client_id equals professional_id)
See implementation in server/src/modules/reservations/reservations.controller.ts:19-41.

Authentication

This endpoint requires Bearer token authentication. Include your access token in the Authorization header.

Request Body

client_id
string
required
ID of the client making the reservation
professional_id
string
required
ID of the professional for whom the reservation is being made
start_time
string
required
Start time of the reservation in ISO 8601 format (e.g., “2026-03-15T10:00:00Z”)
end_time
string
required
End time of the reservation in ISO 8601 format
status
string
required
Reservation status. One of: PENDING, CONFIRMED, or CANCELLED
session_modality
string
required
Type of session. One of: Virtual, Presencial, or empty string

Response

status
number
HTTP status code (200 for success)
data
object
The created reservation object

Example Request

curl -X POST https://your-domain.com/api/reservations/create-without-payment \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": "abc123",
    "professional_id": "prof456",
    "start_time": "2026-03-15T10:00:00Z",
    "end_time": "2026-03-15T11:00:00Z",
    "status": "PENDING",
    "session_modality": "Virtual"
  }'

Example Response

{
  "status": 200,
  "data": {
    "id": "res789",
    "client_id": "abc123",
    "professional_id": "prof456",
    "start_time": "2026-03-15T10:00:00Z",
    "end_time": "2026-03-15T11:00:00Z",
    "status": "PENDING",
    "session_modality": "Virtual",
    "created_at": "2026-03-10T08:30:00Z"
  }
}

Error Responses

Payment Required

If the professional requires a deposit and it’s not a manual block:
{
  "status": 1,
  "data": {}
}

Bad Request

{
  "statusCode": 400,
  "message": "Error al crear la reserva",
  "error": "Bad Request"
}

Unauthorized

{
  "statusCode": 401,
  "message": "Token inválido o expirado",
  "error": "Unauthorized"
}

Notes

  • Manual blocks (where client_id equals professional_id) always bypass payment requirements
  • Check the professional’s settings to determine if payment is required
  • The reservation status is typically set to PENDING initially

Build docs developers (and LLMs) love