#od
1 messages · Page 1 of 1 (latest)
Hi there, so basically you just want to have a Stripe-hosted page to collect payment method from a customer, am I right?
For that, I know we can create a checkout session to redirect the user to Stripe to enter card details.
And can also create a billing portal session to allow the user to update payment info and the like.
When we create a subscription for a customer, are there any challenges we should be aware of if we remove or add a subscription item to the subscription (metered billing for all items)? What happens if a subscription item is removed from the subscription? Does the customer get charged for the usage still?
It depends on what subscription item is removed, do you have an example?
Imagine a subscription to a set of two Price objects. One price is for a product "advanced"; e.g. 0.2 USD per API request. Another price is for product "basic": e.g. 0.1 USD per API request. Suppose we decide "basic" is no longer available, but the user has made 10 API requests. If we remove the basic price from their subscription, do they still get charged for that 10?
Using this API https://stripe.com/docs/api/subscription_items/delete
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
They will still get charged unless you set the clear_usage https://stripe.com/docs/api/subscription_items/delete#delete_subscription_item-clear_usage
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
How do we know at what point they will be charged? Immediately or will their usage be charged at end of billing cycle?
https://stripe.com/docs/api/subscription_items/delete#delete_subscription_item-proration_behavior it depends on what you set to the proration_behavio
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I believe the same proration logic applies. You can test it out in test mode.
Okay thanks
If a user has a "active" subscription, I notice that on the customer portal user's are not allowed to delete their payment method. However, if a user cancels their subscription, and subsequently deletes all of their payment methods, and if positive usage has been recorded for the user's subscription, will the user be charged?
OK. I believe you are looking for this https://stripe.com/docs/billing/subscriptions/cancel#invoice-items-and-usage
Can you please explain how that answers my question?
That doc explain the behaviour of invoice items and usage when a subscription is canceled, and it also tells you to delete invoice items if you don't want to bill your customer.
If your customer doesn't have a payment method for invoices, or the current payment method can't pay an invoice. Depends on your settings, the customer may receive an email from Stripe asking them to pay the invoice.
Would it be possible to configure a usage-based subscription where if it is canceled, and if usage has been recorded for it, their payment method attached to the subscription is charged?