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

# Create a Bookable Payments scheduling setup preset

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

## 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/setup`                                                          |
| Auth             | Bearer API key del ambiente correcto.                                                  |
| Scope            | `products:write`, `availability: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/setup" \
  -H "Authorization: Bearer $SIMPLEPAY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: create-bookable-payments-setup_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/setup
openapi: 3.1.0
info:
  title: SimplePay API
  version: '2026-06-13'
servers:
  - url: https://api.simplepay.mx
security:
  - SimplePayApiKey: []
paths:
  /v1/bookable-payments/setup:
    post:
      summary: Create a Bookable Payments scheduling setup preset
      operationId: createBookablePaymentsSetup
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BookablePaymentsSetupCreate'
      responses:
        '201':
          description: Bookable Payments setup created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookablePaymentsSetupResponse'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: true
      schema:
        type: string
        minLength: 8
        maxLength: 255
  schemas:
    BookablePaymentsSetupCreate:
      type: object
      required:
        - name
        - price
      properties:
        capacity:
          type: integer
          minimum: 1
        event_type:
          $ref: '#/components/schemas/BookingEventTypeCreate'
        name:
          type: string
          minLength: 1
        price:
          $ref: '#/components/schemas/ProductPrice'
        product:
          $ref: '#/components/schemas/ProductUpsert'
        resource:
          $ref: '#/components/schemas/BookingResourceCreate'
        schedule:
          type: object
          properties:
            end_time:
              type: string
              pattern: ^([01][0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$
            metadata:
              type: object
              additionalProperties: true
            name:
              type: string
            start_time:
              type: string
              pattern: ^([01][0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$
            weekdays:
              type: array
              items:
                type: integer
                minimum: 0
                maximum: 6
          additionalProperties: true
        time_zone:
          type: string
        use_case:
          enum:
            - appointment
            - class
            - scheduled_offer
            - experience
            - rental
            - service
            - date_range
            - tour
      additionalProperties: true
    BookablePaymentsSetupResponse:
      type: object
      properties:
        blueprint:
          $ref: '#/components/schemas/BookablePaymentsBlueprint'
        event_type:
          $ref: '#/components/schemas/BookingEventType'
        next:
          type: object
          properties:
            checkout_route:
              type: string
            config_route:
              type: string
            preflight_route:
              type: string
            slots_route:
              type: string
        object:
          const: bookable_payments.setup
        product:
          $ref: '#/components/schemas/Product'
        resource:
          $ref: '#/components/schemas/BookingResource'
        schedule:
          $ref: '#/components/schemas/AvailabilitySchedule'
        tenant_env:
          type: string
    BookingEventTypeCreate:
      type: object
      properties:
        active:
          type: boolean
        booking_form_fields:
          type: array
          items:
            type: object
            additionalProperties: true
        booking_window_days:
          type:
            - integer
            - 'null'
          minimum: 1
        buffer_after_minutes:
          type: integer
          minimum: 0
        buffer_before_minutes:
          type: integer
          minimum: 0
        cancellation_policy:
          type: object
          additionalProperties: true
        capacity:
          type: integer
          minimum: 1
        confirmation_policy:
          enum:
            - automatic
            - manual
            - payment_required
        default_price_id:
          type:
            - string
            - 'null'
          format: uuid
        description:
          type:
            - string
            - 'null'
        duration_choices_minutes:
          type: array
          items:
            type: integer
            minimum: 1
        duration_minutes:
          type: integer
          minimum: 1
        inventory_mode:
          enum:
            - capacity_pool
            - date_range
            - instant
            - seated
            - unit_assignment
        kind:
          enum:
            - appointment
            - class
            - scheduled_offer
            - experience
            - rental
            - service
            - date_range
        maximum_quantity:
          type:
            - integer
            - 'null'
          minimum: 1
        metadata:
          type: object
          additionalProperties: true
        minimum_notice_minutes:
          type: integer
          minimum: 0
        minimum_quantity:
          type: integer
          minimum: 1
        payment_config:
          type: object
          additionalProperties: true
        payment_requirement:
          enum:
            - deposit
            - none
            - optional
            - required
        product_id:
          type:
            - string
            - 'null'
          format: uuid
        resource_ids:
          type: array
          items:
            type: string
            format: uuid
        reschedule_policy:
          type: object
          additionalProperties: true
        schedule_ids:
          type: array
          items:
            type: string
            format: uuid
        slug:
          type: string
          pattern: ^[a-z0-9][a-z0-9-]{1,120}$
        slot_interval_minutes:
          type: integer
          minimum: 1
        time_zone:
          type: string
        title:
          type: string
          minLength: 1
      additionalProperties: true
    ProductPrice:
      type: object
      required:
        - amount
        - currency
      properties:
        amount:
          type: integer
          minimum: 1
        currency:
          type: string
          pattern: ^[a-z]{3}$
    ProductUpsert:
      type: object
      properties:
        active:
          type: boolean
        booking:
          $ref: '#/components/schemas/ProductBookingConfig'
        description:
          type: string
        metadata:
          type: object
          additionalProperties: true
        name:
          type: string
          minLength: 1
        price:
          $ref: '#/components/schemas/ProductPrice'
        product_type:
          enum:
            - appointment
            - class
            - scheduled_offer
            - experience
            - rental
            - service
            - standard
            - date_range
    BookingResourceCreate:
      type: object
      required:
        - name
      properties:
        active:
          type: boolean
        capacity:
          type: integer
          minimum: 1
        external_ref:
          type:
            - string
            - 'null'
        kind:
          enum:
            - amenity
            - equipment
            - inventory_pool
            - space
            - staff
            - unit
            - vehicle
        location:
          type: object
          additionalProperties: true
        metadata:
          type: object
          additionalProperties: true
        name:
          type: string
          minLength: 1
        parent_resource_id:
          type:
            - string
            - 'null'
          format: uuid
        time_zone:
          type: string
      additionalProperties: true
    BookablePaymentsBlueprint:
      type: object
      properties:
        default_capacity:
          type: integer
          minimum: 1
        default_duration_minutes:
          type: integer
          minimum: 1
        default_resource_kind:
          type: string
        default_schedule:
          type: object
          properties:
            end_time:
              type: string
            start_time:
              type: string
            time_zone:
              type: string
            weekdays:
              type: array
              items:
                type: integer
                minimum: 0
                maximum: 6
        default_slot_interval_minutes:
          type: integer
          minimum: 1
        event_kind:
          type: string
        id:
          type: string
        inventory_mode:
          type: string
        label:
          type: string
        primitives:
          type: array
          items:
            type: string
        resource_assignment_mode:
          type: string
        spanish_label:
          type: string
        steps:
          type: array
          items:
            $ref: '#/components/schemas/BookablePaymentsBlueprintStep'
        webhook_events:
          type: array
          items:
            type: string
    BookingEventType:
      type: object
      properties:
        active:
          type: boolean
        bookingFormFields:
          type: array
          items:
            type: object
            additionalProperties: true
        bookingWindowDays:
          type: integer
          minimum: 1
        bufferAfterMinutes:
          type: integer
          minimum: 0
        bufferBeforeMinutes:
          type: integer
          minimum: 0
        cancellationPolicy:
          type: object
          additionalProperties: true
        capacity:
          type: integer
          minimum: 1
        confirmationPolicy:
          enum:
            - automatic
            - manual
            - payment_required
        defaultPrice:
          type: object
          properties:
            amount:
              type: integer
              minimum: 0
            currency:
              type: string
              pattern: ^[a-z]{3}$
            id:
              type: string
              format: uuid
        defaultPriceId:
          type: string
          format: uuid
        description:
          type: string
        durationChoicesMinutes:
          type: array
          items:
            type: integer
            minimum: 1
        durationMinutes:
          type: integer
          minimum: 1
        id:
          type: string
          format: uuid
        inventoryMode:
          enum:
            - capacity_pool
            - date_range
            - instant
            - seated
            - unit_assignment
        kind:
          enum:
            - appointment
            - class
            - scheduled_offer
            - experience
            - rental
            - service
            - date_range
        maximumQuantity:
          type: integer
          minimum: 1
        metadata:
          type: object
          additionalProperties: true
        minimumNoticeMinutes:
          type: integer
          minimum: 0
        minimumQuantity:
          type: integer
          minimum: 1
        object:
          const: booking_event_type
        paymentConfig:
          type: object
          additionalProperties: true
        paymentRequirement:
          enum:
            - deposit
            - none
            - optional
            - required
        product:
          type: object
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
        productId:
          type: string
          format: uuid
        reschedulePolicy:
          type: object
          additionalProperties: true
        slug:
          type: string
        slotIntervalMinutes:
          type: integer
          minimum: 1
        timeZone:
          type: string
        title:
          type: string
        updatedAt:
          type: string
          format: date-time
    Product:
      type: object
      properties:
        active:
          type: boolean
        booking:
          type: object
          properties:
            bufferAfterMinutes:
              type: integer
              minimum: 0
            bufferBeforeMinutes:
              type: integer
              minimum: 0
            capacity:
              type: integer
              minimum: 1
            config:
              type: object
              additionalProperties: true
            durationMinutes:
              type: integer
              minimum: 1
            enabled:
              type: boolean
            paymentRequired:
              type: boolean
            slotIntervalMinutes:
              type: integer
              minimum: 1
            timeZone:
              type: string
        defaultPrice:
          type: object
          properties:
            amount:
              type: integer
              minimum: 0
            currency:
              type: string
              pattern: ^[a-z]{3}$
            id:
              type: string
              format: uuid
        description:
          type: string
        id:
          type: string
          format: uuid
        metadata:
          type: object
          additionalProperties: true
        name:
          type: string
        object:
          const: product
        productType:
          enum:
            - appointment
            - bundle
            - class
            - scheduled_offer
            - experience
            - package
            - rental
            - service
            - standard
            - date_range
        updatedAt:
          type: string
          format: date-time
    BookingResource:
      type: object
      properties:
        active:
          type: boolean
        capacity:
          type: integer
          minimum: 1
        externalRef:
          type: string
        id:
          type: string
          format: uuid
        kind:
          enum:
            - amenity
            - equipment
            - inventory_pool
            - space
            - staff
            - unit
            - vehicle
        location:
          type: object
          additionalProperties: true
        metadata:
          type: object
          additionalProperties: true
        name:
          type: string
        object:
          const: booking_resource
        parentResourceId:
          type: string
          format: uuid
        timeZone:
          type: string
        updatedAt:
          type: string
          format: date-time
    AvailabilitySchedule:
      type: object
      properties:
        active:
          type: boolean
        id:
          type: string
          format: uuid
        metadata:
          type: object
          additionalProperties: true
        name:
          type: string
        object:
          const: availability_schedule
        overrides:
          type: array
          items:
            $ref: '#/components/schemas/AvailabilityOverride'
        rules:
          type: array
          items:
            $ref: '#/components/schemas/AvailabilityRule'
        timeZone:
          type: string
        updatedAt:
          type: string
          format: date-time
    ProductBookingConfig:
      type: object
      properties:
        buffer_after_minutes:
          type: integer
          minimum: 0
        buffer_before_minutes:
          type: integer
          minimum: 0
        capacity:
          type: integer
          minimum: 1
        config:
          type: object
          additionalProperties: true
        duration_minutes:
          type: integer
          minimum: 1
        enabled:
          type: boolean
        payment_required:
          type: boolean
        slot_interval_minutes:
          type: integer
          minimum: 1
        time_zone:
          type: string
    BookablePaymentsBlueprintStep:
      type: object
      properties:
        estimated_minutes:
          type: integer
          minimum: 0
        id:
          type: string
        label:
          type: string
        phase:
          type: string
        readiness_keys:
          type: array
          items:
            type: string
        required_for_go_live:
          type: boolean
        required_routes:
          type: array
          items:
            type: string
        required_scopes:
          type: array
          items:
            type: string
        tenant_tables:
          type: array
          items:
            type: string
    AvailabilityOverride:
      type: object
      properties:
        active:
          type: boolean
        capacity:
          type: integer
          minimum: 0
        endsAt:
          type: string
          format: date-time
        id:
          type: string
          format: uuid
        metadata:
          type: object
          additionalProperties: true
        object:
          const: availability_override
        reason:
          type: string
        scheduleId:
          type: string
          format: uuid
        startsAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    AvailabilityRule:
      type: object
      properties:
        active:
          type: boolean
        capacity:
          type: integer
          minimum: 1
        endTime:
          type: string
        id:
          type: string
          format: uuid
        metadata:
          type: object
          additionalProperties: true
        object:
          const: availability_rule
        scheduleId:
          type: string
          format: uuid
        startTime:
          type: string
        updatedAt:
          type: string
          format: date-time
        weekday:
          type: integer
          minimum: 0
          maximum: 6
  securitySchemes:
    SimplePayApiKey:
      type: http
      scheme: bearer

````