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

# car-cancel-commit

> Cancel a car rental booking

Cancel the booking at the rental provider and refund the customer's payment minus the cancellation fee. Requires the `cancellation_id` from a preceding preview, binding the commit to the fee the customer saw. Safe to call twice, a committed cancellation is reported as it stands rather than repeated. `state: confirmed` is done; `state: pending` is recorded but not finished, the platform is still completing it, or a Jinko agent has it, so read car\_cancel\_status rather than committing again. `refund_pending_review: true` means the refund needs a person before it is issued. A preview that answered `manual_required: true` is committed with `manual_ok: true`, once the customer agrees: the cancellation is then recorded for a Jinko agent (`state: pending`, `refund_pending_review: true`) and nothing is sent to the rental company by this call. Without the flag that commit is refused 409 `manual_required`. The other 409 refusals are `QUOTE_EXPIRED` (preview again), `quote_drift` (the refund moved; commit against the `retry_quote_id` it names after showing the customer `current.refund`), `active_operation_exists`, `not_cancellable` and `funds_unavailable`, see `CarServicingConflictCode`. In every one of them nothing was cancelled.


## OpenAPI

````yaml api-reference/public-api.yaml POST /v1/car_cancel_commit
openapi: 3.0.0
info:
  title: Jinko Public API
  version: 0.125.0
  description: >-
    Curated public REST surface for Jinko. Authenticated with jnk_ API keys. See
    https://docs.gojinko.com for guides.


    ### Per-end-user attribution


    On booking calls you may send an optional `X-End-User-Id` request header to
    attribute the booking to one of your own end users (for per-end-user
    attribution and rate-limiting). The value is an **opaque, tenant-scoped**
    identifier that you choose — not a Jinko account id. Omit it to book as the
    tenant. Values prefixed `user_` or `org_` are rejected.
servers:
  - url: https://api.gojinko.com
    description: Production
  - url: https://api.sandbox.gojinko.com
    description: Sandbox
security: []
paths:
  /v1/car_cancel_commit:
    post:
      tags:
        - Cars
      summary: Cancel a car rental booking
      description: >-
        Cancel the booking at the rental provider and refund the customer's
        payment minus the cancellation fee. Requires the `cancellation_id` from
        a preceding preview, binding the commit to the fee the customer saw.
        Safe to call twice — a committed cancellation is reported as it stands
        rather than repeated. `state: confirmed` is done; `state: pending` is
        recorded but not finished — the platform is still completing it, or a
        Jinko agent has it — so read car_cancel_status rather than committing
        again. `refund_pending_review: true` means the refund needs a person
        before it is issued. A preview that answered `manual_required: true` is
        committed with `manual_ok: true`, once the customer agrees: the
        cancellation is then recorded for a Jinko agent (`state: pending`,
        `refund_pending_review: true`) and nothing is sent to the rental company
        by this call. Without the flag that commit is refused 409
        `manual_required`. The other 409 refusals are `QUOTE_EXPIRED` (preview
        again), `quote_drift` (the refund moved; commit against the
        `retry_quote_id` it names after showing the customer `current.refund`),
        `active_operation_exists`, `not_cancellable` and `funds_unavailable` —
        see `CarServicingConflictCode`. In every one of them nothing was
        cancelled.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CarCancelCommitRequest'
      responses:
        '200':
          description: Cancellation result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CarCancelCommitResponse'
        '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/authentication/api-keys
        '402':
          description: Payment required — organization balance exhausted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: PAYMENT_REQUIRED
                  message: >-
                    Insufficient balance — this call costs $0.0150 and your
                    organization has $0.0000 available. Top up at
                    https://dashboard.gojinko.com/developers/billing/topup
                  doc_url: https://docs.gojinko.com/concepts/errors
        '404':
          description: Unknown booking_ref + last_name pair.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: NOT_FOUND
                  message: booking not found
        '409':
          description: >-
            The commit cannot run as quoted; nothing was cancelled and no money
            moved. `code` says which case, as a sibling of `error` — see
            `CarServicingConflictCode` for the closed list and what each one
            asks of you. A 409 whose `code` is outside that list is NOT a
            servicing refusal: it arrives as the plain error envelope, with no
            `code` beside it.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/CarServicingConflictResponse'
                  - $ref: '#/components/schemas/BookingSelectionConflict'
              example:
                error:
                  code: CONFLICT
                  message: this quote cannot be committed
                code: manual_required
        '410':
          description: The resource this request names no longer exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: GONE
                  message: The resource no longer exists.
                  doc_url: https://docs.gojinko.com/concepts/errors
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: BAD_REQUEST
                  message: A required field is missing or invalid.
                  doc_url: https://docs.gojinko.com/concepts/errors
        '429':
          description: Rate limit or quota exceeded
          headers:
            Retry-After:
              description: >-
                Seconds to wait before retrying. Absent when no interval
                applies.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: RATE_LIMITED
                  message: Too many requests. Retry after the Retry-After delay.
                  doc_url: https://docs.gojinko.com/concepts/errors
        '502':
          description: The travel provider rejected the request, or an upstream call failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: UPSTREAM_REJECTED
                  message: The request was declined for this offer. Try another offer.
                  doc_url: https://docs.gojinko.com/concepts/errors
        '503':
          description: No travel provider can serve the request right now
          headers:
            Retry-After:
              description: >-
                Seconds to wait before retrying. Absent when no interval
                applies.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: UPSTREAM_UNAVAILABLE
                  message: >-
                    The service is temporarily unavailable. Retry after the
                    Retry-After delay.
                  doc_url: https://docs.gojinko.com/concepts/errors
        '504':
          description: The travel provider did not answer in time
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: UPSTREAM_TIMEOUT
                  message: >-
                    The request timed out before a result was available. Retry
                    the request.
                  doc_url: https://docs.gojinko.com/concepts/errors
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
components:
  schemas:
    CarCancelCommitRequest:
      type: object
      properties:
        booking_ref:
          type: string
          minLength: 1
          description: >-
            Jinko booking reference. Call get_booking first, then select its
            booked_item_id for servicing.
          example: JNK-A0AUR2
        booked_item_id:
          type: string
          pattern: ^itm_[a-z2-7]+$(?![\s\S])
          description: >-
            The booked item, from get_booking items[].booked_item_id. Preserved
            across exchanges. Omit only when the booking has exactly one item of
            the requested domain; otherwise a 409 returns items to choose from.
          example: itm_aaaaaaaaaaaaafhuxsdxpbzrbfz5hm3a
        last_name:
          type: string
          minLength: 1
          description: >-
            Required for guest lookup. A credential that owns the booking may
            omit it; ownership is checked by the platform.
          example: Doe
        intent:
          $ref: '#/components/schemas/IntentInput'
        quote_id:
          type: string
          minLength: 1
          description: >-
            The `quote_id` from a preceding car_cancel_preview. Binds the commit
            to the fee the customer saw.
          example: ccl_2f7c9a4e8b1d4c6f9e3a5b7d1c2e4f6a
        reason:
          type: string
          description: Optional free-text cancellation reason.
          example: Change of plans
        manual_ok:
          type: boolean
          description: >-
            Send `true` to commit a preview that answered `manual_required:
            true`. The cancellation is then recorded for a Jinko agent — NOTHING
            is sent to the rental company by this call — and the answer is
            `state: pending` with `refund_pending_review: true`; the agent
            completes it and settles the refund by hand, and car_cancel_status
            reports the outcome. Without the flag such a commit is refused 409
            `manual_required`, so a customer is never put in an agent queue
            unasked: send it only once the customer has agreed to that. On a
            preview that can be committed online the flag changes nothing.
          example: false
      required:
        - booking_ref
        - quote_id
      example:
        booking_ref: JNK-8PT9VS
        last_name: Doe
        quote_id: ccl_2f7c9a4e8b1d4c6f9e3a5b7d1c2e4f6a
    CarCancelCommitResponse:
      type: object
      properties:
        quote_id:
          type: string
          description: The quote this cancellation was committed against.
          example: ccl_2f7c9a4e8b1d4c6f9e3a5b7d1c2e4f6a
        cancellation_id:
          type: string
          description: 'Deprecated: use `quote_id` instead. Same value.'
          example: ccl_2f7c9a4e8b1d4c6f9e3a5b7d1c2e4f6a
          deprecated: true
        state:
          type: string
          description: >-
            `confirmed` — cancelled and the refund issued or on its way.
            `pending` — recorded but not finished: the platform is still
            completing it, or (with `refund_pending_review: true`) a Jinko agent
            has it; read car_cancel_status, do not commit again. `rejected` —
            the rental company declined; the booking still stands and
            `rejected_reason` says why. `failed` — the attempt did not complete;
            read car_cancel_status before trying again.
          example: confirmed
        fee_known:
          type: boolean
        fee:
          $ref: '#/components/schemas/CarAmount'
        paid:
          $ref: '#/components/schemas/CarAmount'
        refund_amount:
          $ref: '#/components/schemas/CarAmount'
        refund_pending_review:
          type: boolean
          description: >-
            true means the booking IS cancelled (or, with `state: pending`,
            recorded for a Jinko agent) but the refund needs a person before it
            is issued — do not quote `refund_amount` as final.
        stripe_refund_id:
          type: string
          description: Deprecated. An internal payment reference.
          deprecated: true
        rejected_reason:
          type: string
        completed_at:
          type: string
          example: '2026-08-20T15:18:00Z'
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - INVALID_SEGMENTS_TO_EXCHANGE
                - PARTIAL_EXCHANGE_UNSUPPORTED
                - LEG_ALREADY_DEPARTED
                - DEPARTURE_DATE_IN_PAST
                - LEG_DATES_OUT_OF_ORDER
                - INVALID_EXCHANGE_REQUEST
                - NOT_EXCHANGEABLE
                - CREDENTIAL_FORMAT_INVALID
                - PAYMENT_TYPE_NOT_ENABLED
                - PAYMENT_CREDENTIAL_INVALID
                - TRIP_OWNED_BY_OTHER_PAYMENT
                - IDEMPOTENCY_KEY_REUSED
                - ATTEMPT_IN_PROGRESS
                - ATTEMPT_TERMINAL
                - TEMPORARILY_UNAVAILABLE
                - AUTH_REQUIRED
                - PAYMENT_REQUIRED
                - RATE_LIMITED
                - BAD_REQUEST
                - FORBIDDEN
                - NOT_FOUND
                - CONFLICT
                - GONE
                - QUOTE_PENDING
                - QUOTE_EXPIRED
                - TRIP_EXPIRED
                - TRIP_STATE_CONFLICT
                - OFFER_EXPIRED
                - OFFER_UNAVAILABLE
                - MISSING_CUSTOMER_DETAILS
                - INVALID_PHONE_NUMBER
                - INVALID_FLIGHT_NUMBER
                - CURRENCY_UNSUPPORTED
                - HOTEL_NAME_LOW_CONFIDENCE
                - DESTINATION_LOW_CONFIDENCE
                - UPSTREAM_REJECTED
                - UPSTREAM_UNAVAILABLE
                - UPSTREAM_TIMEOUT
                - UPSTREAM_ERROR
                - INTERNAL
              description: >-
                What went wrong, as a stable machine-readable code. This is a
                closed set — branch on it rather than on `message`, which is
                prose and may change. New codes arrive in a minor version, so
                treat an unknown one as its HTTP status. A code can also stop
                being emitted: it leaves this set in a minor version, named in
                the changelog, and a branch you wrote for it goes unreached
                rather than wrong.
              example: BAD_REQUEST
            message:
              type: string
              description: >-
                What went wrong, in prose. These codes always carry the same
                message, and it never includes text from a supplier:
                `RATE_LIMITED` — "Too many requests. Retry after the Retry-After
                delay."; `OFFER_EXPIRED` — "This offer has expired. Search
                again."; `OFFER_UNAVAILABLE` — "This offer is no longer
                available. Search again."; `UPSTREAM_REJECTED` — "The request
                was declined for this offer. Try another offer.";
                `UPSTREAM_UNAVAILABLE` — "The service is temporarily
                unavailable. Retry after the Retry-After delay.";
                `UPSTREAM_TIMEOUT` — "The request timed out before a result was
                available. Retry the request."; `UPSTREAM_ERROR` — "The request
                could not be completed.".
            doc_url:
              type: string
            field:
              type: string
              description: >-
                On a 400 `BAD_REQUEST` that names one refused input: the path of
                that field in your request, e.g. `selections[1].quantity` for
                the second selection of a `select_ancillaries` call. Absent when
                the refusal names no single field.
              example: selections[1].quantity
          required:
            - code
            - message
      required:
        - error
    CarServicingConflictResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: CONFLICT
            message:
              type: string
            doc_url:
              type: string
          required:
            - code
            - message
        code:
          $ref: '#/components/schemas/CarServicingConflictCode'
        retry_quote_id:
          type: string
          description: >-
            A fresh `quote_id`, on `quote_drift`. Show the customer the figure
            in `current.refund`, then commit against this `quote_id` as you
            would one from car_cancel_preview.
          example: ccl_01J8AB4N7GLY3Q0DXK2M5R9VWT
        requote:
          type: string
          description: 'Deprecated: use `retry_quote_id` instead. Same value.'
          example: ccl_01J8AB4N7GLY3Q0DXK2M5R9VWT
          deprecated: true
        current:
          type: object
          properties:
            refund:
              $ref: '#/components/schemas/CarAmount'
          description: >-
            The refund as it stands now, on `quote_drift`: what the customer
            gets if they accept the fresh preview.
        active_operation:
          type: string
          description: >-
            The cancellation already running on this rental, on
            `active_operation_exists`. Follow it with car_cancel_status.
          example: ccl_01J7ZR5Q2KME8V4TBN3P8XD6WQ
        shortfall:
          allOf:
            - $ref: '#/components/schemas/CarAmount'
            - description: >-
                How much of the refund could not be reserved, on
                `funds_unavailable` — money still moving on the original
                payment, not a fact about this rental.
        blocking:
          type: array
          items:
            type: string
          description: >-
            What is holding that money, on `funds_unavailable`: the refunds
            already in flight against the same payment, which settle before this
            one can be reserved. Opaque handles — identity only.
          example:
            - re_3UBIxK2eZvKYlo2C
      required:
        - error
        - code
    BookingSelectionConflict:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - CONFLICT
            message:
              type: string
          required:
            - code
            - message
        code:
          type: string
          enum:
            - item_selection_required
        items:
          type: array
          items:
            $ref: '#/components/schemas/BookingItem'
      required:
        - error
        - code
        - items
      description: >-
        Several items match the requested domain. Choose a booked_item_id from
        items (the same safe projection as get_booking) and repeat the request
        with booking_ref and booked_item_id.
    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
    CarAmount:
      type: object
      properties:
        value:
          type: integer
          description: >-
            Integer amount in MINOR units, always paired with decimal_places —
            divide by 10 ** decimal_places to display. Example: value 15977 with
            decimal_places 2 is 159.77 USD. Rendering this field directly shows
            prices 100x too high for 2-decimal currencies.
          example: 41250
        currency:
          type: string
          description: ISO 4217 currency code.
          example: EUR
        decimal_places:
          type: integer
          description: >-
            Scale of the integer value/amount: display = integer / 10 **
            decimal_places. Always sent alongside minor-unit amounts. Usually
            the ISO 4217 digits of the currency (2 for USD/EUR/GBP, 0 for
            JPY/KRW, 3 for BHD/JOD/KWD) but currency-converted prices can carry
            a different scale — ALWAYS use the decimal_places sent with the
            amount, never a hardcoded 2. Only if the field is genuinely absent
            on a value-shaped object, fall back to the ISO digits for the
            currency.
          example: 2
        display:
          type: string
          description: >-
            The same figure as a string ready to show: the ISO 4217 code, a
            space, then the amount, e.g. "USD 159.77". With decimal_places it is
            written at exactly that scale (value 1561500, JPY, decimal_places 2
            is "JPY 15615.00"); without, at the ISO digits of the currency. Show
            this; compute with the number. Absent when the figure is not money
            (a cancellation step expressed as a percent or a number of nights)
            or could not be read unambiguously.
          example: EUR 412.50
    CarServicingConflictCode:
      type: string
      enum:
        - quote_drift
        - QUOTE_EXPIRED
        - active_operation_exists
        - not_cancellable
        - funds_unavailable
        - manual_required
      description: >-
        Which refusal this is. `manual_required` — the preview said
        `manual_required: true` (fee unknown, rental changed after payment, fee
        in another currency or above the rental) and the commit did not carry
        `manual_ok: true`; resend the same commit with it, once the customer
        agrees, to hand the cancellation to a Jinko agent. `quote_drift` — the
        refund moved since the preview (the fee tier changed as pick-up drew
        nearer); `retry_quote_id` is a fresh preview reference and
        `current.refund` the figure now — show it to the customer and commit
        against `retry_quote_id`. `QUOTE_EXPIRED` — the preview stopped binding
        (`expires_at`); preview again. `active_operation_exists` — an exchange
        or another cancellation is in flight for this rental; wait for it to
        finish (car_cancel_status) rather than starting a second.
        `not_cancellable` — the rental can no longer be cancelled as it stands
        (already cancelled since the preview, or over); `error.message` carries
        the reason, and car_cancel_status reports the cancellation that stands.
        `funds_unavailable` — the original payment cannot cover the refund yet;
        `shortfall` is how much is missing and `blocking` names the refunds that
        have to settle first. In every case NOTHING was cancelled and no money
        moved.
    BookingItem:
      type: object
      properties:
        booked_item_id:
          type: string
          description: The item to name with `booked_item_id` on the next request.
          example: itm_aaaaaaaaaaaaafhuxsdxpbzrbfz5hm3a
        item_id:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          maximum: 9007199254740991
          description: >-
            Deprecated: use `booked_item_id` instead. The booked item as an
            integer.
          example: 42
          deprecated: true
        domain:
          type: string
        summary:
          type: string
        status:
          type: string
          description: >-
            This item's state in Jinko's own booking and servicing flow. In
            progress: `pending`, `awaiting_payment`, `preparing`, `prepared`,
            `processing`, `confirming`. Final: `completed` (booked; for a
            flight, ticketed), `failed`, `cancelled` (nothing is booked any
            more: the checkout was never paid, or a cancellation succeeded),
            `expired_quote` (a quoted price, at checkout or for an exchange,
            expired before it was confirmed). Needing attention:
            `exchange_partial_failure`, `needs_review`. Treat the list as open:
            new values may be added. It changes only through Jinko's steps
            (payment, booking, ticketing, or a cancellation or exchange you
            request), never because an airline changed or cancelled a flight.
          example: completed
        booking_ref:
          type: string
          description: >-
            The Jinko booking reference of the booking this item belongs to,
            also after an exchange.
          example: JNK-A0AUR2
        booking_reference:
          type: string
          description: >-
            Deprecated: use `booking_ref` instead. The Jinko reference of the
            cart this item lives on: after an exchange, the exchange’s own
            reference.
          deprecated: true
        servicing:
          $ref: '#/components/schemas/BookingItemServicing'
      required:
        - item_id
        - domain
    BookingItemServicing:
      type: object
      properties:
        can_refund:
          type: boolean
        can_void:
          type: boolean
        can_exchange:
          type: boolean
        refund_support_level:
          type: string
          enum:
            - AUTO
            - MANUAL_REQUIRED
            - UNSUPPORTED
        exchange_support_level:
          type: string
          enum:
            - AUTO
            - MANUAL_REQUIRED
            - UNSUPPORTED
        refund_unavailable_reason:
          type: string
        exchange_unavailable_reason:
          type: string
        refund_reason_code:
          type: string
        exchange_reason_code:
          type: string
        reason_code:
          type: string
        support_level:
          type: string
          enum:
            - AUTO
            - MANUAL_REQUIRED
            - UNSUPPORTED
      required:
        - can_refund
        - can_void
        - can_exchange
      description: >-
        Eligibility of this booked item and its current product. Read the live
        refund or exchange check before committing; eligibility can change with
        time.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
    BearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.