> ## 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 booking resource

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

## 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/resources`                                                      |
| Auth             | Bearer API key del ambiente correcto.                                                  |
| Scope            | `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/resources" \
  -H "Authorization: Bearer $SIMPLEPAY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: create-booking-resource_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/resources
openapi: 3.1.0
info:
  title: SimplePay API
  version: '2026-06-13'
servers:
  - url: https://api.simplepay.mx
security:
  - SimplePayApiKey: []
paths:
  /v1/bookable-payments/resources:
    post:
      summary: Create a booking resource
      operationId: createBookingResource
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BookingResourceCreate'
      responses:
        '201':
          description: Booking resource created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookingResource'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: true
      schema:
        type: string
        minLength: 8
        maxLength: 255
  schemas:
    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
    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
  securitySchemes:
    SimplePayApiKey:
      type: http
      scheme: bearer

````