# How to integrate Discourse Gamification with an external system (redeem and award points)

**URL:** https://meta.discourse.org/t/how-to-integrate-discourse-gamification-with-an-external-system-redeem-and-award-points/262968
**Category:** Integrations
**Tags:** gamification
**Created:** [April 26, 2023, 5:07pm UTC](https://meta.discourse.org/t/how-to-integrate-discourse-gamification-with-an-external-system-redeem-and-award-points/262968 "2023-04-26T17:07:13Z")
**Posts on this page:** 16
**Page:** 2

<div class="post-metadata">

### Author: ![Santa\_Claus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/santa_claus/32/313731_2.png) [@Santa\_Claus](https://meta.discourse.org/u/Santa_Claus)
#### Post date: [August 20, 2023, 7:15am UTC](https://meta.discourse.org/t/how-to-integrate-discourse-gamification-with-an-external-system-redeem-and-award-points/262968/26 "2023-08-20T07:15:06Z")

</div>

I have a crazy idea, it happens that in WooCommerce I am using a virtual wallet (based on points) which I would like to synchronize with the gamification points of Discourse… but I feel that only a API is very heavy (be consulting every x cron or when user hace action in WC)… you could create a webhook so that the virtual wallet in WooCommerce is updated with the points obtained in discourse?.. I attach a guide schema

 ![imagen](https://global.discourse-cdn.com/meta/original/4X/1/c/2/1c2c85cc601bda447d0094cd483c05883121dd76.jpeg)

I know it can be more complex than it seems, especially since the Discourse API is relatively new (and there’s no webhook either), but I only present a use case, validate the idea

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [August 21, 2023, 3:11am UTC](https://meta.discourse.org/t/how-to-integrate-discourse-gamification-with-an-external-system-redeem-and-award-points/262968/27 "2023-08-21T03:11:48Z")

</div>

> [@Santa\_Claus](#):
>
> you could create a webhook so that the virtual wallet in WooCommerce is updated with the points obtained in discourse?

Gamification recalculates every 5 minutes, so I think using a crontab style sync is quite appropriate.

---

<div class="post-metadata">

### Author: ![Santa\_Claus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/santa_claus/32/313731_2.png) [@Santa\_Claus](https://meta.discourse.org/u/Santa_Claus)
#### Post date: [August 22, 2023, 1:15am UTC](https://meta.discourse.org/t/how-to-integrate-discourse-gamification-with-an-external-system-redeem-and-award-points/262968/28 "2023-08-22T01:15:09Z")

</div>

Oh, I hadn’t thought of that approach… ie I can use n8n (own hosting to reduce costs); I’ll create a cron trigger every 5 or maybe 10 minutes querying the Discourse API for new points ( **How would I go about querying all users? Or would you do it for events?** )… **Although, of course, there will be a constant little time window where you won’t see the score synced across both platforms…**

---

<div class="post-metadata">

### Author: ![Santa\_Claus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/santa_claus/32/313731_2.png) [@Santa\_Claus](https://meta.discourse.org/u/Santa_Claus)
#### Post date: [August 25, 2023, 3:07am UTC](https://meta.discourse.org/t/how-to-integrate-discourse-gamification-with-an-external-system-redeem-and-award-points/262968/29 "2023-08-25T03:07:32Z")

</div>

I was thinking about it, and I think that if a webhook could be created for the gamification plugin sending the information by events **(without having to consult via API)** this would avoid having to consult, for example, if there are 200 active users, 200 times a API every 5 minutes (also by default **Discourse allows webhooks)…it’s important because Discourse is the main source of points (and updates more constantly) and this would be an update that allows background sync. instantly according to the changes in Discourse…**

---

<div class="post-metadata">

### Author: ![fbpbdmin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fbpbdmin/32/300893_2.png) [@fbpbdmin](https://meta.discourse.org/u/fbpbdmin)
#### Post date: [September 19, 2023, 5:28am UTC](https://meta.discourse.org/t/how-to-integrate-discourse-gamification-with-an-external-system-redeem-and-award-points/262968/30 "2023-09-19T05:28:05Z")

</div>

@Falco  
plan to add an API to delete events ? thanks.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [September 19, 2023, 6:55am UTC](https://meta.discourse.org/t/how-to-integrate-discourse-gamification-with-an-external-system-redeem-and-award-points/262968/31 "2023-09-19T06:55:19Z")

</div>

I want to add it, but it’s not planned yet. At the moment you can update it’s value to 0.

---

<div class="post-metadata">

### Author: ![fbpbdmin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fbpbdmin/32/300893_2.png) [@fbpbdmin](https://meta.discourse.org/u/fbpbdmin)
#### Post date: [September 19, 2023, 2:11pm UTC](https://meta.discourse.org/t/how-to-integrate-discourse-gamification-with-an-external-system-redeem-and-award-points/262968/32 "2023-09-19T14:11:30Z")

</div>

thanks @Falco  
guess for an event, the ID could get a negative point, right ?  
say, if lose in an competition event

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [September 19, 2023, 3:07pm UTC](https://meta.discourse.org/t/how-to-integrate-discourse-gamification-with-an-external-system-redeem-and-award-points/262968/33 "2023-09-19T15:07:21Z")

</div>

Yes, you can award negative scores too. It’s useful for doing events like exchanging points for gifts, applying penalties, etc.

---

<div class="post-metadata">

### Author: ![Frully](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frully/32/235059_2.png) [@Frully](https://meta.discourse.org/u/Frully)
#### Post date: [October 7, 2023, 1:51pm UTC](https://meta.discourse.org/t/how-to-integrate-discourse-gamification-with-an-external-system-redeem-and-award-points/262968/34 "2023-10-07T13:51:40Z")

</div>

Late to the party here - Is there a way that certain point transactions could be earmarked so they don’t count as ‘spends’ toward leaderboard rank? Would want other true negative points to count toward leaderboard (votes/flags against, api events as suggested above for ‘losing’ a ladder event, etc).  
eg.

- accumulate 10k points through activities, be in the lead. Yay!
- Spend 10k points on fancy swag, be at ‘spendable’ 0 points as a query would sum 10k - 10k.
- 
  - but should still be on the top of the leaderboard.

- Lose 2k points in a ladder game, display on leaderboard at 8k. Lose the lead…Spendable balance negative 2k.

---

<div class="post-metadata">

### Author: ![fbpbdmin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fbpbdmin/32/300893_2.png) [@fbpbdmin](https://meta.discourse.org/u/fbpbdmin)
#### Post date: [November 18, 2023, 12:57am UTC](https://meta.discourse.org/t/how-to-integrate-discourse-gamification-with-an-external-system-redeem-and-award-points/262968/35 "2023-11-18T00:57:18Z")

</div>

hey @Falco  
after editing the point of an event, will it re-calculate the overall point for an ID ?  
seems not. is this expected ?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [November 18, 2023, 12:24pm UTC](https://meta.discourse.org/t/how-to-integrate-discourse-gamification-with-an-external-system-redeem-and-award-points/262968/36 "2023-11-18T12:24:00Z")

</div>

That’s what the warning in the OP covers. Since we cache the total score everywhere in the UI, after your edit it will only reflect after a cache update. For recent events the cache updates automatically, but for events that happened over 10 days ago, you will need to trigger a score update for the period.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [May 13, 2024, 8:27pm UTC](https://meta.discourse.org/t/how-to-integrate-discourse-gamification-with-an-external-system-redeem-and-award-points/262968/37 "2024-05-13T20:27:29Z")

</div>

7 posts were split to a new topic: [Add bulk\_create to Gamification external event API](https://meta.discourse.org/t/add-bulk-create-to-gamification-external-event-api/307800)

---

<div class="post-metadata">

### Author: ![nickmoores](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nickmoores/32/246104_2.png) [@nickmoores](https://meta.discourse.org/u/nickmoores)
#### Post date: [November 14, 2024, 7:23pm UTC](https://meta.discourse.org/t/how-to-integrate-discourse-gamification-with-an-external-system-redeem-and-award-points/262968/39 "2024-11-14T19:23:01Z")

</div>

Do we have the ability to constrain the API Key’s scope to just the Gamification plugin?

Not seeing an option in our API Key Admin view to constrain the key to `...admin/plugins/gamification/score_events`

And our leadership is skeptical that we need a truly **Global** API Key for this.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [November 15, 2024, 10:09pm UTC](https://meta.discourse.org/t/how-to-integrate-discourse-gamification-with-an-external-system-redeem-and-award-points/262968/40 "2024-11-15T22:09:04Z")

</div>

I suspect you’re right. It seems that more scopes get added as they are asked for. You could with a custom plugin if you’re self hosted. You could submit a PR and or post as a #Contribute > Feature request. If you’re an enterprise customer you could have your leadership ask. 😉

Hmm. Now I wonder about adding a custom api scope in a plugin is possible (especially having one plugin add an api scope for another plugin). I suspect that it is, but haven’t seen it done.

Maybe just create a user for just the api so at least you’d be able to track it that way.

---

<div class="post-metadata">

### Author: ![Joe\_F](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@Joe\_F](https://meta.discourse.org/u/Joe_F)
#### Post date: [July 23, 2025, 1:56pm UTC](https://meta.discourse.org/t/how-to-integrate-discourse-gamification-with-an-external-system-redeem-and-award-points/262968/41 "2025-07-23T13:56:35Z")

</div>

Did this ever happen?

CC: @Falco

---

<div class="post-metadata">

### Author: ![anoedo](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@anoedo](https://meta.discourse.org/u/anoedo)
#### Post date: [November 21, 2025, 2:18pm UTC](https://meta.discourse.org/t/how-to-integrate-discourse-gamification-with-an-external-system-redeem-and-award-points/262968/42 "2025-11-21T14:18:00Z")

</div>

As a programming newbie, I’ve tried hard to understand the post content but it’s still quite difficult for me…… I wanted to ask if this feature is similar to “pay to see”? It’s a very common feature in traditional forums where users earn points through events (like daily check-in, posting, replying, etc.), and then some posts in the forum require users to pay points to view the full content. In traditional forums (like Discuz), both earning points and deducting points operations are automated. From what I can see now, gamification can handle the “earning points” part, but does the “deducting points” operation require manual API calls by administrators? This would be too difficult for a personal forum. From what I understand, recklessly operating APIs without much programming knowledge can be dangerous and might even cause the entire community to break down……😭

Is it possible to implement this “pay to see” feature as a standalone plugin? Or if I were to hire someone to customize it, roughly how much would it cost?

[Previous page](https://meta.discourse.org/t/how-to-integrate-discourse-gamification-with-an-external-system-redeem-and-award-points/262968.md?page=1)
