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>'
import requests

url = "https://us.api.flexprice.io/v1/checkout/sessions/{id}"

headers = {"x-api-key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};

fetch('https://us.api.flexprice.io/v1/checkout/sessions/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://us.api.flexprice.io/v1/checkout/sessions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://us.api.flexprice.io/v1/checkout/sessions/{id}"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("x-api-key", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://us.api.flexprice.io/v1/checkout/sessions/{id}")
.header("x-api-key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://us.api.flexprice.io/v1/checkout/sessions/{id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "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>"
}
{
"http_status_code": 123,
"message": "<string>"
}
{
"http_status_code": 123,
"message": "<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