> ## Documentation Index
> Fetch the complete documentation index at: https://dodopayments-mintlify-external-integration-datafast-autosen.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Checkout Session

> Retrieve details of a specific checkout session by its ID.



## OpenAPI

````yaml get /checkouts/{id}
openapi: 3.1.0
info:
  title: public
  description: ''
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 1.61.5
servers:
  - url: https://test.dodopayments.com/
    description: Test Mode Server Host
  - url: https://live.dodopayments.com/
    description: Live Mode Server Host
security: []
tags:
  - name: Products
  - name: Payments
  - name: Subscriptions
  - name: Addons
  - name: Customers
  - name: Refunds
  - name: Disputes
  - name: Events
  - name: License Keys
  - name: Licenses
  - name: Discounts
  - name: Meters
  - name: Outgoing Webhooks
  - name: Checkout
  - name: Webhook Events
paths:
  /checkouts/{id}:
    get:
      tags:
        - Checkout Sessions
      operationId: get_checkout_sessions_status
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Checkout session successfully fetched
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetCheckoutSessionsStatus'
        '404':
          description: Not found
        '422':
          description: Invalid Request Object or Parameters
        '500':
          description: Something went wrong :(
      security:
        - API_KEY: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import DodoPayments from 'dodopayments';


            const client = new DodoPayments({
              bearerToken: 'My Bearer Token',
            });


            const checkoutSessionStatus = await
            client.checkoutSessions.retrieve('id');


            console.log(checkoutSessionStatus.id);
        - lang: Python
          source: |-
            from dodopayments import DodoPayments

            client = DodoPayments(
                bearer_token="My Bearer Token",
            )
            checkout_session_status = client.checkout_sessions.retrieve(
                "id",
            )
            print(checkout_session_status.id)
        - lang: Go
          source: |
            package main

            import (
              "context"
              "fmt"

              "github.com/dodopayments/dodopayments-go"
              "github.com/dodopayments/dodopayments-go/option"
            )

            func main() {
              client := dodopayments.NewClient(
                option.WithBearerToken("My Bearer Token"),
              )
              checkoutSessionStatus, err := client.CheckoutSessions.Get(context.TODO(), "id")
              if err != nil {
                panic(err.Error())
              }
              fmt.Printf("%+v\n", checkoutSessionStatus.ID)
            }
        - lang: Java
          source: >-
            package com.dodopayments.api.example;


            import com.dodopayments.api.client.DodoPaymentsClient;

            import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;

            import
            com.dodopayments.api.models.checkoutsessions.CheckoutSessionRetrieveParams;

            import
            com.dodopayments.api.models.checkoutsessions.CheckoutSessionStatus;


            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();

                    CheckoutSessionStatus checkoutSessionStatus = client.checkoutSessions().retrieve("id");
                }
            }
        - lang: Kotlin
          source: >-
            package com.dodopayments.api.example


            import com.dodopayments.api.client.DodoPaymentsClient

            import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient

            import
            com.dodopayments.api.models.checkoutsessions.CheckoutSessionRetrieveParams

            import
            com.dodopayments.api.models.checkoutsessions.CheckoutSessionStatus


            fun main() {
                val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()

                val checkoutSessionStatus: CheckoutSessionStatus = client.checkoutSessions().retrieve("id")
            }
        - lang: Ruby
          source: >-
            require "dodopayments"


            dodo_payments = Dodopayments::Client.new(
              bearer_token: "My Bearer Token",
              environment: "test_mode" # defaults to "live_mode"
            )


            checkout_session_status =
            dodo_payments.checkout_sessions.retrieve("id")


            puts(checkout_session_status)
components:
  schemas:
    GetCheckoutSessionsStatus:
      type: object
      required:
        - id
        - created_at
      properties:
        created_at:
          type: string
          format: date-time
          description: Created at timestamp
        customer_email:
          type:
            - string
            - 'null'
          description: 'Customer email: prefers payment''s customer, falls back to session'
        customer_name:
          type:
            - string
            - 'null'
          description: 'Customer name: prefers payment''s customer, falls back to session'
        id:
          type: string
          description: Id of the checkout session
        payment_id:
          type:
            - string
            - 'null'
          description: |-
            Id of the payment created by the checkout sessions.

            Null if checkout sessions is still at the details collection stage.
        payment_status:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/IntentStatus'
              description: >-
                status of the payment.


                Null if checkout sessions is still at the details collection
                stage.
    IntentStatus:
      type: string
      enum:
        - succeeded
        - failed
        - cancelled
        - processing
        - requires_customer_action
        - requires_merchant_action
        - requires_payment_method
        - requires_confirmation
        - requires_capture
        - partially_captured
        - partially_captured_and_capturable
  securitySchemes:
    API_KEY:
      type: http
      scheme: bearer

````