Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Count active subscriptions with PayPal API?

I need to use PHP to count the number of active subscriptions in my PayPal account (people subscribed to my service, not the counts of services I'm subscribed to).

Does anyone know how to do this or can point me in the right direction?

I can't find any documentation that allows you to see a list of your active subscriptions via the API, but I'm assuming that PayPal has this option and I'm just missing it...

like image 888
Chase Avatar asked Mar 05 '23 15:03

Chase


2 Answers

This option cannot be found because it's apparently not available:

https://github.com/paypal/PayPal-REST-API-issues/issues/5

like image 172
Chase Avatar answered Mar 15 '23 16:03

Chase


Apparently you cannot get a list of subscriptions regardless the status for the time being, as you can see here https://developer.paypal.com/docs/api/subscriptions/v1/#subscriptions there is no such feature available so let's hope Paypal adds it in the future.

However if you are storing the subscription ids in a database then you can loop them and foreach subscription id you can get the details of the subscription https://developer.paypal.com/docs/api/subscriptions/v1/#subscriptions_get and check its status and finally display only the ones with an active status.

like image 37
giannisrig Avatar answered Mar 15 '23 15:03

giannisrig