get__subscriptions_checkout-session_{id}
GET /subscriptions/checkout-session/{id}
Get Checkout Session Status
Retrieve the status and details of a Stripe checkout session by its ID. This endpoint is useful for checking payment status and subscription creation after a user completes the checkout process.
Parameters
id
path
string
true
Unique identifier for the Stripe checkout session
TypeScript Client Library
public getCheckoutSessionStatus = async (id: string): Promise<GetCheckoutSessionStatusResponse> => {
return this.makeRequest<GetCheckoutSessionStatusResponse>(`subscriptions/checkout-session/${id}`, 'GET', null);
};Code Samples
# You can also use wget
curl -X GET https://backend.flashback.tech/subscriptions/checkout-session/cs_test_1234567890abcdef \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'GET https://backend.flashback.tech/subscriptions/checkout-session/cs_test_1234567890abcdef HTTP/1.1
Host: localhost:3000
Accept: application/json
Authorization: Bearer {access-token}const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
const sessionId = 'cs_test_1234567890abcdef';
fetch(`https://backend.flashback.tech/subscriptions/checkout-session/${sessionId}`,
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
session_id = 'cs_test_1234567890abcdef'
result = RestClient.get "https://backend.flashback.tech/subscriptions/checkout-session/#{session_id}",
params: {
}, headers: headers
p JSON.parse(result)import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
session_id = 'cs_test_1234567890abcdef'
r = requests.get(f'https://backend.flashback.tech/subscriptions/checkout-session/{session_id}', headers = headers)
print(r.json())<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$session_id = 'cs_test_1234567890abcdef';
$client = new \GuzzleHttp\Client();
try {
$response = $client->request('GET',"https://backend.flashback.tech/subscriptions/checkout-session/{$session_id}", array(
'headers' => $headers,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...String sessionId = "cs_test_1234567890abcdef";
URL obj = new URL("https://backend.flashback.tech/subscriptions/checkout-session/" + sessionId);
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
sessionId := "cs_test_1234567890abcdef"
data := bytes.NewBuffer([]byte{})
req, err := http.NewRequest("GET", "https://backend.flashback.tech/subscriptions/checkout-session/" + sessionId, data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}Example responses
200 Response
{
"success": true,
"id": "cs_test_1234567890abcdef",
"status": "complete",
"payment_status": "paid",
"subscriptionId": "sub_1234567890abcdef"
}200 Response (Open Session)
{
"success": true,
"id": "cs_test_1234567890abcdef",
"status": "open",
"payment_status": "unpaid",
"subscriptionId": null
}200 Response (Expired Session)
{
"success": true,
"id": "cs_test_1234567890abcdef",
"status": "expired",
"payment_status": "unpaid",
"subscriptionId": null
}400 Response
{
"success": false,
"error_code": "INVALID_SESSION",
"message": "Invalid Checkout Session ID"
}Responses
Response Schema
Status Code 200
» success
boolean
false
none
Indicates if the request was successful
» id
string
false
none
Stripe checkout session identifier
» status
string
false
none
Session status (open, complete, expired)
» payment_status
string
false
none
Payment status (unpaid, paid, no_payment_required)
» subscriptionId
string
false
none
Stripe subscription ID (null if not created)
Status Code 400
» success
boolean
false
none
Will be false for error responses
» error_code
string
false
none
Machine-readable error code
» message
string
false
none
Human-readable error message
Last updated
Was this helpful?