Retrieve a Checkout Session

Retrieves the details of an existing checkout session. You need only supply the unique checkout session identifier that was returned upon creation.

Arguments

Parameter
Description

id

The ID of the Checkout Session to be retrieved

GET https://{provided url}/v1/checkout/sessions/:id

curl https://{provided url}/v1/checkout/sessions/2AW-kLcRRC5P8U68CYe0kVA \
  -u sk_test_BQokikJOvBiI2HlWgH4olfQ2: \

Response Fields

Field

Type

Description

id

string

Unique identifier for the object.

amount_total

int

Total amount after discounts and fees are applied.

amount_subtotal

int

Total amount before discounts or fees are applied.

currency

string

Three-letter ISO currency code (ISO-4217). Must be a supported currency.

success_url

string

The URL to which the application should send customers when the checkout session is completed.

cancel_url

string

If set, checkout displays a back button and the customer will be redirected to this URL if they cancel payment.

customer_firstname

string

Customer’s first name.

customer_lastname

string

Customer’s last name.

customer_email

string

Customer’s email.

customer_ip

string

Customer’s IP address.

expires_at

int

The timestamp at which the Session will expire.

locale

string

The IETF language tag of the locale Checkout is displayed in. If blank, the browser’s locale is used.

payment_method_types

list

A list of the types of payment methods the Checkout Session is allowed to accept. Possible values: blik

metadata

hash

A set of key-value pairs attached to a payout object. Useful for storing additional information.

created_at

int

The timestamp at which the Session was created.

status

enum

The status of the charge: "open", "pending", "expired", or "completed".

fees

list

The list of discounts or fees applied to the Checkout Session.

livemode

bool

True if the object exists in live mode, false if in test mode.

Example JSON Response

{
	"id": "AW-kLcRRC5P8U68CYe0kVA",
	"amount_total": 1000,
	"amount_sub_total": 1000,
	"currency": "usd",
	"cancel_url": "",
	"customer_firstname": "John",
	"customer_lastname": "Doe",
	"customer_email": "john@example.com",
	"expire_at": null,
	"success_url": "",
	"payment_method_types": ["blik"],
	"locale": "",
	"url": "https://{provided url}/pay/2AW-kLcRRC5P8U68CYe0kVA",
	"fees": null,
	"metadata": null
	"status": "open",
	"livemode": false
}

Last updated