POST
/
checkout
/
sessions
curl --request POST \
  --url https://api.cnaught.com/v1/checkout/sessions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "amount_kg": 100,
  "success_url": "https://www.example.com/confirmation?my_query=my_value&session_id={CHECKOUT_SESSION_ID}",
  "cancel_url": "https://www.example.com/purchase-credits",
  "description": "on behalf of Jane Smith",
  "notification_config": {
    "url": "https://www.example.com/callback"
  }
}'
{
  "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.

Headers

X-Subaccount-Id
string

If present, scopes the operation to the subaccount with given id. See Subaccounts for more info.

Body

application/json

Checkout Session Parameters

The body is of type object.

Response

201
application/json

Checkout Session

The response is of type object.