Here's my code:
$pp = curl_init();
curl_setopt($pp, CURLOPT_URL, "https://api.paypal.com/v1/payments/billing-plans");
curl_setopt($pp, CURLOPT_HEADER, false);
curl_setopt($pp, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($pp, CURLOPT_SSLVERSION , 6);
curl_setopt($pp, CURLOPT_POST, true);
curl_setopt($pp, CURLOPT_RETURNTRANSFER, true);
curl_setopt($pp, CURLOPT_POSTFIELDS, "page_size=3&status=ALL&page=1&total_required=yes");
curl_setopt($pp, CURLOPT_HTTPHEADER, array(
"Content-Type: application/json",
"Authorization: Bearer $token"
));
$result_pp = curl_exec($pp);
echo $result_pp;
Here's the error I'm getting:
{"name":"MALFORMED_REQUEST","message":"The request JSON is not well formed.","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#MALFORMED_REQUEST","debug_id":"b742c35fe6e0e"}
This is the documentation link:
https://developer.paypal.com/docs/api/payments.billing-plans/v1/#billing-plans_list
Basically just trying to pull a list of all my PayPal subscriptions, but it looks like I'm not sending something in JSON correctly...