#regisin
1 messages · Page 1 of 1 (latest)
Hi there, what event are you listening to?
invoice.payment_succeeded
OK. So that's an invoice event, so you'll get the invoice object.
You should use the subscription of this invoice to retrieve the subscription object, from there you can find the price list from items (https://stripe.com/docs/api/subscriptions/object#subscription_object-items)
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Why is the price a list? In what situation would a subscription have more than one item in the list?
You can add more than one price to a subscription.
Like the same tier having multiple prices? Or a single user's subscription having more prices as they moive up/down the tiers?
I'm just trying to understand... I know how subscriptions work for me as a consumer, not as a service/business
Stripe provide the flexibility to let user add multiiple prices in a subscription. You don't need to use it if your business doesn't require it.
https://stripe.com/docs/api/subscriptions/object#subscription_object-items-data-price-tiers So here's how you get the tiers info from price. remember to expand the tiers field.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
https://stripe.com/docs/api/expanding_objects you can read here to learn more about response expansion.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
So if the customer updates to a different plan, does that add a new price to the subscription list of items? Or does it just update the one single item in that list?
Another question. If I create a free tier, can I create a product with price zero? Then when a user registers on my website, I assign the free subscription by default. Would that incur any charges for me to pay?
It depends on how you update the subscription. You can change the price, quality, or add a new price (https://stripe.com/docs/billing/subscriptions/upgrade-downgrade)
What do you mean by free tier?
Well, my thinking is to create the user with a free plan, and redirect them to the stripe billing portal so they can manage their subscription. When they update their subscription, does it trigger an event I could listen for on my webhook?
I use tier as plan (or product) here.
and "free" basically means "no plan"
OK, so no plan = no subcritpion ?
they can't use my website, but can still come back in the future
no plan = subscription that costs $0
OK, yes you can create zero dollar subscription.
https://stripe.com/docs/billing/subscriptions/webhooks and these are the webhook events for subscriptions