captain_cold.
captain_cold.3mo ago

How to create multiple subscriptions with Lemon Squeezy in Buildship?

I've two subscriptions in the same store, one is monthly & one is yearly. I've created two products for each subscription. Now depending on which subscription user creates, I want to update it in my database. But in buildship, there's no option to select product. There's only one Events trigger which is "subscription created". How can I update depending upon which product is purchased by the user. Please help
Solution:
Hey @captain_cold., for the use case you mentioned with two products in the same store with monthly and yearly subscriptions, the subscription created event in the Lemon Squeezy trigger should suffice. Here’s some insight on how you can handle the differenciation between the subscriptions for the two products. If you look at the Lemon Squeezy documentation, the subscription object is the payload which would be returned every time a subscription is created. As per the docs, the payload would have a product_id property which would specify the product. You can use the switch or the branch nodes to handle the cases for different product depending upon your use case....
Jump to solution
3 Replies
Gaurav Chadha
Gaurav Chadha3mo ago
cc @Bhavya can you help here? Maybe we need to update the Trigger to have product selection in case of multiple subscription in the same store, or it can be done with the current version?
Solution
Bhavya
Bhavya3mo ago
Hey @captain_cold., for the use case you mentioned with two products in the same store with monthly and yearly subscriptions, the subscription created event in the Lemon Squeezy trigger should suffice. Here’s some insight on how you can handle the differenciation between the subscriptions for the two products. If you look at the Lemon Squeezy documentation, the subscription object is the payload which would be returned every time a subscription is created. As per the docs, the payload would have a product_id property which would specify the product. You can use the switch or the branch nodes to handle the cases for different product depending upon your use case.
captain_cold.
captain_cold.3mo ago
@Bhavya can you please explain how can I use that product_id property in buildship workflow to update my database? I'm currently using default lemon squeezy template inside Buildship. What changes do I have to make to this template? (I'm no code Flutterflow developer)