# Add user to group after purchase

**URL:** https://meta.discourse.org/t/add-user-to-group-after-purchase/191048
**Category:** Support
**Created:** [May 20, 2021, 9:17am UTC](https://meta.discourse.org/t/add-user-to-group-after-purchase/191048 "2021-05-20T09:17:57Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![juanr](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/juanr/32/221338_2.png) [@juanr](https://meta.discourse.org/u/juanr)
#### Post date: [May 20, 2021, 9:17am UTC](https://meta.discourse.org/t/add-user-to-group-after-purchase/191048/1 "2021-05-20T09:17:57Z")

</div>

Hi!

So I am building an online course and after someone buys the course I would like to either:

1. add them to a private group in Discourse if they have already registered with the same email OR
2. create an account for them, or send them an email to register and automatically join the group

I haven’t found a good way to do that yet! The best way I can think of is creating an invite link for that group, but that could easily be shared and the users that already registered could not use it

Any ideas? I looked into Zapier and Integromat integrations but did not see anything useful

---

<div class="post-metadata">

### Author: ![hawm](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hawm](https://meta.discourse.org/u/hawm)
#### Post date: [May 20, 2021, 9:27am UTC](https://meta.discourse.org/t/add-user-to-group-after-purchase/191048/2 "2021-05-20T09:27:30Z")

</div>

It depends on what platform you are selling your course and the purchase workflow.

---

<div class="post-metadata">

### Author: ![juanr](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/juanr/32/221338_2.png) [@juanr](https://meta.discourse.org/u/juanr)
#### Post date: [May 20, 2021, 9:33am UTC](https://meta.discourse.org/t/add-user-to-group-after-purchase/191048/3 "2021-05-20T09:33:45Z")

</div>

I am planning to use Kajabi. But still open to use another one if it’s needed

Kajabi has new purchase integrations for both Zapier and Integromat if that helps!

---

<div class="post-metadata">

### Author: ![hawm](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hawm](https://meta.discourse.org/u/hawm)
#### Post date: [May 20, 2021, 9:50am UTC](https://meta.discourse.org/t/add-user-to-group-after-purchase/191048/4 "2021-05-20T09:50:22Z")

</div>

Here a guide for Zapier integrated.

> [@Make requests to the Discourse API with Zapier](https://meta.discourse.org/t/how-to-make-requests-to-the-discourse-api-with-zapier/122126#add-user-to-group):
>
> Requests to the Discourse API can be automated by creating a Zap that uses a Zapier Webhook as its action step. This topic will describe how to perform requests for the following actions: add user to group grant a custom badge To figure out how to perform other types of API requests with Zapier, read through the topic and then search the [Discourse API docs](https://docs.discourse.org/) for the action you are wanting to perform. You can also find how to create an API request for a specific action by reading [Reverse engi…](https://meta.discourse.org/t/how-to-reverse-engineer-the-discourse-api/20576)

And I think there also another solution for Integromat.

---

<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: [May 20, 2021, 1:02pm UTC](https://meta.discourse.org/t/add-user-to-group-after-purchase/191048/5 "2021-05-20T13:02:59Z")

</div>

I recommend [Discourse Subscriptions](https://meta.discourse.org/t/discourse-subscriptions/140818). Oh, but now that I’m paying attention, you have some other system in place…

A custom api call from the other system or [discourse connect](https://meta.discourse.org/t/13045?silent=true) are probably what you’re looking for.

---

<div class="post-metadata">

### Author: ![juanr](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/juanr/32/221338_2.png) [@juanr](https://meta.discourse.org/u/juanr)
#### Post date: [July 8, 2021, 12:10pm UTC](https://meta.discourse.org/t/add-user-to-group-after-purchase/191048/6 "2021-07-08T12:10:57Z")

</div>

Sounds great, but the only integration is create new post 😢

---

<div class="post-metadata">

### Author: ![juanr](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/juanr/32/221338_2.png) [@juanr](https://meta.discourse.org/u/juanr)
#### Post date: [July 8, 2021, 12:11pm UTC](https://meta.discourse.org/t/add-user-to-group-after-purchase/191048/7 "2021-07-08T12:11:48Z")

</div>

Yep it seems that a custom api call will be the only way!

Do you know any resource that can help me larn about that?

Especially taking into account that they may already be registered and I would only need to add them to a group

---

<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: [July 8, 2021, 12:49pm UTC](https://meta.discourse.org/t/add-user-to-group-after-purchase/191048/8 "2021-07-08T12:49:12Z")

</div>

THe best solution would be [DiscourseConnect - Official Single-Sign-On for Discourse (sso)](https://meta.discourse.org/t/discourseconnect-official-single-sign-on-for-discourse-sso/13045).

But see [How to reverse engineer the Discourse API](https://meta.discourse.org/t/how-to-reverse-engineer-the-discourse-api/20576) and maybe [Beginner’s Guide to Creating Discourse Plugins Part 1: Creating a basic plugin](https://meta.discourse.org/t/beginners-guide-to-creating-discourse-plugins-part-1-creating-a-basic-plugin/30515)
