> ## Documentation Index
> Fetch the complete documentation index at: https://docs.simplepay.mx/llms.txt
> Use this file to discover all available pages before exploring further.

# Modelo Bookable

> Mapa de objetos de Bookable Payments: productos, recursos, schedules, rules, overrides, blackouts, event types, holds y bookings.

Bookable Payments separa catalogo, disponibilidad e inventario temporal para que una plataforma pueda controlar su UI sin reimplementar el estado critico de pagos.

## Jerarquia

```mermaid theme={"theme":{"light":"github-light","dark":"github-dark"}}
flowchart TD
  Product["product"]
  Price["default price"]
  EventType["booking_event_type"]
  Resource["booking_resource"]
  Schedule["availability_schedule"]
  Rule["availability_rule"]
  Override["availability_override"]
  Blackout["booking_blackout"]
  Hold["booking_hold"]
  Booking["booking"]
  Checkout["checkout_session"]

  Product --> Price
  Product --> EventType
  EventType --> Resource
  EventType --> Schedule
  Schedule --> Rule
  Schedule --> Override
  Resource --> Blackout
  EventType --> Blackout
  EventType --> Hold
  Hold --> Booking
  Booking --> Checkout
```

## Product

El producto vive en el catalogo del tenant. Puede tener tipo:

```txt product-types theme={"theme":{"light":"github-light","dark":"github-dark"}}
appointment
class
scheduled_offer
experience
rental
service
standard
date_range
```

```bash terminal theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -sS -X POST "https://api.simplepay.mx/v1/products" \
  -H "Authorization: Bearer $SIMPLEPAY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: product_experience_isla_v1" \
  -d '{
    "name": "Experiencia Isla",
    "product_type": "scheduled_offer",
    "price": {
      "amount": 90000,
      "currency": "mxn"
    },
    "booking": {
      "enabled": true,
      "duration_minutes": 480,
      "capacity": 100,
      "slot_interval_minutes": 60,
      "time_zone": "America/Cancun"
    }
  }'
```

## Resource

Un recurso representa aquello que limita capacidad:

| Kind             | Ejemplo                           |
| ---------------- | --------------------------------- |
| `staff`          | Terapeuta, instructor, medico.    |
| `space`          | Salon, cancha, cuarto.            |
| `equipment`      | Bicicleta, terminal, herramienta. |
| `vehicle`        | Auto, van, lancha.                |
| `unit`           | Cabana, habitacion, item rentado. |
| `inventory_pool` | Cupo compartido.                  |
| `amenity`        | Amenidad o add-on reservable.     |

```bash terminal theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -sS -X POST "https://api.simplepay.mx/v1/bookable-payments/resources" \
  -H "Authorization: Bearer $SIMPLEPAY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: resource_shared_inventory_v1" \
  -d '{
    "name": "Shared inventory",
    "kind": "inventory_pool",
    "capacity": 100,
    "time_zone": "America/Cancun"
  }'
```

## Event type

El event type es la superficie reservable canonica. Define titulo, slug, duracion, capacidad, payment requirement, recursos y schedules.

```bash terminal theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -sS -X POST "https://api.simplepay.mx/v1/bookable-payments/event_types" \
  -H "Authorization: Bearer $SIMPLEPAY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: event_type_experience_isla_v1" \
  -d '{
    "title": "Experiencia Isla",
    "slug": "experiencia-isla",
    "kind": "scheduled_offer",
    "inventory_mode": "capacity_pool",
    "duration_minutes": 480,
    "slot_interval_minutes": 60,
    "capacity": 100,
    "minimum_quantity": 1,
    "maximum_quantity": 10,
    "payment_requirement": "required",
    "confirmation_policy": "payment_required",
    "time_zone": "America/Cancun",
    "product_id": "00000000-0000-4000-8000-000000000001",
    "resource_ids": ["00000000-0000-4000-8000-000000000002"],
    "schedule_ids": ["00000000-0000-4000-8000-000000000003"]
  }'
```

## Inventory modes

| Mode              | Uso                                       |
| ----------------- | ----------------------------------------- |
| `capacity_pool`   | Cupo compartido por slot.                 |
| `seated`          | Asientos o lugares dentro de una funcion. |
| `unit_assignment` | Unidades concretas asignables.            |
| `date_range`      | Rango de fechas, rentals o hospedaje.     |
| `instant`         | Reserva inmediata con reglas simples.     |

## Lifecycle de booking

```mermaid theme={"theme":{"light":"github-light","dark":"github-dark"}}
stateDiagram-v2
  [*] --> held
  held --> pending: create checkout
  held --> released: release hold
  held --> expired: hold timeout
  pending --> confirmed: payment success
  pending --> expired: checkout expired
  pending --> cancelled: payment failed
  confirmed --> rescheduled: reschedule
  confirmed --> no_show: mark no-show
  confirmed --> refunded: full refund
  confirmed --> partially_refunded: partial refund
```

<Tip>
  Para integraciones complejas, importa catalogo y disponibilidad por lotes en
  tu backend, pero deja que SimplePay sea la fuente de verdad para holds y
  confirmacion de pago.
</Tip>
