How to get member Access Expiration?

When exporting Audience using CSV format, there’s a field called “Access Expiration” which confirm until when the member should have access to their tiers rewards.

How can I get such field through the campaigns/{id}/members api endpoint?

You can request the pledge information as an include in the membership info and then check the pledge details. However you shouldnt need to do that if you are going to check for the user’s access to your local rewards - currently_entitled_tiers and currently_entitled_amount_cents will always show what a user is entitled to at any given point. If those two dont show a tier and a $ amount (in your campaign currency), then the user is not entitled to a tier or a $ amount reward.

You can request the pledge information as an include in the membership info and then check the pledge details.

How exactly does it work? How do I get the pledge details? I only see the pledge events, but it doesn’t say when a subscription ends (not even for the “pledge_delete” event).

However you shouldnt need to do that if you are going to check for the user’s access to your local rewards - currently_entitled_tiers and currently_entitled_amount_cents will always show what a user is entitled to at any given point.

Yes, that’s true, but I don’t want to have to send a request to Patreon every time to check the status. I would prefer to store in my database when the current payment interval ends. If I then receive a webhook or query the status daily via cronjob and the user has extended the subscription by paying, I update the date in the database. And so it’s enough for me to look in my database for the status. So how exactly do you find out when the subscription would end if a user stops paying?

How exactly does it work? How do I get the pledge details? I only see the pledge events, but it doesn’t say when a subscription ends (not even for the “pledge_delete” event).

Check out the cadence and next charge date values in member data:

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

So how exactly do you find out when the subscription would end if a user stops paying?

There is the problem - a patron’s payment may fail upon renewal, but then succeed when its tried the next day. So patrons have a ~3 days grace time while their payments are retried. The payment dates cant help address that. So if you use next charge date to use it for expiration etc, add ~3 days of grace period to it. Or if the reward format that you use is not tolerant to allowing grace periods and the reward decision must be made immediately, then just make a call to the api to get the currently entitled tiers and amount cents.