Have you got the webhooks configured correctly? I remember these being quite curly to set up, and the instructions of how to do so could be a bit clearer.
Yeah got the webhooks setup nicely thats how the response was flowing back.
I found out the issue. The instructions are missing a point where we have to setup the custom tags with the group name to be promoted to on Stripe price config page.
Its working fine now for me. The plugin is great but documentation is not detailed.
Can you explain this just a bit more so we can have someone update the documentation? What custom tag did you add, and where did you add it?
[Guide] How to Set Up Discourse Subscriptions with Stripe Pricing Tables (and Common Pitfalls)
Hello everyone,
After a lengthy troubleshooting process, I wanted to share a definitive guide for setting up the official discourse-subscriptions
plugin using the modern Stripe Pricing Table method. This approach is powerful but has a few critical steps that are not immediately obvious and can lead to errors like failing webhooks (404 Not Found
) or users not being added to groups after a successful payment.
Here is the step-by-step process that is confirmed to work.
Part 1: Stripe Configuration
This process uses Stripe as the âsource of truthâ for all products and prices.
1. Create Your Products and Prices
- In your Stripe Dashboard, make sure you are in Live Mode.
- Go to Products > Product catalog.
- Create your main products first (e.g., âPremium Membershipâ, âVIP Accessâ).
- Under each product, create all the associated prices (e.g.,
XX / month
,XXX / year
).
2. The CRUCIAL Metadata Step For the plugin to automatically add users to a group, you must add specific metadata to every single Price object you create. The Stripe dashboard UI can make this hard to find.
- When creating a new price (or if you can find the âEdit priceâ option), you must add metadata. You may need to click on âAdditional optionsâ during price creation to reveal the metadata fields.
- Click + Add metadata and enter the following:
- KEY:
group_name
- VALUE: The groupâs unique, URL-safe slug/handle from Discourse, not its full name.
- KEY:
Example:
- If your Discourse groupâs full name is âEnclave Plusâ, its slug is likely
EnclavePlus
.- You must use
EnclavePlus
as the value. Using"Enclave Plus"
with a space will fail.
- You must repeat this for every price plan you want to link to a group.
3. Create Your Stripe Pricing Table
- Go to Products > Pricing tables.
- Create a new table and add the Prices you just configured.
- After publishing the table, click the âCopy codeâ button to get your Pricing table ID (it starts with
prctbl_...
).
4. Configure the Webhook Endpoint (The 404
Error Fix) This is the most common point of failure.
- Go to Developers > Webhooks and click + Add endpoint.
- The Endpoint URL must be in the following format:
https://your-discourse-site.com/s/hooks
Note: The correct path is/s/hooks
, not/s/stripe/webhook
. - For Events to send, add at a minimum:
checkout.session.completed
customer.subscription.deleted
- Create the endpoint and copy the Signing secret (it starts with
whsec_...
).
Part 2: Discourse Configuration
Now, letâs configure the plugin to use everything you set up in Stripe.
1. Enter API Keys and Pricing Table ID
- Go to
Admin > Settings
and search fordiscourse subscriptions
. - Fill in your live Stripe keys:
discourse subscriptions public key
(pk_live_...
)discourse subscriptions secret key
(sk_live_...
)discourse subscriptions webhook secret
(whsec_...
)
- Enable the pricing table mode:
- Check the box for
discourse subscriptions pricing table enabled
. - Paste your
prctbl_...
ID into thediscourse subscriptions pricing table id
field.
- Check the box for
2. Link Stripe Products to Discourse Groups Even with a pricing table, you need to tell Discourse which group belongs to which product.
- Go to
Admin > Plugins > Subscriptions
and click the Products tab. - Click Create New Product.
- Enter a Product Name that exactly matches the Product Name in Stripe (e.g.,
Enclave Plus
). - Save the product. On the productâs page, scroll down and click Add New Plan.
- This plan is just a âbridgeâ. The only critical field is User Group.
- Plan Nickname:
Enclave Plus Group Link
(or anything for your reference). - User Group: Select the correct Discourse group from the dropdown.
- The other fields (Amount, Interval) can be left as default, as they will be ignored.
- Plan Nickname:
- Save the plan. Repeat this for all your different products.
Troubleshooting Summary
- Problem: Webhooks are failing with a
404 Not Found
error.- Solution: Your Endpoint URL in Stripe is wrong. It must be
https://your-discourse-site.com/s/hooks
.
- Solution: Your Endpoint URL in Stripe is wrong. It must be
- Problem: The webhook is successful (
200 OK
) and the payment appears in the userâs billing profile, but they are not added to the group.- Solution: Your metadata is incorrect. Check three things:
- The metadata must be on the Stripe Price object, not the Product object.
- The metadata KEY must be exactly
group_name
. - The metadata VALUE must be the groupâs unique slug/handle (e.g.,
EnclavePlus
), not its full name with spaces.
- Solution: Your metadata is incorrect. Check three things:
I hope this guide saves others the time and frustration of this complex but very powerful setup.
I just tested this out and it was perfect! We will go ahead and update the original documentation to include this!