#thebobdresseur_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/1481636838698647552
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there!
hello ๐
Hello! I'm taking over for soma who had to step away, please give me a moment to catch up ๐
hi !
I see this is the last invoice on the subscription: https://dashboard.stripe.com/acct_1Dr81JHMOWEObXZm/test/invoices/in_1TA7AaHMOWEObXZml2EMYZC8
Is the second line item for โฌ80.00 what you mean by "a full month price for item B"? We cannot change an existing invoice. With this in mind, what do you want to see on the next invoice?
I'd like next invoice to have :
- item A
- item B prorate for the 15th to 5th period
- item B prorate for the 5th to 15th period
Even though the last invoice charged a full month for item B? Which I assume was the item for โฌ80.00?
the last invoice charged a full month for item A
Can you clarify the price ID for item A and B?
item A : si_U8Nwb1scvBrqfa
item B : si_U8NyrjfW2XCMkU
the timeline here is not the same as the one mentioned in my use case
is what I'm trying to do clear enough ?
Sorry for the delay! I was juggling a few threads. Do I understand correctly that you want to add item B partway through the billing cycle so the full month charge is split accross two invoices?
exactly, the main reason is to have everything on the same invoice for the customer
I see you tried to update the subscription with a proration_date in the future which failed: https://dashboard.stripe.com/acct_1Dr81JHMOWEObXZm/test/logs/req_G3rZyUn4H5DRLe
Was this related to what you're trying to achieve? You can read more about what proration_date is meant for here: https://docs.stripe.com/api/subscriptions/update#update_subscription-proration_date
yes but i was not successful, this is why I'm here now ๐
Thanks for your patience, I think I finally see the issue!
When you add an item to a subscription, it should generate a proration for the remainder of the current billing period then include the full charge on the next invoice. But you only want this item to be part of the subscription once. You could remove it from the subscription in the next billing period, but let me quickly search for if there's a better solution.
Is there a reason you aren't using a one-time payment for item B?
it is an upsell in our product, also billed monthly
But you only want to charge them for a single month, right?
Oh, so your billing cycles should look like this which is what you already see, no?
- full amount for item A, partial amount for item B
- full amount for items A and B
Then, whenever they deactivate the upsell, you'll remove item B from the subscription and there will be a proration to ensure they aren't charged for item B for the remainder of that billing period.
yes but here is the twist : if user activate and deactivate before next billing period, I still want him to pay for a full month. So I have a cron delaying item B deletion to activationDate + 1 month, but in between the user will be charged for a full month
Gotcha. So in that case, you're doing the right thing. Upon deleting item B, the invoice will be updated with a credit proration for the unused portion of that item. Exactly how the credit is calculated depends on the billing mode: https://docs.stripe.com/billing/subscriptions/billing-mode
Yes but the user is first billed with a full month because deletion happens aftewards. The prorate is applied to the next invoice but it would cleaner if the user is only billed with a prorate as he already requested the upsell deactivation
I see, I was thinking we billed at the end of the period but we actually bill at the start - my mistake! This means they're being charged for a full month then being credited in the following invoice, but you want them to be charged the correct amount in the previous invoice.
Unfortunately, our prorations do not support this. If you need it, you'll have to set proration_behaviour: none and add/remove invoice items yourself.
ok I see !
In this case, you can delete item B as soon as the user deactivates then use add_invoice_items to ensure it's still being billed for: https://docs.stripe.com/api/subscriptions/update#update_subscription-add_invoice_items
got it thanks !