GET
/
checkout
/
sessions
/
{id}
curl --request GET \
  --url https://api.cnaught.com/v1/checkout/sessions/{id} \
  --header 'Authorization: Bearer <token>'
{
  "id": "zpQ6QSNRQh",
  "amount_kg": 100,
  "price_usd_cents": 200,
  "success_url": "https://www.example.com/confirmation?my_query=my_value&session_id={CHECKOUT_SESSION_ID}",
  "cancel_url": "https://www.example.com/purchase-credits",
  "checkout_url": "https://checkout.cnaught.com/pay/zpQ6QSNRQh",
  "state": "open",
  "created_on": "2022-07-31T18:00:00.000000Z",
  "expires_on": "2022-08-01T18:00:00.000000Z",
  "completed_on": null,
  "portfolio_id": "mHvNvWbq",
  "order_description": "on behalf of Jane Smith",
  "order_webhook_url": "https://www.example.com/callback"
}

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string
required

Id of the Checkout Session to retrieve

Example:

"zpQ6QSNRQh"

Response

200
application/json
Checkout Session
id
string

Identifier that can be used to retrieve the Checkout Session

Example:

"zpQ6QSNRQh"

amount_kg
number

Amount of carbon credits to be purchased upon checkout completion, in kilograms

Example:

10.5

price_usd_cents
number

Total price to be charged upon checkout completion, in USD cents

Example:

2350

success_url
string

URL the customer will be redirected to after they complete Checkout.

Example:

"https://www.example.com/purchase/success"

cancel_url
string

URL the customer will be redirected to if they click the "back" button in Checkout.

Example:

"https://www.example.com/purchase"

checkout_url
string

URL to the Checkout Session. Redirect the customer to this URL to take them to Checkout.

Example:

"https://checkout.cnaught.com/pay/zpQ6QSNRQh"

state
string

The status of the Checkout Session, one of open, complete, or expired.

  • open - The checkout session is still in progress. Payment processing has not started.
  • complete - The checkout session is complete. Payment processing may still be in progress.
  • expired - The checkout session has expired. No further processing will occur.
expires_on
string

Timestamp of when the session will expire.

completed_on
string | null

Timestamp of when the session was completed. Null if session has not been completed.

portfolio_id
string

Id of the portfolio the customer will purchase from when completing Checkout.

subaccount_id
string | null

Id of the subaccount associated with the customer

order_description
string | null

Description to be associated with the order created from this session.

order_webhook_url
string | null

Webhook URL for updates to the order created from this session.