Skip to main content
GET
/
checkout
/
sessions
/
{id}
Get checkout session
curl --request GET \
  --url https://us.api.flexprice.io/v1/checkout/sessions/{id} \
  --header 'x-api-key: <api-key>'
{
  "action": "create_subscription",
  "cancel_url": "<string>",
  "cancelled_at": "2023-11-07T05:31:56Z",
  "checkout_invoice_id": "<string>",
  "checkout_payment_id": "<string>",
  "completed_at": "2023-11-07T05:31:56Z",
  "configuration": {
    "create_subscription_params": {
      "currency": "<string>",
      "end_date": "2023-11-07T05:31:56Z",
      "lookup_key": "<string>",
      "metadata": {},
      "plan_id": "<string>",
      "start_date": "2023-11-07T05:31:56Z"
    }
  },
  "created_at": "2023-11-07T05:31:56Z",
  "created_by": "<string>",
  "customer_id": "<string>",
  "environment_id": "<string>",
  "expires_at": "2023-11-07T05:31:56Z",
  "failure_reason": "<string>",
  "failure_url": "<string>",
  "id": "<string>",
  "idempotency_key": "<string>",
  "metadata": {},
  "payment_action": {
    "url": "<string>"
  },
  "payment_provider": "razorpay",
  "provider_result": {
    "expires_at": "2023-11-07T05:31:56Z",
    "next_action": {
      "url": "<string>"
    },
    "provider_metadata": {},
    "provider_payment_intent_id": "<string>",
    "provider_session_id": "<string>"
  },
  "result": {
    "create_subscription_result": {
      "invoice_id": "<string>",
      "payment_id": "<string>",
      "subscription_id": "<string>"
    }
  },
  "success_url": "<string>",
  "tenant_id": "<string>",
  "updated_at": "2023-11-07T05:31:56Z",
  "updated_by": "<string>"
}

Authorizations

x-api-key
string
header
required

Enter your API key in the format x-api-key <api-key>*

Path Parameters

id
string
required

Checkout session ID

Response

OK

action
enum<string>
Available options:
create_subscription
cancel_url
string
cancelled_at
string<date-time>
checkout_invoice_id
string

CheckoutInvoiceID and CheckoutPaymentID are set once the apply step creates the corresponding Flexprice entities (completed sessions only).

checkout_payment_id
string
checkout_status
enum<string>
Available options:
initiated,
pending,
completed,
failed,
expired
completed_at
string<date-time>
configuration
object
created_at
string<date-time>
created_by
string
customer_id
string
environment_id
string
expires_at
string<date-time>

ExpiresAt is required. A Temporal timer fires at this time for any session still in initiated|pending, marking it expired. The caller must create a new session after expiry (expire-and-restart model).

failure_reason
string

FailureReason is a human-readable string set on failed sessions.

failure_url
string
id
string
idempotency_key
string

IdempotencyKey is caller-supplied. It is unique only while the session is active (initiated|pending). The same key may be reused once the session reaches a terminal state (completed|failed|expired).

metadata
object
payment_action
object
payment_provider
enum<string>
Available options:
razorpay
provider_result
object
result
object
status
enum<string>
Available options:
published,
deleted,
archived
success_url
string

Redirect URLs sent to the payment provider. The provider redirects the user browser to the appropriate URL after the payment flow completes.

tenant_id
string
updated_at
string<date-time>
updated_by
string