Is there a way to know how much cumulative time a patron has been actively subscribed for?

I’m trying to encourage members of a website I run to pledge to my Patreon page. I want to be able to give users profile badges which reflect how many months they’ve actively supported my page for.

This is the design I’m working with:

image

If a user pledges today and maintains their pledge, in 12 months time I’d want to show that they’ve been a patron for 12 months.

If a user was to pledge today but cancel their pledge then return 12 months later to pledge a second time, I would only want to show the months they were actively pledged for, and not include any periods of inactivity.

Is this something I can achieve with the v2 Patreon API?

Yes, you can base it over pledge relationship start date.

This would give me the amount of time that has passed since a user first pledged, but wouldn’t tell me if they were inactive at any point?

Or does the member object contain multiple entries if the user pledges, cancels and pledges again?

(Sorry, I don’t have much data to work with on my side so I’m not 100% sure how the API shapes up over time.)

Okay, I’ve figured it out. If I include user and pledge_history as well as the payment_status and type fields from https://www.patreon.com/api/oauth2/v2/campaigns/{campaign_id}/members I can see exactly how many monthly payments each user has made and infer the value I need from that.

If the user cancels at any point, that relationship would end. When the user starts, a new relationship should start.

https://docs.patreon.com/#member

So that date should always show you the start of an active pledge relationship.

1 Like