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

# trip payment-attempts

> Read a payment attempt outcome

Read a payment attempt outcome


## OpenAPI

````yaml api-reference/public-api.yaml GET /v1/trip/{trip_id}/payment_attempts/{payment_attempt_id}
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/trip/{trip_id}/payment_attempts/{payment_attempt_id}:
    get:
      tags:
        - Pricing & booking
      summary: Read a payment attempt outcome
      parameters:
        - schema:
            type: string
          required: true
          name: trip_id
          in: path
        - schema:
            type: string
          required: true
          name: payment_attempt_id
          in: path
      responses:
        '200':
          description: Payment attempt outcome
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentAttemptOutcome'
        '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
        '403':
          description: >-
            Payment attempt access forbidden. **`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/ErrorResponse'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: NOT_FOUND
                  message: Resource not found.
                  doc_url: https://docs.gojinko.com/concepts/errors
        '409':
          description: The operation conflicts with the current state of the resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: CONFLICT
                  message: >-
                    The operation conflicts with the current state of the
                    resource.
                  doc_url: https://docs.gojinko.com/concepts/errors
        '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:
    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
    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
    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.