#manuel_api

1 messages · Page 1 of 1 (latest)

abstract plankBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1442604032777654455

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

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.

potent kettle
#

I also see that when payments are made, a new customer is created. Is there a way to prevent this from happening?

snow isle
potent kettle
potent kettle
snow isle
#

For subscription, Stripe will always create a new customer if customer parameter isn't set. client_reference_id is only for your own reference and it's not used by Stripe

#

I was using this method before, but when this change was made, it was done directly to the subscription in Stripe without depending on a successful or failed payment.
Do you mean that you'd like to only upgrade the subscription when the payment is successful? If so, I'd recommend using pending updates alongside the upgrade guide I shared: https://docs.stripe.com/billing/subscriptions/pending-updates
with the pending updates feature, you can make changes to subscriptions only if payment succeeds on the new invoice.

Apply subscription updates conditionally based on payment success using pending updates for card and Link payment methods with charge automatically.

potent kettle
#

so i have to user the .modify() always for upgrades or downgrades because the checkouts sessions will always create a new customer with a new subscrption?

snow isle
#

Yes, that's right! To upgrade or downgrade existing subscription, Update Subscription API should be used

potent kettle
#

oh ok, thanks!

snow isle
#

No problem! Happy to help 😄

potent kettle
#

And to prevent the subscription from being modified before a payment, do I need to change a parameter? I'm sorry, I didn't quite understand that last part

snow isle
#

Yes! With payment_behavior: 'pending_if_incomplete', the subscription will only be updated to the new price after the payment is successful.

potent kettle
#

nice!

#

I understand now, and while this is happening, I imagine that the subscription status remains as “incomplete,” correct?

What if the payment fails? Is it okay if I cancel the invoice and the payment_intent?

snow isle
#

When payment_behavior: 'pending_if_incomplete' is used on existing active subscription, the subscription will remain active with the old price

#

If the payment is failed, the subscription will still remain active with the old price

potent kettle
#

ok nice, thank you!