Checkout Sessions
Lấy Phiên Thanh Toán
Lấy chi tiết của một phiên thanh toán cụ thể theo ID của nó.
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>"
}Ủy quyền
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Tham số đường dẫn
Checkout Session ID
Phản hồi
Checkout session successfully fetched
Created at timestamp
Id of the checkout session
Customer email: prefers payment's customer, falls back to session
Customer name: prefers payment's customer, falls back to session
Id of the payment created by the checkout sessions.
Null if checkout sessions is still at the details collection stage.
status of the payment.
Null if checkout sessions is still at the details collection stage.
Tùy chọn có sẵn:
succeeded, failed, cancelled, processing, requires_customer_action, requires_merchant_action, requires_payment_method, requires_confirmation, requires_capture, partially_captured, partially_captured_and_capturable Lần sửa đổi cuối 1 tháng 4, 2026
Trang này có hữu ích không?
Trước
Danh sách thanh toánLấy danh sách tất cả các khoản thanh toán liên kết với tài khoản của bạn.
Tiếp theo
⌘I
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>"
}