Retrieve a CheckoutSession
Retrieve a CheckoutSession resource by ID.
A CheckoutSession can only be retrieved from the server side using a secret API key.
Endpoint
GET /checkout_sessions/:id
Sample code
- curl
- Node
- PHP
- Python
- Ruby
curl --location 'https://api.payrexhq.com/checkout_sessions/<ID of a CheckoutSession resource>' \
-u replace_with_secret_api_key:
const client = require('payrex-node')('insert your PayRex Secret API key.');
const checkoutSession = await client.checkoutSessions.retrieve('<ID of a CheckoutSession resource>');
$client = new \Payrex\PayrexClient('insert your PayRex Secret API key.');
$checkoutSession = $client->checkoutSessions->retrieve('<ID of a CheckoutSession resource>');
from payrex import Client as PayrexClient
client = PayrexClient('insert your PayRex Secret API key.')
checkout_session = client.checkout_sessions.retrieve('<ID of a CheckoutSession resource>')
client = Payrex::Client.new("insert your PayRex Secret API key.")
checkout_session = client.checkout_sessions.retrieve("<ID of a CheckoutSession resource>")
Returns
Returns a CheckoutSession resource.