Zum Hauptinhalt springen
GET
/
checkouts
/
{id}
JavaScript
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('cks_n010SZaY4NXc7F1ck3Tq1');

console.log(checkoutSessionStatus.id);
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(
"cks_n010SZaY4NXc7F1ck3Tq1",
)
print(checkout_session_status.id)
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(), "cks_n010SZaY4NXc7F1ck3Tq1")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", checkoutSessionStatus.ID)
}
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("cks_n010SZaY4NXc7F1ck3Tq1");
}
}
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("cks_n010SZaY4NXc7F1ck3Tq1")
}
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("cks_n010SZaY4NXc7F1ck3Tq1")

puts(checkout_session_status)
<?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(
'cks_n010SZaY4NXc7F1ck3Tq1'
);

var_dump($checkoutSessionStatus);
} catch (APIException $e) {
echo $e->getMessage();
}
using System;
using DodoPayments.Client;
using DodoPayments.Client.Models.CheckoutSessions;

DodoPaymentsClient client = new();

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

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

Console.WriteLine(checkoutSessionStatus);
use dodopayments::Client;

#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let id = "id";
let result = client
.checkout_sessions()
.retrieve()
.id(id)
.await?;
println!("{result:?}");
Ok(())
}
curl --request GET \
--url https://test.dodopayments.com/checkouts/{id} \
--header 'Authorization: Bearer <token>'
{
  "created_at": "2023-11-07T05:31:56Z",
  "id": "<string>",
  "customer_email": "<string>",
  "customer_name": "<string>",
  "payment_id": "<string>"
}

Autorisierungen

Authorization
string
header
erforderlich

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Pfadparameter

id
string
erforderlich

Checkout Session ID

Antwort

Checkout session successfully fetched

created_at
string<date-time>
erforderlich

Created at timestamp

id
string
erforderlich

Id of the checkout session

customer_email
string | null

Customer email: prefers payment's customer, falls back to session

customer_name
string | null

Customer name: prefers payment's customer, falls back to session

payment_id
string | null

Id of the payment created by the checkout sessions.

Null if checkout sessions is still at the details collection stage.

payment_status
null | enum<string>

status of the payment.

Null if checkout sessions is still at the details collection stage.

Verfügbare Optionen:
succeeded,
failed,
cancelled,
processing,
requires_customer_action,
requires_merchant_action,
requires_payment_method,
requires_confirmation,
requires_capture,
partially_captured,
partially_captured_and_capturable
Zuletzt geändert am 1. April 2026