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

# Cancel Booking

> Cancels a paid booking and processes refund according to cancellation policy. The booking must have status "Paid by Customer" to be eligible for cancellation.



## OpenAPI

````yaml POST /bookings/cancel-booking
openapi: 3.0.0
info:
  title: Seyaha Reseller API
  description: API endpoints for reseller operations
  version: 1.0.0
servers:
  - url: /api/v1/resellers
    description: Reseller API base URL
security: []
paths:
  /bookings/cancel-booking:
    post:
      tags:
        - Reseller Activities
      summary: Cancel a booking
      description: >-
        Cancels a paid booking and processes refund according to cancellation
        policy. The booking must have status "Paid by Customer" to be eligible
        for cancellation.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CancelBookingRequest'
            example:
              booking_id: 60d21b4667d0d8992e610c87
      responses:
        '200':
          description: Booking cancelled successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: integer
                    example: 1
                  data:
                    $ref: '#/components/schemas/Booking'
        '400':
          description: Bad request - booking cannot be cancelled
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: integer
                    example: 0
                  error:
                    type: array
                    items:
                      type: string
                    example:
                      - Booking is not paid, you can't cancel unpaid booking
                  message:
                    type: string
                    example: Booking is not paid, you can't cancel unpaid booking
                  code:
                    type: integer
                    example: 400
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/ServerError'
      security:
        - bearerAuth: []
components:
  schemas:
    CancelBookingRequest:
      type: object
      required:
        - booking_id
      properties:
        booking_id:
          type: string
          description: ID of the booking to cancel
          example: 60d21b4667d0d8992e610c87
    Booking:
      type: object
      properties:
        _id:
          type: string
          example: 60d21b4667d0d8992e610c87
        activity_id:
          type: string
          example: 60d21b4667d0d8992e610c85
        variation_id:
          type: string
          example: 60d21b4667d0d8992e610c86
        reseller_id:
          type: string
          example: 60d21b4667d0d8992e610c82
        status:
          type: string
          enum:
            - Booking Attempt
            - Paid by Customer
            - Cancelled
          example: Paid by Customer
        partnerConfirmation:
          type: string
          enum:
            - Pending
            - Confirmed
            - Rejected
            - Not Required
          example: Confirmed
        bookingDate:
          type: string
          example: '2023-07-15'
        bookingTime:
          type: string
          example: '10:00'
        price:
          type: object
          properties:
            totalPrice:
              type: number
              example: 150
            affiliateDeservedAmount:
              type: number
              example: 15
        external_payment_id:
          type: string
          example: pay_1N9dvSLkdIwHu2QOxgMtN9dE
  responses:
    Unauthorized:
      description: Unauthorized access
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: integer
                example: 0
              error:
                type: array
                items:
                  type: string
                example:
                  - unauthorized access
              message:
                type: string
                example: unauthorized access
              code:
                type: integer
                example: 401
    ServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: integer
                example: 0
              error:
                type: array
                items:
                  type: string
                example:
                  - unexpected error
              message:
                type: string
                example: unexpected error
              code:
                type: integer
                example: 500
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````