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

# hotel-cancel

> Cancel a hotel booking and get a refund when eligible

Cancel a hotel booking when the traveler can no longer make the stay or wants to drop a hotel from a multi-item trip. The call is idempotent: retrying the same cancellation re-serves the stored result rather than charging or refunding twice. Works with guest auth (booking ref + last name) or the authenticated shortcut (provider booking ID).

Two auth modes:

* **Guest**: `booking_ref` + `last_name` together.
* **Authenticated**: `provider_booking_id` (optionally with `provider`).

The two modes are mutually exclusive.


## OpenAPI

````yaml api-reference/public-api.yaml POST /v1/hotel_cancel
openapi: 3.0.0
info:
  title: Jinko Public API
  version: 0.1.0
  description: >-
    Curated public REST surface for Jinko. Authenticated with jnk_ API keys. See
    https://docs.gojinko.com for guides.
servers: []
security: []
paths:
  /v1/hotel_cancel:
    post:
      tags:
        - Post-booking
      summary: Cancel a hotel booking and get a refund when eligible
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HotelCancelRequest'
      responses:
        '200':
          description: Cancel a hotel booking and get a refund when eligible
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HotelCancelResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: BAD_REQUEST
                  message: Malformed JSON in request body.
                  doc_url: https://docs.gojinko.com/concepts/errors
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: AUTH_REQUIRED
                  message: Invalid or expired API key.
                  doc_url: https://docs.gojinko.com/api-reference/authentication
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: BAD_REQUEST
                  message: >-
                    origins: origins is required; trip_type: trip_type is
                    required
                  doc_url: https://docs.gojinko.com/concepts/errors
        '429':
          description: Rate limit or quota exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: RATE_LIMITED
                  message: Rate limit or quota exceeded.
                  doc_url: https://docs.gojinko.com/concepts/errors
        '502':
          description: Upstream service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: UPSTREAM_ERROR
                  message: Upstream travel provider returned an error. Please retry.
                  doc_url: https://docs.gojinko.com/concepts/errors
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
components:
  schemas:
    HotelCancelRequest:
      type: object
      properties:
        provider_booking_id:
          type: string
          example: NUITEE-88231
        provider:
          type: string
          example: nuitee
        booking_ref:
          type: string
          example: JNK-H1ZK90
        last_name:
          type: string
          example: Carrard
        intent:
          $ref: '#/components/schemas/IntentInput'
    HotelCancelResponse:
      type: object
      properties:
        provider_booking_id:
          type: string
          example: NUITEE-88231
        provider:
          type: string
          example: nuitee
        status:
          type: string
          example: cancelled
        refund_amount:
          type: object
          properties:
            value:
              type: number
              example: 318.4
            amount:
              type: number
            currency:
              type: string
              example: USD
            decimal_places:
              type: integer
              example: 2
        penalty_amount:
          type: object
          properties:
            value:
              type: number
              example: 318.4
            amount:
              type: number
            currency:
              type: string
              example: USD
            decimal_places:
              type: integer
              example: 2
        connector_reference:
          type: string
          example: cxl_2f90a1c3
        cancelled_at:
          type: string
          example: '2026-06-01T12:34:56Z'
        idempotent:
          type: boolean
          example: false
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            doc_url:
              type: string
          required:
            - code
            - message
      required:
        - error
    IntentInput:
      type: object
      properties:
        user_intent:
          type: string
          nullable: true
          description: >-
            The user's natural-language intent: the Alpic PII-stripped
            paraphrase when available, else a best-effort fallback to the
            client-provided NL query.
          example: find a cheap flight to Tokyo
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
    BearerAuth:
      type: http
      scheme: bearer

````