#nukesforbreakfast_best-practices
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/1415560774478463037
đ 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.
- nukesforbreakfast_subscription-credits-prorations, 5 hours ago, 38 messages
- rcc_schedule-update, 8 hours ago, 84 messages
- nukesforbreakfast_api, 21 hours ago, 33 messages
- nukesforbreakfast_best-practices, 1 day ago, 30 messages
- nukesforbreakfast_api, 5 days ago, 11 messages
Hello! Do give me some time to look into this!
I just tested it and it does.
so this is an issue for me that I need to understand how to work around.
In my use case, 1 customer can manage N locations, where each location gets separate sets of one off invoices and/or a subscription tied to it.
For the one off invoices, I was planning on creating pending invoice items for the customer with metadata identifying which location they were for, and then at the next billing run creating a draft invoice for each location, attaching those invoice items to those draft invoices based on their location metadata, and then finalizing them to send_invoice for collection.
However, it appears that if a subscription is set to cancel at the end of a period, this would collect those pending items into one invoice, even if I only was cancelling the subscription for one location and not the other.
Is there a different way to cancel a subscription such that pending invoice items don't get added to a final invoice?
However, it appears that if a subscription is set to cancel at the end of a period, this would collect those pending items into one invoice, even if I only was cancelling the subscription for one location and not the other.
Just trying to understand the above, are you talking about one Subscription shared among multiple locations, or each location has their own Subscription to the same product & price
each location has their own subscription, with the same product/price
but the issue is intermixed are additional one off invoice items/invoices for incidental charges during the subscription that could be sitting there as pending.
Is there a reason for using one-time Invoices rather than relying on the Subscription's automatically generated Invoices?
Yes, because the subscription interval may be only yearly, but I'm billing monthly for any incidental charges. And not all locations will need a subscription. I'm modeling permit fees as the subscription only if those permit fees have a renewal fee every year. Some jurisdictions only charge the permit fee once and it's good for as long as the ownership of the location doesn't change.
In that case there would be no subscription and a single one off permit fee charge. Then additional one off invoices as incidents occur.
If stripe's usage based billing modeling was advanced enough to support my complex use case, I would've used that instead.
but it doesn't support increasing fine schedules aggregated over a lookback period.
so I have to do it manually with one off invoicing.
Have you taken a look at Mixed Interval Subscriptions?
You can include multiple subscription items with different prices and billing periods on a single subscription
Unless the incidental charges are one-off (i.e. not invoiced in a monthly interval)
Also, could you send me the Subscription ID and Invoice ID that you tried? It will be helpful in my investigation
one second
I'm using one off charges here. I think the only way this would work for me is:
- I create a monthly subscription interval for a $0 price so the subscription invoice picks up any pending one-off invoice items
- I would have to change the model to 1 customer per 1 location in Stripe, even if 1 customer can manage N locations in the app.
sub_1S61n3BJYPPkaabsUqmZkp54
in_1S61n4BJYPPkaabsap69QljU
in_1S62gGBJYPPkaabsNumuomXY
sub_1S62ntBJYPPkaabsAwmkGXu2
in_1S62nuBJYPPkaabszta1olkP
sub_1S62sZBJYPPkaabsr5zLDsyG
in_1S62saBJYPPkaabszpeQwuAR
You mentioned that you tried creating a one-time Invoice, could you send me that Invoice?
one off invoice item, not invoice
that item for $100 should be attached to in_1S62gGBJYPPkaabsNumuomXY
I see, thanks for the correction!
It seems what I'm running into now is that there seems to be many cases where a subscription invoice automatically picks up pending invoice items.
I don't foresee the need for mid cycle prorations on subscriptions for my use case, which would be the reason for wanting to pick up pending invoice items on subscription created invoices. Is there a way to specify for a subscription created invoice to never pick up pending invoice items?
Hang on, on looking at your Subscription sub_1S61n3BJYPPkaabsUqmZkp54 i see that you created a Subscription schedule initially and then used the Subscription Update API to update it, was this intended?
yes, I had a test fixture already built to rapidly generate subscription schedules, so I used that and then released the subscription from the schedule immediately to quickly set up the test scenario.
I'll ultimately end up using subscription schedules because the renewable permit fees would be something like $50 initial fee for the first year, $25 every year thereafter. But for this test case it doesn't matter (I think) as the behavior would be the same for the cancellation case. If I needed to cancel a subscription, I would release the subscription from the schedule and then either:
- cancel the subscription
- update the subscription to cancel at cycle end
Ok, taking a step back here.
Looking at your initial question of creating Invoice line items for multiple Subscriptions tied to one Customer, which was done in this request.
When you created an Invoice Item, the item is tied to the Customer cus_T25zkUWWUZNsI3 , as a result, the Invoice Item is added to both Subscription's Invoices
I would have to change the model to 1 customer per 1 location in Stripe, even if 1 customer can manage N locations in the app.
What you suggested here would prevent that from happening, where you have 1 Customer specific to one location and each have their own Subscription. So i would recommend doing that, as it removes a level of complexity as well
but that causes the issue of now there's friction with the customer portal
as there are two separate stripe customers per location, even if the same person is managing both.
so they lose the ability to see all open invoices across all locations at once.
in the Stripe customer portal that is.
Taking a few steps back, when you were using 1 Customer to multiple Subscriptions, and then creating an Invoice Item
In the request to create an Invoice Item, you will have to add the subscription parameter and specify the particular Subscription ID
the resulting payload should look something like this
{
customer: "cus_xxx",
subscription: "sub_xxx",
price_data: {
currency: "usd",
product: "prod_xxx",
unit_amount: 1000,
},
}
what does that do?
it adds that Invoice Item to that particular Customer only to that specific Subscription
interesting
And it wont get add to the other Subscriptions
ok, my next question is this then:
is it possible to have a subscription with a monthly interval item with price $0? This would be there solely to generate a monthly invoice to capture pending invoice items for that subscription.
I ask because there are cases like I said where the permit fee would be a one-time charge, so I would normally model that as a location with no subscription. However, if I can generate a $0 monthly subscription and tie all one-off invoice items to that subscription, I can automate the creation of invoices on a monthly cadence without needing to manually create one-off invoices for that location.
I also noticed this field on a subscription, which might accomplish the same thing: https://docs.stripe.com/api/subscriptions/create#create_subscription-pending_invoice_item_interval
interesting. It looks like I can create a subscription for a $0 invoice item.
so for non-renewing locations I could create a long interval $0 price subscription, and then set pending_invoice_item_interval to monthly. I could then use the subscription argument to create one off invoice items for any incidental charges, and those would then get automatically get invoices generated on the pending invoice item interval.
for renewing locations, I could do the subscription as normal, and then set pending_invoice_item_interval to monthly as long as the subscription interval is longer than monthly, or instead just use the subscription interval if it ends up being monthly or shorter.
sub_1S64KqBJYPPkaabsLDJrEbno
Apologies, what is your question here? Why wouldnt the previous way of creating an Invoice Item work for you again?