```php
<?php

require_once '../../core/api_bootstrap.php';

$data = Request::get();

try {

    Validator::required($data,['provider_id']);

    $db = new Database();
    $conn = $db->connect();

    $query = "

        SELECT *

        FROM provider_subscriptions

        WHERE provider_id = :provider_id
        AND status = 'active'
        AND expiry_date >= CURDATE()

        LIMIT 1

    ";

    $stmt = $conn->prepare($query);

    $stmt->execute([
        ':provider_id'=>$data['provider_id']
    ]);

    $sub = $stmt->fetch();

    if(!$sub){
        Response::error("No active subscription",404);
    }

    Response::success($sub);

}
catch(Exception $e){

    Logger::log("system.log",$e->getMessage());

    Response::error("Server error",500);

}