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

# Quote Cancellation

> Retrieve and lock the current cancellation consequence before cancelling.

Call this immediately before cancellation. The response contains a short-lived
`quote_id`, the accepted offer ID, the current normalized cancellation policy,
and one of these penalty states:

| State       | Meaning                                                                    |
| ----------- | -------------------------------------------------------------------------- |
| `NO_CHARGE` | The current known penalty is zero.                                         |
| `KNOWN`     | `penalty` contains the supplier-currency Money amount.                     |
| `UNKNOWN`   | No reliable current amount can be computed; `penalty` is null, never zero. |

The quote expires after five minutes or at the next known cancellation-policy
boundary, whichever happens first. Submit its `quote_id` unchanged to
[Cancel Booking](/api-reference/cancel-booking).


## OpenAPI

````yaml reference/openapi.json POST /hotels/book/{booking_id}/cancellation-quote
openapi: 3.0.0
info:
  title: Unifystays API
  description: >-
    One unified hotel API across suppliers. Integrate once, then enable and
    manage suppliers from the Unifystays portal.
  version: '1.0'
  contact: {}
servers:
  - url: https://api-sandbox.unifystays.com
    description: Sandbox
  - url: https://api.unifystays.com
    description: Production
security:
  - x-api-key: []
tags: []
paths:
  /hotels/book/{booking_id}/cancellation-quote:
    post:
      tags:
        - Hotels
      summary: Quote the current cancellation consequence
      description: >-
        Returns a short-lived cancellation quote. UNKNOWN means the supplier
        does not expose a reliably computable amount; accepting the quote still
        explicitly acknowledges that condition.
      operationId: HotelBookingController_quoteCancellation
      parameters:
        - name: booking_id
          required: true
          in: path
          schema:
            type: string
        - name: language
          description: Enter language code(ex. en)
          in: header
          schema: {}
        - name: X-Unifystays-Contract-Version
          in: header
          required: false
          description: Hotel API contract version. Missing defaults to v1.
          schema:
            type: string
            enum:
              - '1'
            default: '1'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HotelCancellationQuoteResponseDto'
          headers:
            X-Unifystays-Contract-Version:
              description: Selected hotel contract version.
              schema:
                type: string
                enum:
                  - '1'
        '406':
          description: CONTRACT_VERSION_UNSUPPORTED
          headers:
            X-Unifystays-Contract-Version:
              description: Selected hotel contract version.
              schema:
                type: string
                enum:
                  - '1'
components:
  schemas:
    HotelCancellationQuoteResponseDto:
      type: object
      properties:
        contract_version:
          type: string
          example: '1'
        success:
          type: boolean
        message:
          type: string
        data:
          $ref: '#/components/schemas/CancellationQuoteDataDto'
      required:
        - contract_version
        - success
        - message
        - data
    CancellationQuoteDataDto:
      type: object
      properties:
        quote_id:
          type: string
        booking_id:
          type: string
        accepted_offer_id:
          type: string
        expires_at:
          type: string
        cancellable:
          type: boolean
        penalty_status:
          type: string
          enum:
            - NO_CHARGE
            - KNOWN
            - UNKNOWN
        penalty:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/MoneyDto'
        cancellation:
          $ref: '#/components/schemas/CancellationDto'
      required:
        - quote_id
        - booking_id
        - accepted_offer_id
        - expires_at
        - cancellable
        - penalty_status
        - penalty
        - cancellation
    MoneyDto:
      type: object
      properties:
        amount_minor:
          type: number
          example: 17700
          description: >-
            Integer minor units. Interpret using currency_exponent; 17700 with
            exponent 2 is 177.00.
        currency:
          type: string
          example: USD
        currency_exponent:
          type: number
          example: 2
      required:
        - amount_minor
        - currency
        - currency_exponent
    CancellationDto:
      type: object
      properties:
        refundability:
          type: string
          enum:
            - REFUNDABLE
            - PARTIALLY_REFUNDABLE
            - NON_REFUNDABLE
            - UNKNOWN
        policy_stage:
          type: string
          enum:
            - INDICATIVE
            - RECHECKED
            - FINAL
        free_cancellation_until:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/StructuredDateTimeDto'
        policy_text:
          type: string
        penalties:
          type: array
          items:
            $ref: '#/components/schemas/CancellationPenaltyDto'
        no_show:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/NoShowDto'
      required:
        - refundability
        - policy_stage
        - free_cancellation_until
        - policy_text
        - penalties
        - no_show
    StructuredDateTimeDto:
      type: object
      properties:
        local_datetime:
          type: string
          example: '2026-05-18T23:59:59'
        timezone:
          type: string
          example: UTC
          nullable: true
        utc_datetime:
          type: string
          example: '2026-05-18T23:59:59.000Z'
          nullable: true
      required:
        - local_datetime
        - timezone
        - utc_datetime
    CancellationPenaltyDto:
      type: object
      properties:
        from:
          $ref: '#/components/schemas/StructuredDateTimeDto'
        to:
          nullable: true
          description: >-
            Exclusive end of this penalty window when supplied. Null means the
            rule is open-ended, not that the policy is incomplete.
          type: object
          allOf:
            - $ref: '#/components/schemas/StructuredDateTimeDto'
        charge_basis:
          type: string
          enum:
            - FIXED_AMOUNT
            - PERCENTAGE
            - NIGHTS
            - FULL_STAY
            - UNKNOWN
        percentage:
          type: number
          nullable: true
        number_of_nights:
          type: number
          nullable: true
        native_amount:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/MoneyDto'
        usd_amount:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/MoneyDto'
        conversion_status:
          type: string
          enum:
            - AVAILABLE
            - UNAVAILABLE
        description:
          type: string
        calculation_basis:
          type: string
          enum:
            - TOTAL
            - ROOM_RATE
            - FIRST_NIGHT
            - NIGHTLY_RATE
            - SUPPLIER_DEFINED
            - UNKNOWN
        scope:
          $ref: '#/components/schemas/ChargeScopeDto'
      required:
        - from
        - to
        - charge_basis
        - percentage
        - number_of_nights
        - native_amount
        - usd_amount
        - conversion_status
        - description
        - calculation_basis
        - scope
    NoShowDto:
      type: object
      properties:
        trigger:
          type: string
          enum:
            - NO_SHOW
        applies_from_local_time:
          type: string
          nullable: true
          example: '18:00:00'
          description: >-
            Supplier-local no-show cutoff time when supplied. No date or
            timezone is inferred.
        penalty:
          nullable: true
          description: >-
            Charge triggered by a no-show. Null means no monetary no-show charge
            was supplied; it never means a zero charge was inferred.
          type: object
          allOf:
            - $ref: '#/components/schemas/NoShowPenaltyDto'
      required:
        - trigger
        - applies_from_local_time
        - penalty
    ChargeScopeDto:
      type: object
      properties:
        basis:
          type: string
          enum:
            - PER_STAY
            - PER_ROOM
            - PER_ROOM_PER_NIGHT
            - PER_PERSON
            - PER_PERSON_PER_NIGHT
        room_allocation_id:
          type: string
          nullable: true
        guest_type:
          type: string
          enum:
            - ADULT
            - CHILD
            - INFANT
          nullable: true
        quantity:
          type: number
          nullable: true
      required:
        - basis
        - room_allocation_id
        - guest_type
        - quantity
    NoShowPenaltyDto:
      type: object
      properties:
        charge_basis:
          type: string
          enum:
            - FIXED_AMOUNT
            - UNKNOWN
        native_amount:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/MoneyDto'
        usd_amount:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/MoneyDto'
        conversion_status:
          type: string
          enum:
            - AVAILABLE
            - UNAVAILABLE
            - NOT_REQUIRED
        calculation_basis:
          type: string
          enum:
            - SUPPLIER_DEFINED
        scope:
          $ref: '#/components/schemas/ChargeScopeDto'
      required:
        - charge_basis
        - native_amount
        - usd_amount
        - conversion_status
        - calculation_basis
        - scope
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: Environment-specific API key created in the Unifystays portal

````