# Website Features for Certain Tier Members

**URL:** <https://www.patreondevelopers.com/t/website-features-for-certain-tier-members/3081>\
**Category:** Friendly Help\
**Created:** [May 1, 2020, 7:37pm UTC](https://www.patreondevelopers.com/t/website-features-for-certain-tier-members/3081 "2020-05-01T19:37:43Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kreeba](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/kreeba/32/1279_2.png) [@Kreeba](https://www.patreondevelopers.com/u/Kreeba)\
**Post date:** [May 1, 2020, 7:37pm UTC](https://www.patreondevelopers.com/t/website-features-for-certain-tier-members/3081/1 "2020-05-01T19:37:43Z")

</div>

Hi.

I am working on a Node/Express product that will allow members of a certain monthly subscription tier to have an enhanced feature set. Can I just check with you guys what I am doing seems normal?

I have auth’ed my user’s through Patreon and got back their access token. Then I have run [https://patreon.com/api/oauth2/v2/identity?include=memberships.currently\_entitled\_tiers](https://patreon.com/api/oauth2/v2/identity?include=memberships.currently_entitled_tiers) with their access token in the GET header. All good. Getting back decent data.

I am guessing that I then need to check the objects within the returned ‘Included’ object and check that one of them has the matching ID for the campaign and then check within that objects “relationships” \> “currently\_entitled\_tiers” \> “data” for a matching ID for the correct tier?

**QUESTIONS:**

1. Is the above pattern what I should be doing to check the currently logged in user has the correct tier level, is this ‘safe’ to do it this way?
2. How do I get the IDs for the Campaign and Tier? Is there a way in the Patreon GUI or do I need to run a script once through the API to find out what they are?
3. Do Tier ID’s or Campaign ID’s change at all, or am I safe hard-coding it?
4. How can I also test if the currently logged in user is the owner of the campaign?

---

<div class="post-metadata">

**Author:** ![sffc](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/sffc/32/1284_2.png) [@sffc](https://www.patreondevelopers.com/u/sffc)\
**Post date:** [May 2, 2020, 4:51am UTC](https://www.patreondevelopers.com/t/website-features-for-certain-tier-members/3081/2 "2020-05-02T04:51:33Z")

</div>

This is the flow I’ve implemented as well. You also need to set up webhooks so that if a patron changes their tier on Patreon, you reflect that on your site as well.

If you authorize the “campaigns” scope, you can get a list of campaigns owned by the current user. I manually inspected the JSON response to a GET request on the “campaigns” endpoint to get all the IDs for my tiers. There might be a way to get it from source code, but I didn’t find it displayed on the GUI anywhere. My assumption is that IDs are fixed and won’t change.

---

<div class="post-metadata">

**Author:** ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)\
**Post date:** [May 2, 2020, 8:41pm UTC](https://www.patreondevelopers.com/t/website-features-for-certain-tier-members/3081/3 "2020-05-02T20:41:26Z")

</div>

For working and tested examples, you can always check WP plugin and PHP lib.

> **[Patreon/patreon-wordpress](https://github.com/Patreon/patreon-wordpress)**
>
> Contribute to Patreon/patreon-wordpress development by creating an account on GitHub.

WP plugin has some pretty fleshed out logic in oauth, api classes and how to process patron data.

> **[Patreon/patreon-php](https://github.com/Patreon/patreon-php)**
>
> Interact with the Patreon API via OAuth. Contribute to Patreon/patreon-php development by creating an account on GitHub.

Whereas PHP lib is much faster to understand and it has clean examples which you can start building your logic on.

WP plugin matches patrons to content over $ amounts.

Using $ amounts, the locked content at your app still functions when tiers are changed or deleted. You dont end up comparing the user’s patronage to a nonexistent tier.

To do exact tier match, you can do value matching (locked content's value vs patron’s patronage $ value), but also optionally check for exact tier id.

In this current context, you can first check match for exact tier id, and if that tier info is stale or missing, you can match over $ value. Or mix them as needed.

That would make your app more resilient to changes.

---

<div class="post-metadata">

**Author:** ![Kreeba](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/kreeba/32/1279_2.png) [@Kreeba](https://www.patreondevelopers.com/u/Kreeba)\
**Post date:** [May 2, 2020, 9:53pm UTC](https://www.patreondevelopers.com/t/website-features-for-certain-tier-members/3081/4 "2020-05-02T21:53:23Z")

</div>

Thanks for the suggestions. I will look into adding $ amount to my checks.

I am currently just checking to see if the correct tier id is present within the **included** array brought back from the **currently\_entitled\_tiers** scope. Is that not enough in your experience?

---

<div class="post-metadata">

**Author:** ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)\
**Post date:** [May 4, 2020, 12:25pm UTC](https://www.patreondevelopers.com/t/website-features-for-certain-tier-members/3081/5 "2020-05-04T12:25:22Z")

</div>

That would be definitely enough. An exact tier match.

If you add a $ check fallback after that you would also cover your app for future changes in your tiers. (ie, deletion, price change)

---

<div class="post-metadata">

**Author:** ![sffc](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/sffc/32/1284_2.png) [@sffc](https://www.patreondevelopers.com/u/sffc)\
**Post date:** [May 5, 2020, 12:34am UTC](https://www.patreondevelopers.com/t/website-features-for-certain-tier-members/3081/6 "2020-05-05T00:34:25Z")

</div>

I’ve observed that there’s only ever one tier in currently\_entitled\_tiers. On my site I have each tier ID mapped to a set of features that should be available at that tier.

---

<div class="post-metadata">

**Author:** ![codebard](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/codebard/32/14_2.png) [@codebard](https://www.patreondevelopers.com/u/codebard)\
**Post date:** [May 5, 2020, 9:20pm UTC](https://www.patreondevelopers.com/t/website-features-for-certain-tier-members/3081/7 "2020-05-05T21:20:10Z")

</div>

That’s a way to do it yeah…

---

<div class="post-metadata">

**Author:** ![mekane](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/mekane/32/1297_2.png) [@mekane](https://www.patreondevelopers.com/u/mekane)\
**Post date:** [May 15, 2020, 6:37am UTC](https://www.patreondevelopers.com/t/website-features-for-certain-tier-members/3081/8 "2020-05-15T06:37:25Z")

</div>

I had to sign up for an account to say thanks for posting this question! I was struggling to build something similar - a way to query the active tier for the authorized user for the campaign I know about. I only wanted to use the ‘identity’ scope so as not to request too much access. It was working fine to just give me their membership to my campaign but I could not figure out how to get the tier from there - I kept getting access denied. I never would have thought to include `memberships.currently_entitled_tiers` but that works perfectly. How in the world did you figure out you could do that? I didn’t see any mention of it in the docs.

---

<div class="post-metadata">

**Author:** ![Kreeba](https://yyz2.discourse-cdn.com/flex036/user_avatar/www.patreondevelopers.com/kreeba/32/1279_2.png) [@Kreeba](https://www.patreondevelopers.com/u/Kreeba)\
**Post date:** [May 15, 2020, 5:00pm UTC](https://www.patreondevelopers.com/t/website-features-for-certain-tier-members/3081/9 "2020-05-15T17:00:30Z")

</div>

Hi.

If you look at the Identity endpoint here [https://docs.patreon.com/#get-api-oauth2-v2-identity](https://docs.patreon.com/#get-api-oauth2-v2-identity)

The most useful line is the request example in the code box on the right (commented out red text)

You will also see you can click on ‘memberships’ as a top level includes, which links you here: [https://docs.patreon.com/#member](https://docs.patreon.com/#member) that gives you all the fields you can request

But, trust me, it was like 2 hours of hacking around to work it out. 🙂
