#tymm
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
I'd recommend checking this guide about setting the billing cylce anchor alongside with updating the subscription item: https://stripe.com/docs/billing/subscriptions/billing-cycle
hmm looks like i'll have to update the subscription and its items separately. and stripe will create an invoice immediately after updating the subscription billing cycle
how do i revert this if the customer didnt proceed the payment?
ok i see paymentbehavior in subscription update params imma try setting that
hmm looks like i'll have to update the subscription and its items separately. and stripe will create an invoice immediately after updating the subscription billing cycle
You should be able to upgrade the subscription item and reset the billing cycle anchor in the same API request. Did you face any issue with it?
how?
isnt subscriptionitemupdate another api call?
It's possible to do at the Subscription level as well when updating the subscription item: https://stripe.com/docs/billing/subscriptions/upgrade-downgrade#changing
using additem?
isnt that actually "adding" item to existing subscription?
i want the old one to be replaced
oh ok i see the other example that says i can set them to deleted
i will try that
thanks
Have you checked the guide above? It's to update the existing subscription item.
The setId here refers to the existing subscription item to update
ah ok was confused. thanks
No problem!
how do i revert this if the customer didnt proceed the payment?
If you're looking to only update the subscription after the payment is made, I'd recommend usingpayment_behavior=pending_if_incomplete. For more details, please refer to the guide here: https://stripe.com/docs/billing/subscriptions/pending-updates
with the pending updates feature, you can make changes to subscriptions only if payment succeeds on the new invoice.
im getting When updating an existing subscription, billing_cycle_anchor must be either unset, 'now', or 'unchanged'; request-id: req_qeHvbUg9M7ExKG
if setting a date is not possible, how to i make sure that the payable amount that the customer sees in upcoming invoice tallies with the actual subscription update itself?
Upcoming invoice API only supports now and unchanged on existing subscription: https://stripe.com/docs/api/invoices/upcoming#upcoming_invoice-subscription_billing_cycle_anchor
I'm afraid you will only be able to get the final payable amount in the Update Subscription request directly.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
now im getting When `payment_behavior` is set to `pending_if_incomplete`, you can only pass supported params. `coupon` is not supported.; request-id: req_Xwg3iN3uhgp70A
how do i implement coupon in this scenario?
Since the coupon field in the request was empty in req_Xwg3iN3uhgp70A, why did you set it?
it can be not empty
I see! Thanks for sharing the details. Here are the list of attributes supported for pending_if_complete: https://stripe.com/docs/billing/subscriptions/pending-updates-reference
Unfortunately, coupon isn't one of them. If you wish to have coupon as part of the update, pending_if_complete can't be used.
hmmm any suggestion on what should i do to implement coupon on top of the proration behavior and payment behavior we discussed earlier?
Instead of using pending_if_complete that Stripe helps to only update the subscription when payment is made, your system will have to handle this flow yourself by reverting the subscription if the customer doesn't make the payment.
So the steps will be:
- Keep track of the old subscription information
- Update subscription with new price with billing cycle anchor
- If the payment is not made successfully, revert to the old subscription setting in Step (1)
but if i do that stripe will generate a new invoice right? and it will affect the ongoing subscription? will the automatic collection still work on the next cycle etc?
Yes, Stripe will generate a new invoice and the subscription will be changed immediately. Automatic collection will still work on the next cycle depending on your subscription setting: https://dashboard.stripe.com/settings/billing/automatic
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
i mean if i update the subscription and then revert it back to how it was, so by right stripe will generate 2 invoices? one during the first update and second one during the revert update? and doesnt the customer need to pay for the second invoice again for the automatic collection to work?
i mean if i update the subscription and then revert it back to how it was, so by right stripe will generate 2 invoices? one during the first update and second one during the revert update?
Yes.
and doesnt the customer need to pay for the second invoice again for the automatic collection to work?
If reverting the subscription is confirmed, your system can:
- Void the first invoice that is created from updating the subscription
- Set the
proration_behaviortononeto create a $0 invoice (second) that customer won't be charged when reverting back to the old subscription settings: https://stripe.com/docs/api/subscriptions/update#update_subscription-proration_behavior
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ok i'll need to think about this. it seems abit too complicated to implement for what i have here. thanks.