How to list all PayPal subscriptions and billing agreements and recurring ids API retrieve fetch all
-
Open Devtools and run the following script:
const arr = [];
const interval = setInterval(function() {
for (const el of document.getElementsByClassName('list-plan__link')) {
if (!arr.includes(el.innerHTML)) arr.push(el.innerHTML);
}
const buttons = document.getElementsByClassName('pagination__page');
let match = false;
for (const btn of buttons) {
if (btn.getAttribute('data-pa-click') === 'pageination-next') {
btn.click();
match = true;
break;
}
}
if (!match) {
clearInterval(interval);
alert('done');
}
}, 3000);
console.log(JSON.stringify(arr, null, 2));
- When it is finished, you will get an alert saying "done", and in the console will be the array of ID's for you to copy/paste.
Thanks a lot 👍