#tymm

1 messages · Page 1 of 1 (latest)

bleak hollyBOT
#

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.

  • tymm, 2 days ago, 14 messages
  • tymm, 2 days ago, 26 messages
  • tymm, 2 days ago, 14 messages
  • tymm, 4 days ago, 5 messages
nocturne rampart
serene parcel
#

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

nocturne rampart
#

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?

serene parcel
#

isnt subscriptionitemupdate another api call?

nocturne rampart
serene parcel
#

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

nocturne rampart
#

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

serene parcel
#

ah ok was confused. thanks

nocturne rampart
#

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 using payment_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.

Learn how to handle payment failures when updating subscriptions.

serene parcel
#

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?

nocturne rampart
#

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.

serene parcel
#

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?

nocturne rampart
#

Since the coupon field in the request was empty in req_Xwg3iN3uhgp70A, why did you set it?

serene parcel
#

it can be not empty

nocturne rampart
serene parcel
#

hmmm any suggestion on what should i do to implement coupon on top of the proration behavior and payment behavior we discussed earlier?

nocturne rampart
#

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:

  1. Keep track of the old subscription information
  2. Update subscription with new price with billing cycle anchor
  3. If the payment is not made successfully, revert to the old subscription setting in Step (1)
serene parcel
#

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?

nocturne rampart
serene parcel
#

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?

nocturne rampart
#

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:

  1. Void the first invoice that is created from updating the subscription
  2. Set the proration_behavior to none to 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
serene parcel
#

ok i'll need to think about this. it seems abit too complicated to implement for what i have here. thanks.