> ## 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.

# Hold a booking slot and create a SimplePay Checkout Session

> Referencia detallada para POST /v1/bookable-payments/bookings.

## Uso

Usalo dentro de Bookable Payments para modelar inventario reservado, calcular disponibilidad, crear holds, convertirlos en checkout y confirmar bookings.

## Antes de llamar

| Tema             | Detalle                                                                                |
| ---------------- | -------------------------------------------------------------------------------------- |
| Metodo           | `POST`                                                                                 |
| Ruta             | `/v1/bookable-payments/bookings`                                                       |
| Auth             | Bearer API key del ambiente correcto.                                                  |
| Scope            | `bookings:write`                                                                       |
| Idempotencia     | Recomendada para cualquier retry. Usa una key deterministica por operacion de negocio. |
| Guia relacionada | [Bookable Payments](/bookable-payments/overview)                                       |

## Patron recomendado

* Ejecuta este endpoint desde backend o job seguro, nunca desde frontend con API keys.
* Manda `Idempotency-Key` cuando el endpoint cree, convierta, reprograme, cancele, capture o reembolse estado.
* Confirma inventario final con `booking.confirmed` o una lectura de booking, no solo con una URL de retorno.
* Consulta el bloque OpenAPI de esta pagina para el shape exacto de parametros, body y respuestas.

## Ejemplo minimo

```bash terminal theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -sS -X POST "https://api.simplepay.mx/v1/bookable-payments/bookings" \
  -H "Authorization: Bearer $SIMPLEPAY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: create-booking-checkout_v1" \
  -d '{ ... }'
```

## Errores a manejar

* `400` indica payload, parametros o estado invalido.
* `401` o `403` indican API key, ambiente o scopes incorrectos.
* `409` suele indicar conflicto de estado, duplicado o idempotencia incompatible.
* `429` y `5xx` se pueden reintentar con backoff; en writes conserva la misma idempotency key.

## Contrato OpenAPI

El playground, parametros, body y respuestas de abajo salen de `/openapi.json`. Si el contrato cambia, actualiza la spec y regenera esta pagina.


## OpenAPI

````yaml openapi.json POST /v1/bookable-payments/bookings
openapi: 3.1.0
info:
  title: SimplePay API
  version: '2026-06-13'
servers:
  - url: https://api.simplepay.mx
security:
  - SimplePayApiKey: []
paths:
  /v1/bookable-payments/bookings:
    post:
      summary: Hold a booking slot and create a SimplePay Checkout Session
      operationId: createBookingCheckout
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BookingCheckoutCreate'
      responses:
        '201':
          description: Booking checkout created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookingCheckoutResponse'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: true
      schema:
        type: string
        minLength: 8
        maxLength: 255
  schemas:
    BookingCheckoutCreate:
      type: object
      required:
        - success_url
      anyOf:
        - required:
            - event_type_id
        - required:
            - event_type_slug
        - required:
            - product_id
      properties:
        cancel_url:
          type: string
          format: uri
        customer:
          type: object
          additionalProperties: true
        duration_minutes:
          type: integer
          minimum: 1
        ends_at:
          type: string
          format: date-time
        scheduled_offer:
          $ref: '#/components/schemas/ScheduledOfferCheckout'
        event_type_id:
          type: string
        event_type_slug:
          type: string
        form_responses:
          type: object
          additionalProperties: true
        hold_minutes:
          type: integer
          minimum: 1
          maximum: 120
        metadata:
          type: object
          additionalProperties: true
        product_id:
          type: string
          format: uuid
        quantity:
          type: integer
          minimum: 1
          default: 1
        resource_id:
          type: string
          format: uuid
        starts_at:
          type: string
          format: date-time
        date_range:
          $ref: '#/components/schemas/DateRangeCheckout'
        success_url:
          type: string
          format: uri
    BookingCheckoutResponse:
      type: object
      properties:
        booking:
          $ref: '#/components/schemas/BookingCheckoutBooking'
        checkout_session:
          $ref: '#/components/schemas/BookingCheckoutSession'
    ScheduledOfferCheckout:
      type: object
      required:
        - date
        - quantities
      properties:
        add_on_prices:
          type: array
          items:
            $ref: '#/components/schemas/ScheduledOfferPrice'
        add_ons:
          type: array
          items:
            $ref: '#/components/schemas/ScheduledOfferAddOn'
        arrival_time:
          type: string
          pattern: ^([01][0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$
        date:
          type: string
          format: date
        duration_minutes:
          type: integer
          minimum: 1
        ends_at:
          type: string
          format: date-time
        inventory_window:
          $ref: '#/components/schemas/ScheduledOfferInventoryWindow'
        prices:
          type: array
          items:
            $ref: '#/components/schemas/ScheduledOfferPrice'
        pricing_rules:
          type: array
          items:
            $ref: '#/components/schemas/ScheduledOfferPricingRule'
        quantities:
          $ref: '#/components/schemas/ScheduledOfferQuantities'
        resource_id:
          type: string
          format: uuid
        starts_at:
          type: string
          format: date-time
    DateRangeCheckout:
      type: object
      required:
        - start_date
        - end_date
        - participant_counts
      properties:
        start_date:
          type: string
          format: date
        start_time:
          type: string
          pattern: ^([01][0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$
        end_date:
          type: string
          format: date
        end_time:
          type: string
          pattern: ^([01][0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$
        fees:
          type: array
          items:
            $ref: '#/components/schemas/DateRangeFee'
        participant_counts:
          $ref: '#/components/schemas/DateRangeParticipantCounts'
        period_rates:
          type: array
          items:
            $ref: '#/components/schemas/DateRangePeriodRate'
        resource_group_id:
          type: string
          format: uuid
        rate_plan:
          $ref: '#/components/schemas/DateRangeRatePlan'
        restriction:
          $ref: '#/components/schemas/DateRangeRestriction'
        unit_id:
          type: string
          format: uuid
    BookingCheckoutBooking:
      type: object
      properties:
        ends_at:
          type: string
          format: date-time
        event_type_id:
          type: string
        hold_expires_at:
          type: string
          format: date-time
        hold_id:
          type: string
        id:
          type: string
        line_items:
          type: array
          items:
            $ref: '#/components/schemas/BookingLineItemResponse'
        product_id:
          type: string
        quantity:
          type: integer
          minimum: 1
        resource_id:
          type: string
        starts_at:
          type: string
          format: date-time
        status:
          enum:
            - pending
    BookingCheckoutSession:
      type: object
      properties:
        id:
          type: string
        url:
          type: string
          format: uri
    ScheduledOfferPrice:
      type: object
      required:
        - amount_minor
        - currency
        - price_id
        - title
      properties:
        admission_type:
          enum:
            - adult
            - child
            - guest
            - infant
            - resident
            - senior
        amount_minor:
          type: integer
          minimum: 0
        currency:
          type: string
          pattern: ^[a-z]{3}$
        metadata:
          type: object
          additionalProperties: true
        price_id:
          type: string
          format: uuid
        title:
          type: string
          minLength: 1
    ScheduledOfferAddOn:
      type: object
      required:
        - price_id
        - quantity
      properties:
        price_id:
          type: string
          format: uuid
        quantity:
          type: integer
          minimum: 1
    ScheduledOfferInventoryWindow:
      type: object
      required:
        - capacity
      properties:
        admission_allocation:
          $ref: '#/components/schemas/ScheduledOfferQuantities'
        capacity:
          type: integer
          minimum: 1
        date:
          type: string
          format: date
        end_time:
          type: string
          pattern: ^([01][0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$
        resource_id:
          type: string
          format: uuid
        start_time:
          type: string
          pattern: ^([01][0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$
    ScheduledOfferPricingRule:
      type: object
      required:
        - price_id
      properties:
        admission_type:
          enum:
            - adult
            - child
            - guest
            - infant
            - resident
            - senior
        end_date:
          type: string
          format: date
        price_id:
          type: string
          format: uuid
        start_date:
          type: string
          format: date
        weekdays:
          type: array
          items:
            type: integer
            minimum: 0
            maximum: 6
    ScheduledOfferQuantities:
      type: object
      properties:
        adult:
          type: integer
          minimum: 0
        child:
          type: integer
          minimum: 0
        guest:
          type: integer
          minimum: 0
        infant:
          type: integer
          minimum: 0
        resident:
          type: integer
          minimum: 0
        senior:
          type: integer
          minimum: 0
      additionalProperties: false
    DateRangeFee:
      type: object
      required:
        - amount_minor
        - currency
        - kind
      properties:
        amount_minor:
          type: integer
          minimum: 0
        currency:
          type: string
          pattern: ^[a-z]{3}$
        kind:
          enum:
            - setup
            - deposit
            - service
            - tax
        refundable:
          type: boolean
    DateRangeParticipantCounts:
      type: object
      additionalProperties:
        type: integer
        minimum: 0
    DateRangePeriodRate:
      type: object
      required:
        - amount_minor
        - currency
        - date
      properties:
        amount_minor:
          type: integer
          minimum: 0
        currency:
          type: string
          pattern: ^[a-z]{3}$
        date:
          type: string
          format: date
        metadata:
          type: object
          additionalProperties: true
        rate_plan_id:
          type: string
        unit_id:
          type: string
          format: uuid
    DateRangeRatePlan:
      type: object
      required:
        - currency
        - period_amount_minor
        - price_id
      properties:
        active:
          type: boolean
        currency:
          type: string
          pattern: ^[a-z]{3}$
        metadata:
          type: object
          additionalProperties: true
        name:
          type: string
        period_amount_minor:
          type: integer
          minimum: 0
        price_id:
          type: string
          format: uuid
    DateRangeRestriction:
      type: object
      properties:
        gap_rule_periods:
          type: integer
          minimum: 0
        max_periods:
          type: integer
          minimum: 1
        min_periods:
          type: integer
          minimum: 1
    BookingLineItemResponse:
      type: object
      properties:
        amount_minor:
          type: integer
          minimum: 0
        currency:
          type: string
          pattern: ^[a-z]{3}$
        kind:
          enum:
            - add_on
            - deposit
            - fee
            - price
            - tax
        metadata:
          type: object
          additionalProperties: true
        price_id:
          type: string
        product_id:
          type: string
        quantity:
          type: integer
          minimum: 1
        title:
          type: string
  securitySchemes:
    SimplePayApiKey:
      type: http
      scheme: bearer

````