#tymm
1 messages · Page 1 of 1 (latest)
You can either void or mark the invoice uncollectible: https://stripe.com/docs/invoicing/overview#void, then update the subscription to the old price ID that will create a new invoice, prorate items on the invoice, and then initiate payment again.
Alternatively, I'd recommend setting payment_behavior: 'pending_if_incomplete' that the update of subscription will only happen if the payment is made: https://stripe.com/docs/billing/subscriptions/pending-updates
im getting error
You cannot update a subscription with a draft invoice from pending_update. Please finalize and then pay or void the draft invoice on this subscription before making any new updates.; request-id: req_NxjgfsZM0YFBO7
i had to do this
SubscriptionUpdateParams.builder()
.setCollectionMethod(SubscriptionUpdateParams.CollectionMethod.SEND_INVOICE)
.setDaysUntilDue(1L)
...
so that user has a chance to review the order before paying it
payment_behavior: 'pending_if_incomplete' should be set in the same request that you add the product
It shouldn't be a separate request
u mean in SubscriptionItem.Update instead of Subscription.Update?
It should be in Subscription.Update. Have you checked the guide? https://stripe.com/docs/billing/subscriptions/pending-updates
im using SubscriptionItem.update(SubscriptionItemUpdateParams.builder().setPrice(newPrice.getId()).build()) to update/ replace the item(s) in the subscription instead of the sample shown in this url
payment_behavior: 'pending_if_incomplete' can only be used Subscription Update API. You can perform the item update in Subscription Update API as well.
how do i replace subscription items using subscription update api?
i only see "add_invoice_items"
Here's the guide to update an existing subscription item: https://stripe.com/docs/billing/subscriptions/upgrade-downgrade
how do i change the proration behavior for certain item using SubscriptionUpdateParams.Item.builder()?
i dont see the option to do that
The proration behaviour is set at Subscription level with proration_behavior parameter: https://stripe.com/docs/api/subscriptions/update#update_subscription-proration_behavior
Not on the item level
i can and was using this api : https://stripe.com/docs/api/subscription_items/update#update_subscription_item-proration_behavior
i have a flow where i would want to cancel part of the subscription (reduce amount etc) but it will take effect on the next cycle.
and since we are not giving any refund on subscription cancel but giving proration on upgrades i would need to set the proration behavior for specific items accordingly
but this one gives me problem where the subscription will get stuck in past due if payment failed
What i meant is that - if you wish to use Subscription Update API, then payment_behavior can only be set at the Subscription level
If you use Subscription Line Item API, you can set payment_behavior: 'pending_if_incomplete' directly on the Subscription Line Items Update request: https://stripe.com/docs/api/subscription_items/update#update_subscription_item-payment_behavior