> ## 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.

# agent-payment submit

> Submit SPT payments; card submissions must use the payment hostname and are refused here

Typed submissions require a jnk\_ API key via X-API-Key (ApiKeyAuth) or Authorization: Bearer (BearerAuth), a tenant-bound booking scope, quote\_id and Idempotency-Key, and return a PaymentAttemptOutcome (200 known outcome / 202 pending). OAuth/JWT bearer tokens are supported only for the legacy flat token body, which keeps its existing authorization response. Request bodies are limited to 16 KiB. Card submissions must be sent to the payment hostname (`POST https://pay.<env-domain>/v1/agent_payment/submit`); see the partner card payments guide. This route refuses card submissions with 400 CREDENTIAL\_FORMAT\_INVALID.


## OpenAPI

````yaml api-reference/public-api.yaml POST /v1/agent_payment/submit
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/agent_payment/submit:
    post:
      tags:
        - Pricing & booking
      summary: >-
        Submit SPT payments; card submissions must use the payment hostname and
        are refused here
      description: >-
        Typed submissions require a jnk_ API key via X-API-Key (ApiKeyAuth) or
        Authorization: Bearer (BearerAuth), a tenant-bound booking scope,
        quote_id and Idempotency-Key, and return a PaymentAttemptOutcome (200
        known outcome / 202 pending). OAuth/JWT bearer tokens are supported only
        for the legacy flat token body, which keeps its existing authorization
        response. Request bodies are limited to 16 KiB. Card submissions must be
        sent to the payment hostname (`POST
        https://pay.<env-domain>/v1/agent_payment/submit`); see the partner card
        payments guide. This route refuses card submissions with 400
        CREDENTIAL_FORMAT_INVALID.
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 255
            pattern: ^[ -~]+$(?![\s\S])
            description: >-
              Required on a typed submission (a body with `payment`); without it
              the request is refused with 400 `CREDENTIAL_FORMAT_INVALID`.
              Ignored on the legacy body. 1–255 printable ASCII characters.
              Reuse only for the same payment submission: the same key with the
              same body replays the first outcome, with a different body it is
              refused.
          required: false
          name: Idempotency-Key
          in: header
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/TypedAgentPaymentSubmitRequest'
                - $ref: '#/components/schemas/AgentPaymentSubmitRequest'
      responses:
        '200':
          description: Legacy authorization result or typed payment outcome
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/PaymentAttemptOutcome'
                  - $ref: '#/components/schemas/AgentPaymentSubmitResponse'
        '202':
          description: Payment accepted and pending; poll the attempt after Retry-After.
          headers:
            Retry-After:
              schema:
                type: string
              description: Polling delay supplied by the service.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentAttemptOutcome'
        '400':
          description: >-
            Payment credential format or validity refusal.
            **`CREDENTIAL_FORMAT_INVALID`** — The typed payment body or
            Idempotency-Key has an invalid format. Correct the named field and
            resubmit with a valid Idempotency-Key.
            **`PAYMENT_CREDENTIAL_INVALID`** — The payment credential is
            invalid. Follow recovery.action and supply a replacement credential
            when required. **`BAD_REQUEST`** — The request was malformed or
            failed validation. Fix the request as the message describes;
            retrying it unchanged cannot succeed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentRefusalResponse'
        '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
        '403':
          description: >-
            This payment type is not enabled or access is forbidden.
            **`PAYMENT_TYPE_NOT_ENABLED`** — This payment type is not enabled
            for the caller. Choose a type advertised in accepted_payment_types
            or contact support. **`FORBIDDEN`** — The credential is valid, and
            this request is refused anyway. Do not rotate the key — it is
            working. Check that it is entitled to this operation, and on this
            environment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentRefusalResponse'
        '404':
          description: >-
            The trip, or the `quote_id` among its quotes, was not found. Nothing
            was charged. **`NOT_FOUND`** — No resource with that identifier is
            visible to this key. Check the identifier. A trip or booking belongs
            to the key that created it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: >-
            Payment submission conflicts with an existing attempt.
            **`TRIP_OWNED_BY_OTHER_PAYMENT`** — Another payment attempt owns
            this trip. Read the existing attempt and follow its recovery action
            before paying again. **`IDEMPOTENCY_KEY_REUSED`** — The idempotency
            key was already used for a different submission. Reuse the original
            request with this key, or use a new key for a new submission.
            **`ATTEMPT_IN_PROGRESS`** — A payment attempt is already in
            progress. Poll the existing attempt and follow recovery.action.
            **`ATTEMPT_TERMINAL`** — This payment attempt has reached a terminal
            state. Read its outcome and follow recovery.action before starting
            another attempt.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentRefusalResponse'
        '410':
          description: >-
            The locked quote has expired, so nothing was redeemed and no payment
            object was created — or the resource the request names is gone. Tell
            the two apart by `error.code`. **`QUOTE_EXPIRED`** — The quote can
            no longer be paid, so payment was refused before any payment object
            was created: it passed its `expires_at`, the trip's travelers
            changed after it was priced (`reason: travelers_changed`;
            `expires_at` is then the refusal instant), it could not price every
            item of the trip (`reason: partial_quote`), or an item was added to
            the trip or removed from it after it was priced (`reason:
            items_changed`; `expires_at` is then the refusal instant). A typed
            payment refused this way also carries `payment_error` and
            `recovery`. Call `POST /v1/checkout` again on the same trip — it
            re-quotes — then mint a new Shared Payment Token against the new
            `agent_spt_params` and submit that against the new `quote_id`. With
            `reason: partial_quote`, first replace or remove the items whose
            `quote_status` is `failed`. With `reason: items_changed`, the new
            quote prices the items the trip holds now: get the traveler to
            approve the new total before paying. Nothing was charged. **`GONE`**
            — The resource this request names existed and no longer does.
            Re-acquire it — search again, or check out again to re-quote — then
            retry with the new identifier. Repeating this request with the same
            one cannot succeed.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/QuoteExpiredResponse'
                  - $ref: '#/components/schemas/ErrorResponse'
                  - $ref: '#/components/schemas/PaymentRefusalResponse'
              example:
                error:
                  code: QUOTE_EXPIRED
                  message: >-
                    The quote behind this checkout expired at
                    2026-09-04T12:39:56Z.
                  doc_url: https://docs.gojinko.com/concepts/errors
                expires_at: '2026-09-04T12:39:56Z'
                quote_id: '2097152'
                reason: travelers_changed
        '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: >-
            Payment temporarily unavailable. **`TEMPORARILY_UNAVAILABLE`** —
            Payment submission is temporarily unavailable. Wait for Retry-After
            when provided and follow recovery.action.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentRefusalResponse'
        '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:
    TypedAgentPaymentSubmitRequest:
      type: object
      properties:
        trip_id:
          type: string
        quote_id:
          type: string
          pattern: ^[1-9][0-9]{0,17}$(?![\s\S])
          description: >-
            The quote the traveler approved: the `quote_id` checkout returned.
            The payment is taken against this quote only; a quote that is no
            longer payable is refused with 410 `QUOTE_EXPIRED` and nothing is
            charged.
          example: '2097152'
        payment:
          oneOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - spt
                shared_payment_token:
                  type: string
                  minLength: 1
              required:
                - type
                - shared_payment_token
              additionalProperties: false
        intent:
          $ref: '#/components/schemas/IntentInput'
      required:
        - trip_id
        - quote_id
        - payment
      additionalProperties: false
    AgentPaymentSubmitRequest:
      type: object
      properties:
        trip_id:
          type: string
          example: trip_1048576
        shared_payment_token:
          type: string
          example: spt_1Nq8L2eZvKYlo2C0
      required:
        - trip_id
        - shared_payment_token
    PaymentAttemptOutcome:
      type: object
      properties:
        payment_attempt_id:
          type: string
        trip_id:
          type: string
          description: >-
            The trip this attempt pays, written with a `trip_` prefix
            (`trip_1048576`); the trip answers carry the same id without it
            (`1048576`). Strip the prefix to compare the two.
          example: trip_1048576
        quote_id:
          type: string
          description: The quote this payment is taken against.
          example: '2097152'
        quoted_cart_id:
          type: integer
          description: 'Deprecated: use `quote_id` instead. The same quote as an integer.'
          deprecated: true
        fulfillment_cart_id:
          type: integer
          description: >-
            Deprecated: use `booking_ref` instead. An internal number for the
            booking this payment funds.
          deprecated: true
        payment_status:
          type: string
          enum:
            - pending
            - requires_authentication
            - authorized
            - captured
            - declined
            - cancelling
            - cancelled
            - expired
            - failed
        booking_status:
          type: string
          description: >-
            The detailed status of the booking this payment started,
            `not_scheduled` until booking begins. `booking_state` on GET
            /v1/trip/{trip_id} is its summary.
        failure_reason:
          type: string
          nullable: true
          description: >-
            Why the booking failed, when it failed after payment and the cause
            is known: `offer_unavailable`, `price_changed`,
            `booking_not_created` (the supplier holds no booking; nothing was
            booked and no money was taken), `booking_cancelled_at_provider`,
            `ticketing_refused`. Null otherwise. For `offer_unavailable`, the
            supplier no longer sells the priced offer. Nothing was booked and
            the card authorisation was released. Search again and book a new
            offer. The `booking.failed` webhook carries the same reason with a
            sentence to show the traveller (`failure_message`).
          example: booking_not_created
        items:
          type: array
          items:
            type: object
            properties:
              booked_item_id:
                type: string
                description: >-
                  The booked item, as get_booking and the servicing routes name
                  it. Absent only when the item cannot be named yet.
                example: itm_aaaaaaaaaaaaafhuxsdxpbzrbfz5hm3a
              item_id:
                type: integer
                description: >-
                  Deprecated: use `booked_item_id` instead. The booked item as
                  an integer.
                deprecated: true
              outcome:
                type: string
              failure_reason:
                type: string
                nullable: true
                description: >-
                  Why the booking failed, when it failed after payment and the
                  cause is known: `offer_unavailable`, `price_changed`,
                  `booking_not_created` (the supplier holds no booking; nothing
                  was booked and no money was taken),
                  `booking_cancelled_at_provider`, `ticketing_refused`. Null
                  otherwise. For `offer_unavailable`, the supplier no longer
                  sells the priced offer. Nothing was booked and the card
                  authorisation was released. Search again and book a new offer.
                  The `booking.failed` webhook carries the same reason with a
                  sentence to show the traveller (`failure_message`).
                example: booking_not_created
            required:
              - item_id
              - outcome
        booking_ref:
          type: string
          description: The booking reference. Absent until the booking has one; never null.
        payment_error:
          type: object
          nullable: true
          properties:
            code:
              type: string
              enum:
                - CREDENTIAL_FORMAT_INVALID
                - PAYMENT_TYPE_NOT_ENABLED
                - PAYMENT_CREDENTIAL_INVALID
                - TRIP_OWNED_BY_OTHER_PAYMENT
                - IDEMPOTENCY_KEY_REUSED
                - ATTEMPT_IN_PROGRESS
                - CARD_DECLINED
                - CARD_ALIAS_EXPIRED
                - PAYMENT_CREDENTIAL_REJECTED
                - AUTHENTICATION_REQUIRED
                - AUTHENTICATION_FAILED
                - AUTHENTICATION_ABANDONED
                - QUOTE_EXPIRED
                - ATTEMPT_TERMINAL
                - PAYMENT_OUTCOME_UNKNOWN
                - FULFILLMENT_DISPATCH_DELAYED
                - RECONCILIATION_REQUIRED
                - TEMPORARILY_UNAVAILABLE
            message:
              type: string
          required:
            - code
            - message
          description: >-
            Why the payment has not gone through, or null. On the `checkout_url`
            payment page, a card the issuer declines (`card_declined`) or whose
            authentication fails (`authentication_failed`) is reported here
            while `payment_status` stays `pending` and `recovery.action` is
            `poll`: the payer can use another card on the same page until this
            payment's `quote_expires_at`. It returns to null when a card is
            authorized. `CARD_ALIAS_EXPIRED`: The submitted card details can no
            longer be used for this payment. Follow `recovery.action`; when it
            is `retry_new_key`: Submit the card again on the pay hostname with a
            new Idempotency-Key.
        recovery:
          type: object
          properties:
            action:
              type: string
              enum:
                - poll
                - authenticate
                - retry_same_key
                - retry_new_key
                - recheckout
                - contact_support
                - stop
              description: >-
                The next step. `authenticate`: when `authentication` is present,
                open `authentication.url` before `authentication.expires_at`.
                For a Shared Payment Token (`spt`), first read the token's
                `next_action.use_stripe_sdk.value` with your own Stripe secret
                key and append it unchanged: open `authentication.url + "#hv=" +
                <value>`, or call `stripe.handleNextAction({ hashedValue })`
                with Stripe.js on your own page. Then poll `GET
                /v1/trip/{trip_id}/payment_attempts/{payment_attempt_id}` until
                `payment_status` is none of `requires_authentication`,
                `cancelling` or `pending`.
            replacement_credential_required:
              type: boolean
          required:
            - action
            - replacement_credential_required
        recovery_status:
          type: string
          enum:
            - automatic
            - manual_review
        quote_expires_at:
          type: string
          format: date-time
          description: >-
            Deadline for completing this payment (RFC 3339). It is the quote
            deadline the checkout response and the trip's `quote` call
            `expires_at`, unless they say `payment_stays_open`: then this
            payment has its own, later deadline.
        retry_after_seconds:
          type: integer
          description: >-
            Seconds to wait before reading the payment attempt again. Present
            only while `recovery.action` is `poll`; absent otherwise, never
            null.
        authentication:
          type: object
          properties:
            url:
              type: string
            expires_at:
              type: string
              format: date-time
          required:
            - url
            - expires_at
          description: >-
            Where the customer authenticates when `recovery.action` is
            `authenticate`: open `url` before `expires_at`. For a Shared Payment
            Token (`spt`), `url` is a Jinko-hosted page that needs the token's
            hashed value: read the issued token's
            `next_action.use_stripe_sdk.value` with your own Stripe secret key
            and open `url + "#hv=" + <value>`, passing the value unchanged. The
            value travels in the URL fragment, which keeps it out of server
            logs.
        money:
          type: object
          properties:
            authorized:
              $ref: '#/components/schemas/Money'
            captured:
              $ref: '#/components/schemas/Money'
            released:
              $ref: '#/components/schemas/Money'
            refunded:
              $ref: '#/components/schemas/Money'
            externally_reimbursed:
              $ref: '#/components/schemas/Money'
            resolution_status:
              type: string
              enum:
                - pending
                - resolved
                - manual_review
                - external_reimbursement_pending
                - externally_reimbursed
            refund_reference:
              type: string
      required:
        - payment_attempt_id
        - trip_id
        - quote_id
        - quoted_cart_id
        - payment_status
        - booking_status
        - payment_error
        - recovery
        - recovery_status
    AgentPaymentSubmitResponse:
      type: object
      properties:
        quote_id:
          type: string
          description: >-
            The quote this payment was taken against. This submission names no
            quote, so it pays the trip’s latest payable quote; compare this with
            the `quote_id` the traveler approved.
          example: '2097152'
        fulfillment_cart_id:
          type: integer
          description: >-
            Deprecated: use `booking_ref` instead. An internal number for the
            booking.
          deprecated: true
        status:
          type: string
          example: processing
        payment_verified:
          type: boolean
        message:
          type: string
        booking_ref:
          type: string
          description: >-
            The Jinko booking reference for the trip just paid — hand it to
            `POST /v1/get_booking` (`booking_ref`) to retrieve or service the
            booking. Present when the token was authorized (and when the trip
            was already past payment); absent when the payment could not be
            authorized and `checkout_url` is returned instead. When
            `payment_status` is `requires_authentication` it can be present
            before payment completes: read `payment_status`, not this field, to
            tell whether the payment went through.
          example: JNK-XEVGW5
        checkout_url:
          type: string
          description: >-
            Hosted-checkout fallback, present when the payment could not be
            authorized (for example a card decline). Not returned when
            `payment_status` is `requires_authentication`.
        recap_token:
          type: string
        payment_status:
          type: string
          enum:
            - pending
            - requires_authentication
            - authorized
            - captured
            - declined
            - cancelling
            - cancelled
            - expired
            - failed
          description: >-
            Status of the payment attempt behind this submission, the same
            values as `payment_attempt.payment_status`.
            `requires_authentication`: the card issuer asked for 3-D Secure;
            `payment_verified` is false and no `checkout_url` is returned. Send
            the traveler to `authentication.url`, with the Shared Payment
            Token's hashed value appended as that field describes, to complete
            it before `quote_expires_at`, then poll `GET /v1/trip/{trip_id}`
            until `payment_attempt.payment_status` is none of
            `requires_authentication`, `cancelling` or `pending` (`cancelling`
            is a transient cleanup state and `pending` is still in progress —
            keep polling). `authorized` / `captured`: the payment went through.
            `failed` / `declined` / `cancelled`: it did not — submit again with
            a new token before `quote_expires_at`. `expired`: it did not, and
            the quote expired with it — call `POST /v1/checkout` again to price
            a new quote, then mint and submit a new token.
          example: requires_authentication
        quote_expires_at:
          type: string
          format: date-time
          description: >-
            Deadline for completing this payment, including 3-D Secure
            authentication (RFC 3339). With `payment_stays_open`, this is one
            hour from when the payment started, or the quote deadline if that is
            later. Otherwise it is the quote deadline the checkout response and
            the trip's `quote` call `expires_at`. After it, call `POST
            /v1/checkout` again for a new quote, then submit a new token.
          example: '2026-06-01T12:39:56Z'
        authentication:
          type: object
          properties:
            url:
              type: string
              format: uri
            expires_at:
              type: string
              format: date-time
          required:
            - url
            - expires_at
          description: >-
            Jinko-hosted page where the traveler completes 3-D Secure, present
            when `payment_status` is `requires_authentication`: the same object
            a card submit and `payment_attempt` carry. Open `url` before
            `expires_at`, which is `quote_expires_at`. Read the Shared Payment
            Token you issued from the Stripe API (`GET
            https://api.stripe.com/v1/shared_payment/issued_tokens/{id}` with
            your own Stripe secret key, `{id}` being the token you submitted)
            and append `#hv=` and its `next_action.use_stripe_sdk.value`,
            unchanged: `authentication.url + "#hv=" +
            next_action.use_stripe_sdk.value`. The value travels in the URL
            fragment, which keeps it out of server logs. The traveler completes
            the bank challenge on that page before `quote_expires_at`. To run
            the challenge on your own page instead, load Stripe.js with your own
            publishable key and call `stripe.handleNextAction({ hashedValue })`
            with that value. Then poll `GET /v1/trip/{trip_id}` until
            `payment_attempt.payment_status` is none of
            `requires_authentication`, `cancelling` or `pending`.
        authentication_url:
          type: string
          format: uri
          description: 'Deprecated: use `authentication.url` instead. The same value.'
          deprecated: true
    PaymentRefusalResponse:
      allOf:
        - $ref: '#/components/schemas/ErrorResponse'
        - type: object
          properties:
            payment_error:
              type: object
              nullable: true
              properties:
                code:
                  type: string
                  enum:
                    - CREDENTIAL_FORMAT_INVALID
                    - PAYMENT_TYPE_NOT_ENABLED
                    - PAYMENT_CREDENTIAL_INVALID
                    - TRIP_OWNED_BY_OTHER_PAYMENT
                    - IDEMPOTENCY_KEY_REUSED
                    - ATTEMPT_IN_PROGRESS
                    - CARD_DECLINED
                    - CARD_ALIAS_EXPIRED
                    - PAYMENT_CREDENTIAL_REJECTED
                    - AUTHENTICATION_REQUIRED
                    - AUTHENTICATION_FAILED
                    - AUTHENTICATION_ABANDONED
                    - QUOTE_EXPIRED
                    - ATTEMPT_TERMINAL
                    - PAYMENT_OUTCOME_UNKNOWN
                    - FULFILLMENT_DISPATCH_DELAYED
                    - RECONCILIATION_REQUIRED
                    - TEMPORARILY_UNAVAILABLE
                message:
                  type: string
              required:
                - code
                - message
            recovery:
              type: object
              properties:
                action:
                  type: string
                  enum:
                    - poll
                    - authenticate
                    - retry_same_key
                    - retry_new_key
                    - recheckout
                    - contact_support
                    - stop
                  description: >-
                    The next step. `authenticate`: when `authentication` is
                    present, open `authentication.url` before
                    `authentication.expires_at`. For a Shared Payment Token
                    (`spt`), first read the token's
                    `next_action.use_stripe_sdk.value` with your own Stripe
                    secret key and append it unchanged: open `authentication.url
                    + "#hv=" + <value>`, or call `stripe.handleNextAction({
                    hashedValue })` with Stripe.js on your own page. Then poll
                    `GET
                    /v1/trip/{trip_id}/payment_attempts/{payment_attempt_id}`
                    until `payment_status` is none of `requires_authentication`,
                    `cancelling` or `pending`.
                replacement_credential_required:
                  type: boolean
              required:
                - action
                - replacement_credential_required
            expires_at:
              type: string
              description: >-
                The instant the refused quote expired (RFC 3339). For a deadline
                lapse this is the past deadline; when `reason` is
                `travelers_changed` or `items_changed` it is the instant of the
                refusal.
              example: '2026-09-04T12:39:56Z'
            quote_id:
              type: string
              description: >-
                The quote that was refused — the same `quote_id` the trip and
                checkout responses carry, so a caller holding several can tell
                which one this refusal is about.
              example: '2097152'
            quoted_cart_id:
              type: number
              description: >-
                Deprecated: use `quote_id` instead. The same quote as an
                integer.
              example: 2097152
              deprecated: true
            reason:
              type: string
              enum:
                - travelers_changed
                - partial_quote
                - items_changed
              description: >-
                Why the quote cannot be paid when it is not a plain deadline
                lapse. `travelers_changed`: the trip's travelers changed after
                it was priced; call `POST /v1/checkout` again to re-quote, then
                pay against the new quote. `partial_quote`: the quote could not
                price every item of the trip (the checkout answered `status:
                partial`); replace or remove the items with `quote_status:
                failed`, then call `POST /v1/checkout` again and pay against the
                new quote. `items_changed`: an item was added to the trip or
                removed from it after the quote was priced, so the quote no
                longer prices the items the trip holds; nothing was charged.
                Call `POST /v1/checkout` again to price the current items, get
                the traveler to approve the new total, then pay against the new
                quote. Absent for a plain deadline lapse, whose recovery is to
                call checkout again.
              example: travelers_changed
    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
    QuoteExpiredResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - QUOTE_EXPIRED
            message:
              type: string
            doc_url:
              type: string
          required:
            - code
            - message
        expires_at:
          type: string
          description: >-
            The instant the refused quote expired (RFC 3339). For a deadline
            lapse this is the past deadline; when `reason` is
            `travelers_changed` or `items_changed` it is the instant of the
            refusal.
          example: '2026-09-04T12:39:56Z'
        quote_id:
          type: string
          description: >-
            The quote that was refused — the same `quote_id` the trip and
            checkout responses carry, so a caller holding several can tell which
            one this refusal is about.
          example: '2097152'
        quoted_cart_id:
          type: number
          description: 'Deprecated: use `quote_id` instead. The same quote as an integer.'
          example: 2097152
          deprecated: true
        reason:
          type: string
          enum:
            - travelers_changed
            - partial_quote
            - items_changed
          description: >-
            Why the quote cannot be paid when it is not a plain deadline lapse.
            `travelers_changed`: the trip's travelers changed after it was
            priced; call `POST /v1/checkout` again to re-quote, then pay against
            the new quote. `partial_quote`: the quote could not price every item
            of the trip (the checkout answered `status: partial`); replace or
            remove the items with `quote_status: failed`, then call `POST
            /v1/checkout` again and pay against the new quote. `items_changed`:
            an item was added to the trip or removed from it after the quote was
            priced, so the quote no longer prices the items the trip holds;
            nothing was charged. Call `POST /v1/checkout` again to price the
            current items, get the traveler to approve the new total, then pay
            against the new quote. Absent for a plain deadline lapse, whose
            recovery is to call checkout again.
          example: travelers_changed
      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
    Money:
      type: object
      properties:
        amount:
          type: number
          description: >-
            Deprecated: use `value` instead (the same integer) where this object
            carries decimal_places. Where it does not, the figure is in MAJOR
            units and the field holding this object is itself deprecated: read
            its `*_money` sibling. The two-scale rule applies only to deprecated
            fields. Alternative to `value` on some endpoints (the two never
            appear together); its scale depends on decimal_places. When this
            object carries decimal_places, amount is an INTEGER in minor units —
            divide by 10 ** decimal_places (e.g. select_ancillaries
            total_with_ancillaries). When there is no decimal_places field,
            amount is a decimal in MAJOR units, safe to display as-is (e.g. trip
            and checkout totals).
          deprecated: true
        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: USD
        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: USD 412.50
      description: >-
        A money figure in one of two scales. New integrations read the `*_money`
        field beside it (a `MoneyValue`) where there is one, and `value` on
        objects that carry it; the rule below applies only to the deprecated
        forms. When `decimal_places` is present, `value` (or the deprecated
        `amount`) is an INTEGER in minor units: divide by 10 ** decimal_places.
        When it is absent, the deprecated `amount` is already in MAJOR units.
        Branch on whether decimal_places is present in the response you
        received, never on the currency code or the field name. `display` is the
        same figure as a string to show.
  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.