> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dodopayments.com/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.105.0
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: Entitlements
  - name: Licenses
  - name: Discounts
  - name: Meters
  - name: Credit Entitlements
  - name: Credit Entitlement Balances
  - 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: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
            });


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


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

            client = DodoPayments(
                bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"),  # This is the default and can be omitted
            )
            checkout_session_status = client.checkout_sessions.retrieve(
                "id",
            )
            print(checkout_session_status.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/dodopayments/dodopayments-go\"\n\t\"github.com/dodopayments/dodopayments-go/option\"\n)\n\nfunc main() {\n\tclient := dodopayments.NewClient(\n\t\toption.WithBearerToken(\"My Bearer Token\"),\n\t)\n\tcheckoutSessionStatus, err := client.CheckoutSessions.Get(context.TODO(), \"id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", checkoutSessionStatus.ID)\n}\n"
        - 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)
        - lang: PHP
          source: |-
            <?php

            require_once dirname(__DIR__) . '/vendor/autoload.php';

            use Dodopayments\Client;
            use Dodopayments\Core\Exceptions\APIException;

            $client = new Client(
              bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',
              environment: 'test_mode',
            );

            try {
              $checkoutSessionStatus = $client->checkoutSessions->retrieve('id');

              var_dump($checkoutSessionStatus);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: C#
          source: >-
            using System;

            using DodoPayments.Client;

            using DodoPayments.Client.Models.CheckoutSessions;


            DodoPaymentsClient client = new();


            CheckoutSessionRetrieveParams parameters = new() { ID = "id" };


            var checkoutSessionStatus = await
            client.CheckoutSessions.Retrieve(parameters);


            Console.WriteLine(checkoutSessionStatus);
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

````