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

# Create a booking

> Create a new booking for a resource



## OpenAPI

````yaml /api-reference/openapi.yaml post /bookings
openapi: 3.0.3
info:
  title: Rntor API
  description: REST API for programmatic access to your coworking and space management data
  version: 1.0.0
  contact:
    email: support@rntor.com
    url: https://app.rntor.com
servers:
  - url: https://api.rntor.com/v1
    description: Production server
security:
  - bearerAuth: []
    clientId: []
tags:
  - name: Merchant
    description: Merchant operations
  - name: Bookings
    description: Booking management
  - name: Companies
    description: Company management
  - name: Resources
    description: Resource management
  - name: Locations
    description: Location management
  - name: Invoices
    description: Invoice and credit note management
  - name: Subscriptions
    description: Customer subscription management
  - name: Events
    description: Event management
  - name: Plans
    description: Membership plan management
  - name: Memberships
    description: Membership management
  - name: Benefits
    description: Benefits, categories, and applications
  - name: Contracts
    description: Contract management
  - name: Feed
    description: Feed posts, comments, and likes
  - name: Shop
    description: Shop orders, categories, and products
  - name: Members
    description: Member registrations
  - name: Tickets
    description: Support ticket management
  - name: Transactions
    description: Credit, day pass, and payment transactions
  - name: Visitors
    description: Visitor contacts, requests, and visits
paths:
  /bookings:
    post:
      tags:
        - Bookings
      summary: Create a booking
      description: Create a new booking for a resource
      operationId: createBooking
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - resource_id
                - customer_id
                - location_id
                - start_time
                - end_time
              properties:
                resource_id:
                  type: string
                  format: uuid
                customer_id:
                  type: string
                  format: uuid
                location_id:
                  type: string
                  format: uuid
                start_time:
                  type: string
                  format: date-time
                end_time:
                  type: string
                  format: date-time
                title:
                  type: string
                notes:
                  type: string
                attendees:
                  type: integer
      responses:
        '201':
          description: Booking created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Booking'
                  meta:
                    $ref: '#/components/schemas/Meta'
              example:
                data:
                  id: 3c90c3cc-0d44-4b50-8888-8dd25736052a
                  resource_id: 4d91d4dd-1e55-5c61-9999-9ee36847163b
                  customer_id: 5e02e5ee-2f66-6d72-0000-0ff47958274c
                  location_id: 6f13f6ff-3g77-7e83-1111-1gg58069385d
                  start_time: '2024-01-15T09:00:00Z'
                  end_time: '2024-01-15T10:00:00Z'
                  status: confirmed
                  title: Team Meeting
                  created_at: '2024-01-14T15:30:00Z'
                  updated_at: '2024-01-14T15:30:00Z'
                meta:
                  request_id: req_abc123def456
                  timestamp: '2024-01-15T10:30:00Z'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '409':
          $ref: '#/components/responses/Conflict'
components:
  schemas:
    Booking:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: 3c90c3cc-0d44-4b50-8888-8dd25736052a
        resource_id:
          type: string
          format: uuid
        customer_id:
          type: string
          format: uuid
        location_id:
          type: string
          format: uuid
        start_time:
          type: string
          format: date-time
          example: '2024-01-15T09:00:00Z'
        end_time:
          type: string
          format: date-time
          example: '2024-01-15T10:00:00Z'
        status:
          type: string
          enum:
            - pending
            - confirmed
            - cancelled
            - completed
          example: confirmed
        title:
          type: string
          example: Team Meeting
        notes:
          type: string
        attendees:
          type: integer
          example: 4
        total_amount:
          type: number
          example: 50
        currency:
          type: string
          example: USD
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Meta:
      type: object
      properties:
        request_id:
          type: string
          example: req_abc123def456
        timestamp:
          type: string
          format: date-time
          example: '2024-01-15T10:30:00Z'
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: validation_error
            message:
              type: string
              example: The request body is missing required field 'email'
            details:
              type: object
              properties:
                field:
                  type: string
                  example: email
                reason:
                  type: string
                  example: required
        meta:
          type: object
          properties:
            request_id:
              type: string
              example: req_abc123def456
  responses:
    BadRequest:
      description: Bad Request - Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: validation_error
              message: The request body is missing required field 'email'
              details:
                field: email
                reason: required
            meta:
              request_id: req_abc123def456
    Unauthorized:
      description: Unauthorized - Invalid or missing credentials
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: invalid_token
              message: The access token is invalid or expired
            meta:
              request_id: req_abc123def456
    Conflict:
      description: Conflict - Resource already exists or operation conflicts
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: conflict
              message: The resource is not available for the requested time slot
            meta:
              request_id: req_abc123def456
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Your API client secret
    clientId:
      type: apiKey
      in: header
      name: X-Client-ID
      description: Your API client ID

````