Verify if a user purchased an item



I’d like to know if an user have purchased my item.

This code worked well'.$username.'/'.$api_key.'/verify-purchase:'.$purchase_code.'.json'

As i understand this code doesn’t works anymore. I found another way to do this :

    $url = "".$productCode;
$curl = curl_init($url);

$header = [];
$header[] = 'Authorization: Bearer '.$personalKey;
$header[] = 'User-Agent: TEST';
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER,$header);

$content = curl_exec($curl);
$content = json_decode($content);


The problem is this code return null

Thanx for your help