#unmatchedplaya_api
1 messages ยท Page 1 of 1 (latest)
๐ 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/1296688025539055636
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hello! have you tried updating the subscription? https://docs.stripe.com/billing/subscriptions/upgrade-downgrade#changing
Thanks, but these need to be different subscriptions due to different pricing and so on
based on some legacy requirements
from what I could work out, this was possible through the checkout page
ah, well, then unfortunately no, they can't be done in a single transaction / request. You need to make a few requests via the API
and there's no way to re-activate a cancelled subscription?
in case of payment failure?
there's no way to re-activate a cancelled subscription
mmm.. and invoicing, is it possible to create an invoice for the pro-rata refunds of the old, and pro-rata charges for the new in a single invoice before cancellation?
how about making sure the new subscription is successful then cancelling the old one?
we don't want "sticker shock" So if the old one is $9000, new $10000, we do not want them to pay $10k and then get $9k refund. Instead $1k invoice
I'm guessing it would be possible for us to do a invoice with those numbers calculated ourselves, with the charges/refunds calculated, but I would rather leave that to the experts ๐
and we would cancel + new with no pro-rata
hrm gimme a while to think about this
thanks
one idea that I have is to use preview invoice to calculate the proration when the subscription is cancelled, then add that amount to the customer balance. When the new subscription is created, it should automatically deduct that amount from the customer balance. You need to remember to remove the amount from the customer balance when the customer abandons attempts to pay the subscription though, otherwise customers could abuse the amount in their customer balance for something else. After the new subscription is successful, you can cancel the old subscription without any refunds
honestly, i think the easier solution here might be to upgrade your systems to accommodate subscription updates instead
preview invoice : https://docs.stripe.com/api/invoices/create_preview#create_create_preview-subscription_details-cancel_at
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
thanks, i'll think about it.
Yes the main issue actually stems from the fact that we have two fees with each subscription, a company fee and per user fee. No the problem is that these need to be 2 prices on the one subscription so we do not need to manage multiple subscriptions to get these payments. Now originally I did a POC on using Stripe checkout to cancel one subscription and create another. This worked great, however the lines on the checkout screen indicate only the subscription, and no details about the price. So you would see 2 lines with the same subscription name, and 2 charges: 1 x company fee and 20 x user fee as an example. As this is not configurable, we have gone down this rabbit hole instead ๐ฌ
I wish they would just get rid of the comany fee. My life would be much easier
customer balance : https://docs.stripe.com/api/customer_balance_transactions
docs for customer balance : https://docs.stripe.com/billing/customer/balance
if you want to go down this route, you'll want to make sure you have very clear notes about what each customer balance adjustment is for. Unlike when you update the subscription directly, it's not easy to figure out what the customer balance adjustment is for without detailed notes since the object itself is not directly linked to the actual proration of the cancellation of the subscription
Thanks! Yeah not entirely sure what to do but I'll try see what I can figure out
high level steps :
- create a preview to cancel a subscription at a certain date https://docs.stripe.com/api/invoices/create_preview#create_create_preview-subscription_details-cancel_at
- check how much the proration will be from step 1
- create a customer balance transaction for the proration from cancelling the subscription https://docs.stripe.com/api/customer_balance_transactions/create
- create the new subscription - the customer balance should be applied
- after new subscription is successfully created, cancel the old subscription
Note : I would consider blocking any other payments in the meantime on this customer until they either pay or abandon attempts to pay for the new subscription. Remember to adjust the customer balance back (i.e. remove the proration amount) if customer abandons attempt to pay for the new subscription. Otherwise that's essentially "free" money for the customer.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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 haven't actually tested this out yet so i can't guarantee 100% it'll work
IS ther any way I can output this chat?
the link is always here for you to view
If the new subscription price (amount) that is going to be created will always be more than the previous subscription, there's a slightly better way to go about it. Typing it out now....
- create a preview to cancel a subscription at a certain date https://docs.stripe.com/api/invoices/create_preview#create_create_preview-subscription_details-cancel_at
- check how much the proration will be from step 1
- Create the new subscription with
payment_behavior: "default_incomplete" - Create a credit note on the new subscription's newly created invoice : https://docs.stripe.com/api/credit_notes/create for the amount you want to refund (proration for cancelled subscription). More info about credit notes : https://docs.stripe.com/billing/invoices/credit-notes
- have the customer make payment for the subscription by confirming the PaymentIntent on the frontend
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
iirc, the credit note amount can't be more than the invoice amount
ok i'll make sure to handle this
it could be a problem if you have discounts and possibly other refunds that were previously applied to the customer that are now in their customer balance. But yeah, test both suggestions out and see if either of them works