```php
<?php

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

$data = Request::post();

try {

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

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

    $query = "

        UPDATE provider_subscriptions

        SET status = 'cancelled'

        WHERE provider_id = :provider_id
        AND status = 'active'

    ";

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

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

    Response::success([],"Subscription cancelled");

}
catch(Exception $e){

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

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

}