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

# Update a booking's payment

> Allows an administrator or manager to manually update the payment status of any booking.
This is a protected endpoint. Access is restricted to users with `admin` or `manager` roles.




## OpenAPI

````yaml api-reference/openapi.json patch /api/bookings/{booking_id}
openapi: 3.0.0
info:
  title: Tandem IT API
  version: 1.0.0
  description: API for tandem it backend
servers:
  - url: https://tandem.hlofiys.xyz
    description: Production server
security: []
tags:
  - name: Documentation
    description: API documentation endpoint
paths:
  /api/bookings/{booking_id}:
    parameters:
      - name: booking_id
        in: path
        required: true
        schema:
          type: integer
          format: int64
    patch:
      tags:
        - 'Admin: Bookings'
      summary: Update a booking's payment
      description: >
        Allows an administrator or manager to manually update the payment status
        of any booking.

        This is a protected endpoint. Access is restricted to users with `admin`
        or `manager` roles.
      operationId: updateBookingStatus
      requestBody:
        description: The new payment status.
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - is_paid
              properties:
                is_paid:
                  type: boolean
                  example: true
      responses:
        '200':
          description: >-
            Booking status updated successfully. Returns the full, updated
            booking object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Booking'
        '400':
          description: >-
            Bad Request. The request body is malformed (e.g., missing 'is_paid'
            field)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '401':
          description: >-
            Unauthorized. Authentication credentials were not provided or are
            invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden. The authenticated user is not an administrator
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found. A booking with the specified ID was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error. An unexpected error occurred on the server.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - BearerAuth: []
components:
  schemas:
    Booking:
      type: object
      required:
        - booking_id
        - user_id
        - event_id
        - seat_id
        - is_paid
        - created_at
        - updated_at
      properties:
        booking_id:
          type: integer
          format: int64
        user_id:
          type: string
          format: uuid
        event_id:
          type: integer
          format: int64
        seat_id:
          type: integer
          format: int64
        is_paid:
          type: boolean
          description: >-
            Indicates whether the booking has been paid for. `false` for initial
            reservation
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    ValidationError:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          example: Validation failed
        errors:
          type: object
          description: A map of field names to their respective error messages.
          additionalProperties:
            type: string
          example:
            name: The name field is required.
            price: The price must be a valid number.
            hall_id: A valid hall_id is required.
    Error:
      type: object
      required:
        - message
      properties:
        message:
          type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````