Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/scooller/Leben-site/llms.txt

Use this file to discover all available pages before exploring further.

Reservations temporarily hold a plant unit before checkout to prevent double-booking. When an active reservation exists for a plant, that unit is marked as unavailable in the public catalogue until the reservation expires or is cancelled. For the manual payment gateway, the session_token returned here is a mandatory input to the checkout request.

Authentication

All reservation endpoints require both auth:sanctum and token.origin middleware:
  • Header: Authorization: Bearer <token>
  • Header: Origin: <your-authorized-origin> (or Referer / X-Authorized-Url)
The origin value must match the authorized_url configured on the token. A mismatch returns 403 La URL de origen no esta autorizada para este token.

POST /api/v1/reservations

Create a new reservation for a plant. The response includes a session_token that must be supplied when using the manual payment gateway at checkout.

Request body

plant_id
integer
required
The ID of the plant unit to reserve.

Response — 201 Created

reservation
object

Example

curl -X POST "https://tu-dominio.com/api/v1/reservations" \
  -H "Authorization: Bearer TOKEN" \
  -H "Origin: https://frontend.cliente.com" \
  -H "Content-Type: application/json" \
  -d '{"plant_id": 10}'
{
  "reservation": {
    "id": 90,
    "session_token": "abc123...",
    "plant_id": 10,
    "status": "active",
    "expires_at": "2026-06-02T19:10:00Z",
    "remaining_seconds": 900
  }
}

GET /api/v1/reservations/planta/

Check whether an active reservation currently exists for a specific plant.
The correct route path is /reservations/planta/{plantId} — note the Spanish segment planta. Requests to any other path variant will return 404.

Path parameters

plantId
integer
required
The ID of the plant whose reservation status you want to check.

Response

reserved
boolean
true if an active reservation exists for the plant, false otherwise.
expires_at
string
ISO 8601 datetime of reservation expiry. Only present when reserved is true.
remaining_seconds
integer
Seconds remaining until expiry. Only present when reserved is true.
{
  "reserved": true,
  "expires_at": "2026-06-02T19:10:00Z",
  "remaining_seconds": 742
}

DELETE /api/v1/reservations/

Cancel an active reservation before it naturally expires. Once cancelled, the plant becomes available again immediately.

Path parameters

sessionToken
string
required
The session_token value returned when the reservation was created.

Reservation lifecycle

1

Create reservation

POST /api/v1/reservations with plant_id. The plant is immediately marked as unavailable in the public catalogue.
2

Proceed to checkout

Use the returned session_token in the checkout request body when gateway is "manual". Redirect-based gateways (Transbank, Mercado Pago) do not require this token.
3

Reservation expires or is cancelled

The system automatically expires stale reservations on a scheduled basis. Alternatively, call DELETE /api/v1/reservations/{sessionToken} to cancel early.

Availability impact

A plant is considered unavailable when any of the following conditions are true:
  • An active plant_reservation exists for that plant.
  • A completed plant_reservation exists for that plant.
  • A payment linked by plant_id has status completed or authorized.
Payments in pending, processing, or pending_approval state without a completed reservation do not block availability on their own.
The session_token returned from a reservation is mandatory when using the manual payment gateway. If this token is missing or belongs to an expired reservation, the checkout request will be rejected. Always create a fresh reservation immediately before initiating a manual checkout.

Build docs developers (and LLMs) love