Skip to main content
GET
https://api.lite.sa/v1
/
checkout
/
sessions
/
{session_id}
/
validity
Check session validity
curl --request GET \
  --url https://api.lite.sa/v1/checkout/sessions/{session_id}/validity \
  --header 'x-api-key: <api-key>'
import requests

url = "https://api.lite.sa/v1/checkout/sessions/{session_id}/validity"

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://api.lite.sa/v1/checkout/sessions/{session_id}/validity', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};

fetch('https://api.lite.sa/v1/checkout/sessions/{session_id}/validity', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
package main

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

func main() {

url := "https://api.lite.sa/v1/checkout/sessions/{session_id}/validity"

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))

}
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lite.sa/v1/checkout/sessions/{session_id}/validity",
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;
}
{
  "valid": true,
  "session_id": "ses_a1b2c3d4e5f6",
  "status": "Pending",
  "expires_on": "2026-05-18T12:00:00.000Z",
  "order_id": "ORD-123456",
  "amount": 10000,
  "currency": "SAR"
}
{
"error": {
"code": "PAYMENT_DETAILS_MISMATCH",
"message": "The request was invalid or malformed",
"timestamp": "2024-12-16T10:30:00.000Z",
"details": {},
"correlationId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "PAYMENT_DETAILS_MISMATCH",
"message": "The request was invalid or malformed",
"timestamp": "2024-12-16T10:30:00.000Z",
"details": {},
"correlationId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "PAYMENT_DETAILS_MISMATCH",
"message": "The request was invalid or malformed",
"timestamp": "2024-12-16T10:30:00.000Z",
"details": {},
"correlationId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "PAYMENT_DETAILS_MISMATCH",
"message": "The request was invalid or malformed",
"timestamp": "2024-12-16T10:30:00.000Z",
"details": {},
"correlationId": "550e8400-e29b-41d4-a716-446655440000"
}
}

Authorizations

x-api-key
string
header
required

API key for service-to-service or merchant authentication.

Headers

x-correlation-id
string<uuid>

Unique identifier for request tracing. Generated by the client or server if not provided.

Example:

"550e8400-e29b-41d4-a716-446655440000"

Path Parameters

session_id
string
required

Unique identifier of the checkout session

Example:

"ses_a1b2c3d4e5f6"

Response

Checkout session validity status.

valid
boolean
required

Whether the session is still valid

Example:

true

session_id
string
required

Session ID

Example:

"ses_a1b2c3d4e5f6"

status
required

Session is active and awaiting payment

Allowed value: "Pending"
Example:

"Pending"

expires_on
string<date-time>
required

Session expiry timestamp

Example:

"2026-05-18T12:00:00.000Z"

order_id
string
required

Order reference

Example:

"ORD-123456"

amount
integer
required

Session amount in minor units

Example:

10000

currency
string
required

Currency code (ISO 4217)

Example:

"SAR"