#paulc7053_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/1333363864296755240
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
If a user wishes to upgrade, I want to charge them instantly with the difference betweeen the subscription prices (no proration). if they downgrade, I change the subscription price for the next billing cycle. if they are still in trial, I just want to change the subscription price, because I assume it will be charged the new price when it becomes active
what do you think?
I want to charge them instantly with the difference betweeen the subscription prices (no proration)
why no prorations? that doesn't really make sense. it means the user would be loosing money?
I'm confused by your code. why are you creating an Invoice? the Subscription should create the Invoice for you.
I recommend reading thsi guide: https://docs.stripe.com/billing/subscriptions/upgrade-downgrade
to trigger an immediate payment, use: proration_behavior: always_invoice. but it's true this will create prorations. thinking...
thanks! please let me know when you figure it out
can you try proration_behavior: none and subscription_billing_cycle_anchor: "now"?
yes
but does subscription_billing_cycle_anchor not change the date when the subscription should renew?
as in, if a user upgrades today but they started their subscription 3 weeks ago, doesn't subscription_billing_cycle_anchor: "now" move their rebill date to today?
true, is that an issue?
today + period **
yes... as it's an yearly subscription and moving the rebill time can be really problematic
how would you solve this?
not sure, thinking
alright
hello
Hi! I'm taking over from my colleague. Please, give me a moment to catch up.
To clarify:
- A user upgrades their subscription from a cheeper option to a more expensive one, in the middle of the billing cycle.
- They already paid for the cheeper one this
monthyear. - After upgrade, they will be paying for the expensive one from next
monthyear. - At the moment of the upgrade, you want to charge them the difference in price, correct?
... as if they paid for the expensive one from the beginning of this month year, right?
- it's a yearly subsciption - after upgrade, they immediately pay the difference, and the upgraded price the next billing cycle
basically I just want the subsciption reBill date unchanged, while the customer is immediately charged the difference in price
I understand.
There's no way to implement it out of the box. Instead, you have to:
- Upgrade the Subscription with
proration_behavior=none, and - Create a standalone Invoice with the difference of the amounts.
What do you mean by "not charged"?
the customer's card is not being charged and no payment successful event is being sent
What happens to the Invoice?
You should see it in your Dashboard and be able to investigate what's the issue.
okay, I;ll look it up right now
It should charge the customer the difference of the amounts, no?
yes
I think your Invoice total amount is 0, because the InvoiceItem is not attached to the Invoice. This is because you create the InvoiceItem before creating the Invoice. You should instead create the Invoice first, and then create the Item with the Invoice ID: https://docs.stripe.com/api/invoiceitems/create#create_invoiceitem-invoice
it's possible, I cant seem to vind any invoice with this amount in the dashboard
1 minute please, trying right now
basically create a draft invoice and then attach it
Yes, this looks better.
Does it work?
I'm testing it right now
2 minutes please
doesn't work....
the thing is I don't see any invoice under the invoices tab
I mean any invoice that should correspond to the charge
Could you please share the Invoice ID?
When you create it, you can print the ID or the whole object into console.
Are you looking at the correct account?
yeah, I only have this one
What happens if you search by ID?
You are connected with what Stripe Account Id?
where can I see the account ID
acct_1NlxwiJ4ILijjURS
It starts with acct_
I get see it now
now it also appears under all invoices (which is weird because I refreshed that page multipe times)
may I ask why is it open?
as I would expect it to be paid
You have to either send a request to pay it: https://docs.stripe.com/api/invoices/pay
Or set auto_advance=true https://docs.stripe.com/api/invoices/create#create_invoice-auto_advance
within the dashboard, it still looks as open, and it says "Payment will be retried 1/30/26, 5:05 PM. If the original failure was non-retryable, the payment will only be executed if the payment method is updated."
I used the 4242... test card
the ID is in_1QlqInJ4ILijjURSru4jeQFN
You have created the invoice with auto_advance false, which means you need to pay the invoice manually. You need to call one of these endpoints