#stealth_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/1469324544132124815
📝 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.
- stealth_api, 4 days ago, 23 messages
👋 Where do you add these from the dashboard?
Update subscription
Thanks. Looks like this is currently only exposed in the dashboard and on invoice PDFs, but just trying to see if there's any way to retrieve them via the SDK or otherwise, bear with me
Would it work if I add it via options.AddExtraParam
I don't think so, but worth trying to confirm. It does look like this is not currently exposed via the APIs/SDKs currently, but I see there are plans to add this, so this may become available in the future
is maybe that feature in private preview? so it can be enabled on ur side? I had additional_emails enabled a few days ago. Same story, exposed via dashboard but not API.
No, it hasn't been implemented yet unfortunately, so there is no private preview available for it
ahhh. So it can to be added to the final invoice?
Yes, they can be added directly to the invoice object itself for now
Okay. thanks.
Another question. I am trying to create invoice preview for an existing subscription.
Per my understanding, if I set ProrationBehavior=none there should be no prorations on invoice. However, I still get prorations when the quantity of item DECREASES. When the quantity of item INCREASES invoice is fine. Is that a bug or by design?
This is the ID of upcoming invoice: upcoming_in_1SxdvPKGseeR4VllxYvdFDI6
This is the body I post:
{ "automatic_tax": { "enabled": "false" }, "customer": "cus_TshBmCjYJnnAlU", "customer_details": { "address": { "country": "US" }, "tax": { "ip_address": "127.0.0.1" }, "tax_exempt": "exempt" }, "discounts": { "0": { "discount": "di_1SxAJHKGseeR4VllljiapigG" } }, "expand": { "0": "total_discount_amounts.discount.source.coupon" }, "preview_mode": "recurring", "subscription": "sub_1SuvmhKGseeR4VllTsVniJua", "subscription_details": { "items": { "0": { "id": "si_TshBmGxbRBN8Sf", "quantity": "1" }, "1": { "id": "si_Tv0Ox0GMvxfi3b", "quantity": "105" } }, "proration_behavior": "none" } }
Quantity for the item si_TshBmGxbRBN8Sf decreased from 10 to 1. Quantity of a si_Tv0Ox0GMvxfi3b increased from 20 to 105.
Response has three line items. One of them being with quantity 0 for the product for which quantity decreased. Another line for the actual quantity of 1. For the other product for which quantity increased there is only one item with the quantity of 105.
Hi there, taking over for @marble mulch as they had to step away
Give me a moment to get caught up on the thread
For the original question about custom fields, here is our documentation on it:
https://docs.stripe.com/invoicing/customize#custom-fields
It mentions that you can use the API on the Invoices directly, but it also mentions that you can set it on a customer itself
You can set custom invoice fields on the Customer object. Any custom fields you set at the customer level apply to all of the draft invoices you generate for that customer. You can always modify these inherited custom fields while the invoice is still a draft. After the invoice finalizes, you can’t update the custom fields.
So that might work for your use case
I will give it a try. Thanks
Juggling a couple of threads, but will look into the proration question as well
It does sound odd that a proration would be generated when you have ProrationBehavior=none, but I know there are some situations that do it, so looking into it
If I also reset billing cycle anchor the outcome is even more weird. 4 different items.
Looking at upcoming_in_1SxdvPKGseeR4VllxYvdFDI6, I don't see any prorations. Is there a different upcoming invoice that you can share? Right now the behavior you're describing sounds strange, it might have to do with some of the items having a zero price, which can reset the billing period
https://docs.stripe.com/billing/subscriptions/change-price#handle-zero-amount-prices-and-quantities
in a response body there are three items. One of them has quantity 0. The other one has quantity 1. And the third one has quantity 105.
Items dont have a zero price
For upcoming_in_1SxdvPKGseeR4VllxYvdFDI6, what I'm seeing is
- ili_TvUvYsSmM9xboO €0.00
- ili_TvUvzM96FAzaKV €17.50
- ili_TvUvloiAkaq1tb €52.50
Is that not what you're seeing?
Right, and that upcoming invoice doesn't have prorations from what I see. Is there a different example that you have that does have the prorations?
Ohh... Well that's what I have been asking about. Why's there a an item with 0 in this line items list? Should not it return just a final state of the items?
I am trying to understand how reducing a quantity results in two items of the same product, with one having quantity of 0
Got it. Do you have a request ID that reduced the quantity that I can look at specifically?
Thanks for the ID, looking in to it
Apologies for the delay. I am actually don't think there are prorations on that response. The descriptions are just of the product names and their totals seem to be the price times the quantity
Can you explain a bit more about what is incorrect in that response?
There's an item with quantity 0
So, I decreased quantity for an item from 10 to 1. And instead of invoice response having a single item with quantity 1, it has two - one with quantity 1 and the other one with quantity 0
Ah gotcha sorry I misread that
Looking in to this
It looks like those two items are for the two different tiers of the price. The first one is a 1 quantity item for the is for the 0 tier and the next one is quantity 0 for the paid tier, presumable because that tier starts at 5.
So that makes sense to me in isolation but you are saying it only shows you two items when increasing the price?
it is tiered pricing yeah. based on quantity + flat rate. So it may be it. I will look into it