#hiroshi nishio

1 messages ยท Page 1 of 1 (latest)

crude marlinBOT
flint pawn
#

Hi there ๐Ÿ‘‹ what part(s) of the process is unclear or are you looking for assistance/guidance with?

glass bronze
#

Yellow parts I pasted are unclear for me

flint pawn
#

Sorry, but I'm going to need more context on those, what about them is unclear?

glass bronze
#

There are several, but for example, when a user installs a slack bot, we would like to start counting the 7 days of free trial on the stripe side for that workspace id. I am not sure how to do that.

#

I can capture the timing of the user's installation on my application side. I also want users to feel free to use it, so I have to tell them about the trial period, but I don't want them to register a credit card or anything at this time.

flint pawn
#

When you're creating the user's Subscription, you can specify how long of a trial period they should be given:
https://stripe.com/docs/billing/subscriptions/trials
Doing so causes the customer to not need to immediately provide payment method details, though if they're not collected by the time the trial period ends then when the Subscription attempts to bill for the next billing period it won't be able to successfully.

glass bronze
#

Ah, so this is where I call stripe.subscriptions.create.

Can the customer id I need as an argument here be anything? For example, can it be a slack workspace id that is a string of some sort?

flint pawn
#

No, it needs to be the ID of a Customer object:
https://stripe.com/docs/api/customers/object

I would suggest starting here to get a feel for what Stripe objects are involved when working with Subscriptions, and what the general flow of Subscriptions look like.
https://stripe.com/docs/billing/subscriptions/overview

Learn how subscriptions work within Stripe.

glass bronze
#

Ah, that's right. So I have to create a customer object first?

flint pawn
#

Correct

glass bronze
#

For example, is it possible to create only one customer id for the same slack workspace id? Otherwise, we don't want to have a different customer id for the same workspace every time a user installs a bot.

devout raft
#

You can re-use customer IDs however you want as long as it makes sense for your integration

#

Generally it makes sense to make a new customer whenever you have a new person paying.