Discourse Subscriptions

:mega: Summary: Discourse Subscriptions allows site owners to sell recurring and one-time purchase subscriptions that grant access to a group on a Discourse instance.

:link: GitHub: https://github.com/discourse/discourse-subscriptions
:arrow_right: Install: Follow the plugin installation guide.


Discourse Subscriptions supports the following features:

  • Create new products and plans from the admin panel
  • Cancel and refund subscriptions from the admin panel
  • Create one time purchase or recurring subscription plans
  • Add free trials on recurring subscriptions
  • SCA/3D Secure support
  • Add/remove users from plan groups as they subscribe/cancel
  • Cancel subscription from user profile
  • Cancellation of subscription at end of subscription period


  • Subscription - Subscriptions are a recurring payment plan which allow you to control access to content on your community. When a subscription is created or deleted, a user is added or removed from the user group you associate with your subscription plan. A subscription is made up of a product and plans.
  • Product - A product in Stripe’s terms is what you’re selling. A product can contain one or more plans.
  • Plan - A plan contains a price, recurring cycle, and associates with a group to which your subscribers gain access.

:rotating_light: Be very careful to keep your Stripe private keys safe and secure at all times.

:warning: If you were to shut down your instance of Discourse, uninstall this plugin or your site were to go offline, Stripe will continue to bill your customers for your service until the subscription is cancelled.


  1. Install & enable the plugin
  2. Configure Stripe
  3. Configure Webhooks & Events in Stripe
  4. Add your Stripe keys (public, secret, webhook secret) under Admin > Plugin > Settings
  5. Create a group for your subscribers to join via purchase
  6. Create a product and plan under Admin > Plugins > Subscriptions
  7. Profit!

Set up your Payment Gateway.

Firstly, you’ll need an account with the Stripe payment gateway. To get started, you can set up an account in test mode and see how it all works without making any real transactions or having to set up a bank account. There is no test mode toggle in the plugin; instead, be sure to use your developer keys (they begin with pk_test, sk_test)

Set up Webhooks and Events in your Stripe account

:bomb: Webhooks are required to make subscription cancellations work fully. Be sure you have them configured correctly.

Once you have an account on Stripe, you’ll need to tell Stripe your website’s address so it can notify you about certain transactions. You can enter this in your Stripe dashboard under Endpoints > URL.

Webhooks address: [your server address]/s/hooks – where [your server address] is the URL of your Discourse install.

You’ll also need to tell Stripe which events it should notify you about via the webhook URL.

Currently, Discourse Subscriptions responds to the following events:

  • customer.subscription.deleted
  • customer.subscription.updated

Add the Stripe API and Webhook keys to your plugin settings

Stripe needs to be authorized to communicate with your website. To do this, it publishes a pair of private and public API keys and a signing secret for your web hooks.

To authorize webhooks, add the API keys and webhook secret from Stripe to your settings page (under Developers).

:warning: Adding production keys will make live payments. If you plan to test, be sure to switch to View test data mode and get pk_test and sk_test keys under Developers.

In your Stripe account settings, see:

Add these keys under the appropriate settings in Admin > Settings > Plugins.

Set up your User Groups in Discourse

When a user successfully subscribes to your Discourse application, after their credit card transaction has been processed, they are added to a User Group. By assigning users to a User Group, you can manage what your users have access to on your website. User groups are a core functionality of Discourse and this plugin does nothing with them except add and remove users from the group you associated with your Plan.

Create one or more products with plans.

Under Admin > Plugins > Subscriptions, click add a new Product. Once you have a product saved, you can add plans to it. Keep in mind that the pricing and billing intervals of plans cannot be changed once you create them. This is to avoid confusion around subscription management.

If you take a look at your Stripe Dashboard, you’ll see all those products and plans are listed. Discourse Subscriptions does not create them locally. They are created in Stripe.


Test with these credit card numbers:

  • 4242 4242 4242 4242
  • 4111 1111 1111 1111 (no authentication required)
  • 4000 0027 6000 3184 (authentication required)

For more test card numbers: https://stripe.com/docs/testing

Visit /s and enter a few test transactions.

Going Live

Once you’re ready to go live, change your API and webhook secret keys to production keys. You will need to create new products and plans in live mode.

Do be aware that if if you don’t properly configure Stripe webhooks, and recurring payments fail to process for any reason (expired credit card, etc.), users will still have access to the group . To have Stripe automatically cancel subscriptions, be sure to set your Manage failed payments settings similar to the below image and configure webhooks as described above.


  • 2021-06-02T05:00:00Z Support campaigns added
  • 2021-01-13T06:00:00Z Coupon code creation in admin panel
  • 2021-01-07T06:00:00Z Coupon code support (client only, creation required in Stripe)
  • 2020-11-02T06:00:00Z Subfolder install support
  • 2020-10-30T05:00:00Z Refund subscriptions from admin panel
  • 2020-10-29T05:00:00Z Improve anonymous user UX

TODO #pr-welcome

  • Extend rake subscriptions:import to migrate from other tools

:exclamation: If you were running this plugin prior to 2020-05-22T05:00:00Z, you may need to import subscriptions created by the plugin using the rake task rake subscriptions:import. This will pull products from Stripe, let you choose which to import, and subsequently import the related subscriptions to your site.

Steady plugin for community funding
Group membership subscriptions with profit split
ProCourse Memberships :money_with_wings:
Email drip campaign
Advertise activity in a private category (discourse-category-lockdown)
How to move Topics in Category into their own Pinned Topic inside new Categories?
Send an invite to a user but complete their profile programmatically
Changing excerpt length
Managing Subscriptions through Wordpress (Ultimate Member + Paid Memberships Pro)
How to give unpaid users limited access without making Discourse private?
Lock topics behind a "crypto" paywall
Add user to group after purchase
User can't repurchase a subscription product after canceling
Memberful opinions?
Memberful opinions?
Discourse Subscriptions + btcpayserver
2020: The Year in Review
Options to manage payments for paid Discourse communities
Using a plug-in to monetize my Discourse
ProCourse Memberships :money_with_wings:
Login required after some days of free access
Plugin to use Discourse for classified ads or as a job board?
Allow users to donate to pay hosting fees for a site
API POST for New User
ProCourse Memberships :money_with_wings:
Advertise activity in a private category (discourse-category-lockdown)
Platform integration - videos
Discourse for Membership Association Members?
Any way to accept paypal or stripe payment at signup?
Multiple paywalls with common communication hub
Looking for feedback on Discourse Subscriptons
WooCommerce Discourse Website newbie help
Switching to Discourse Subscriptions from WordPress Subscriptions
Integration with Wix.com membership to only let the paid member can access to Discourse
Please suggest a good Discourse Plugin for Membership that supports Indian Payment Gateway
User Card Directory

First off, great plugin! Are there any plans to add PayPal support? It seems that lots of people are leery about inputting credit card information and would rather use a middleman such as PayPal. Thanks for the awesome plugin!


Unfortunately not at this time. The plugin is built very heavily on the Stripe API, and PayPal’s system is very different in how it handles payments.

1 Like

Probably not too soon to add this to the OP. It’s not going to support anything but Stripe, ever. And if you want it to, you’ll need to fork and/or start from scratch and expect to spend 10-50 hours?

1 Like

I know we have some interest in adding other payment methods long-term (read: years from now), but I’m not certain what that will look like. Could be v10 of this plugin :joy: or something entirely new.


2 posts were split to a new topic: Subscriptions: Promote products on site in various places

Does this plugin support?


It looks to me that it’s you want that you just turn it on and stripe charges you more for every transaction. No support in the plugin is required.


Need help to find the nature of this - does anybody know the direction what I should check?

An error when I’m trying to edit product - from log:
NoMethodError (undefined method dig’ for #Stripe::Price:0x00007f62cfbe3b68) app/controllers/application_controller.rb:397:in block in with_resolved_locale' app/controllers/application_controller.r

In console:
Error while processing route: adminPlugins.discourse-subscriptions.products.show.plans.show _vendor-0deb3bc8a1b4fafcbbde926252433b06ecbfd556480f171032ad9996633f9b7f.js:36991:31

Uncaught Error: Internal Server Error
    t _vendor-0deb3bc8a1b4fafcbbde926252433b06ecbfd556480f171032ad9996633f9b7f.js:38573
    t _vendor-0deb3bc8a1b4fafcbbde926252433b06ecbfd556480f171032ad9996633f9b7f.js:38554
    o _vendor-0deb3bc8a1b4fafcbbde926252433b06ecbfd556480f171032ad9996633f9b7f.js:38537
    trigger _vendor-0deb3bc8a1b4fafcbbde926252433b06ecbfd556480f171032ad9996633f9b7f.js:71912
    _onError _vendor-0deb3bc8a1b4fafcbbde926252433b06ecbfd556480f171032ad9996633f9b7f.js:72771
    invoke _vendor-0deb3bc8a1b4fafcbbde926252433b06ecbfd556480f171032ad9996633f9b7f.js:66550
    flush _vendor-0deb3bc8a1b4fafcbbde926252433b06ecbfd556480f171032ad9996633f9b7f.js:66442
    flush _vendor-0deb3bc8a1b4fafcbbde926252433b06ecbfd556480f171032ad9996633f9b7f.js:66646
    _end _vendor-0deb3bc8a1b4fafcbbde926252433b06ecbfd556480f171032ad9996633f9b7f.js:67222
    end _vendor-0deb3bc8a1b4fafcbbde926252433b06ecbfd556480f171032ad9996633f9b7f.js:66908
    _run _vendor-0deb3bc8a1b4fafcbbde926252433b06ecbfd556480f171032ad9996633f9b7f.js:67277
    run _vendor-0deb3bc8a1b4fafcbbde926252433b06ecbfd556480f171032ad9996633f9b7f.js:66957
    c _vendor-0deb3bc8a1b4fafcbbde926252433b06ecbfd556480f171032ad9996633f9b7f.js:53706
    error _application-426c74bf9da334f7bd2a8c9ca7e0de37a58248388b14b1f671faa862b20285b7.js:10007
    u _vendor-0deb3bc8a1b4fafcbbde926252433b06ecbfd556480f171032ad9996633f9b7f.js:3510
    fireWith _vendor-0deb3bc8a1b4fafcbbde926252433b06ecbfd556480f171032ad9996633f9b7f.js:3640
    O _vendor-0deb3bc8a1b4fafcbbde926252433b06ecbfd556480f171032ad9996633f9b7f.js:9802
    n _vendor-0deb3bc8a1b4fafcbbde926252433b06ecbfd556480f171032ad9996633f9b7f.js:10061

Does anybody know the direction what I should check?

Thank you!

1 Like

Well, this was in my drafts…

Trying to edit a plan, I’m getting this error:

Processing by GroupsController#search as JSON
  Parameters: {"ignore_automatic"=>"true"}
Processing by DiscourseSubscriptions::Admin::PlansController#show as JSON
  Parameters: {"id"=>"price_1JiK6IJJPhIyHTniuwM6H4Ae"}
Completed 200 OK in 22ms (Views: 0.1ms | ActiveRecord: 0.0ms | Allocations: 4666)
Completed 500 Internal Server Error in 313ms (ActiveRecord: 0.0ms | Allocations: 4331)
NoMethodError (undefined method `dig' for #<Stripe::Price:0x00007f1f3926a228>)
app/controllers/application_controller.rb:397:in `block in with_resolved_locale'
app/controllers/application_controller.rb:397:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:71:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:356:in `call'
config/initializers/008-rack-cors.rb:25:in `call'
config/initializers/100-quiet_logger.rb:23:in `call'
config/initializers/100-silence_logger.rb:31:in `call'
lib/middleware/enforce_hostname.rb:23:in `call'
lib/middleware/request_tracker.rb:187:in `call'
1 Like


Can you tell me, how can i add additional currency code to the list. I could not find RUB currency code. Stripe has it.

It would need to be added to the plugin. We’re happy to review a PR to add it!

How should I go about getting someone to implement this for our site please?

@James_Higginson if you’re hosted by Discourse, email us at team@discourse.org if you’re running into issues. If you’re self hosted, someone can help you in the #marketplace category!


It’s installed like any plugin. It’s not clear what you mean by “implement”. If you mean "configure for your protected categories, you’ll need to be more clear about whether you have already set up the categories and groups and just need the plugin to add members to the group, or if you need help understanding category permissions.

As fas as i understand, i need to update the list in config/settings.yml and send a new file in the pull request to the project. Can you tell me, is this correct?

There’s a bit more to it than that. There are a number of selectors and helpers that need to be updated in the Ember side of the plugin.

1 Like

@pfaffman Did you have any success with this? Thank you!

I did not. I do believe that it’s a bug.

But I did discover that you can edit that stuff over on the Stripe dashboard, so that’s what I did.

Super! Thanks for the direction!

1 Like