Detecting new paid member via API

I’m trying to detect new paid members via api, regardless of whether they upgraded to paid, or joined as a new paid member. I can only seem to detect the latter, not the former. Does anyone have any suggestions for detecting the former in an efficient way?

Can anyone answer this question? I’m looking for someone to answer because I have the same question. If anyone has solution, please tag me. Thanks a lot.

I have an approach that sort of works, but it’s not as robust as I’d like, hence my question. I have Ghost send a webhook to n8n when someone joins, and I check their paid status in the n8n workflow via the json body, as follows:

/ Directly access the member's current data from the JSON
const bodyObject = $("Webhook").first();
const currentMember = bodyObject.json.body.member.current;

// Determine paid subscription status
const isPaid = Array.isArray(currentMember.subscriptions) && currentMember.subscriptions.some(subscription => subscription.status === 'active');

// Get member email in case needed
const email = currentMember.email;

// Output the email address and paid status
return [{ json: { "email": email, "paid": isPaid} }];

What is not robust about this?

It doesn’t, for some reason, always pick up when an existing member upgrades to paid, but does catch new paid members who start as paid. I’ve struggled to make the former aspect work properly.

Are you using the member.edited Webhooks event as well as member.added?

It’s not clear from the docs if member.edited fires when a user upgrades their account or only when an admin updates the member.

I am using both webhooks, and it’s not catching upgrades for some reason.

On your server that should be receiving the webhook calls, check your web server logs next time to see if the request is arriving at all.

If it’s not, it sounds like a bug or missing feature in Ghost.

Either the member.edited webhook should be firing in this case, or they need an additional webhook