API Documentation

Learn how to integrate your POS system with our SaaS Control platform

Getting Started
Integrating your local POS with the central SaaS control system limits access when a store subscription expires or the store gets banned.

Your remote POS instances should ping the API regularly (e.g., daily or upon each login) to verify its license status. Depending on the response, your POS must either allow operations or restrict login for users.

Endpoint Information

POST /api/license/check

Content-Type: application/json

Request & Response Format

Request Body (JSON)

{
  "license_key": "DCL-2025-XXXX-YYYY"
}

Response Body (JSON)

{
  "status": "active", // Possible values: "active", "warning", "expired", "blocked"
  "store": {
    "name": "Diecast Land",
    "expiry_date": "2026-05-10",
    "is_locked": false
  }
}
Integration Code Examples
Copy these examples to your POS system to immediately enforce SaaS control rules.
<?php

function checkLicense($licenseKey) {
    $curl = curl_init();
    
    curl_setopt_array($curl, [
        CURLOPT_URL => "https://your-saas-domain.com/api/license/check",
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_ENCODING => "",
        CURLOPT_MAXREDIRS => 10,
        CURLOPT_TIMEOUT => 30,
        CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
        CURLOPT_CUSTOMREQUEST => "POST",
        CURLOPT_POSTFIELDS => json_encode([
            "license_key" => $licenseKey
        ]),
        CURLOPT_HTTPHEADER => [
            "Content-Type: application/json",
            "Accept: application/json"
        ],
    ]);

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

    if ($err) {
        return false; // Decide fallback local policy (e.g., allow temporarily)
    } else {
        $result = json_decode($response, true);
        
        if (isset($result['status']) && in_array($result['status'], ['blocked', 'expired'])) {
            // Block POS operations
            die("Your POS license has expired or is blocked. Please contact support.");
        }
        
        return true;
    }
}

// Call before rendering POS login screen or performing actions
checkLicense(env('POS_LICENSE_KEY'));