#beadle_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/1377715815461421196
π Have more to share? Add more details, code, screenshots, videos, etc. below.
# Get proration preview from Stripe
upcoming = stripe.Invoice.upcoming(
automatic_tax={"enabled": tenant.stripe_enable_automatic_tax},
customer=subscription.customer.stripe_id,
subscription=subscription.stripe_id,
subscription_details={
'items': preview_items,
'proration_date': change_at,
'default_tax_rates': service_tax_rates
},
invoice_items=add_invoice_items,
stripe_account=tenant.stripe_account_id
)
Hi! Can you share the Request ID from that test request?
Is ther request_id included in the response? I couldn't find the request id in my developer logs in my stripe account.
I didn't see a request_id in the response from my api call. I tried looking in the developer dashboard but I'm using a test account and it doesn't seem to be registering my requests in the logs (or I'm looking in the wrong place).
You can typically get it from the API like this and it should show up in your dashboard as well
https://docs.stripe.com/api/request_ids
If the call is returning successfully it should have a request ID, if it errors in certain ways that may indicate that the request wasn't sent. What is the response you are seeing at the moment?
Ok, one second while I figure out getting this id
Got it. Thanks for the help: req_oVjujEM6fQYJSp
Gotcha, thank you. Looking in to this behavior
Thanks Pompey. In the request you are looking at, my desired outcome is to not apply tax to the "delivery bin" product.
Have you tried setting to an empty array (tax_rates: []) on the item that you don't want taxed? I think that is the intended way to indicate no taxes if you have specified a default rate. Trying to test myself
Yes, I tried setting tax_rates to an empty list, null, None, zero, and an empty string π
Seems the empty list is being treated like I didn't pass anything at all. Here is a request where I explicitly passed in an empty array/list: req_3ldHXwjVMM0wJX
I am having trouble finding how to handle this, I have reached out to my colleagues and will get back with what we can find
Thanks Pompey. I really appreciate the help.
So we think that setting tax_rates per subscription item is the best way to go forward here. For not calculating tax on the deleted item we think that is expected behavior because that proration is crediting the user but I'm still confirming. To clarify, your issue is that the user wasn't credited enough because the proration only happened on the flat amount for the item?
I tried setting tax_rates explicitly on each subscription item instead of using default_tax_rates. This did fix the issue with invoice_item tax issue but created a different issue. The subscription item I'm removing doesn't get tax applied to it with this approach.
I have one of two issues depending on which approach we take:
- If I set default_tax_rates there isn't a way to add an invoice_item without it receiving the default_tax_rate passed in subscription_details
- If I explicitly pass in tax_rates for each subscription item, the subscription flagged for removal doesn't calculate tax
Ah gotcha, was just realizing that difference. That is strange that we don't apply it in one scenario but not the other. And to confirm, the end result is that the user is credited less than they should be?
Agreed.
When I use default_tax_rates the customer is being charged tax on an invoice_item that shouldn't be taxed so they are being charged more than they should be.
When I set tax_rates explicitly, the customer is not credited enough because the subscription being removed doesn't generate tax.
I can provide you with a requet_id for the second scenario if that would be helpful.
I'm going to escalate this beacause that does feel like that shouldn't be expected behavior. I'm still not seeing a way to say "don't apply the default tax rates here" so I'm trying to think of whether there is a workaround in the meantime. Consulting my colleagues further, thanks for your patience here, and we can create a ticket for me to follow up via email if you have to leave at a point
I am good without that request ID for now. Thanks for all the info
Sure thing.
I'm around for a little while longer but will let you know when I need to leave.
It does feel like passing and empty array should be how it would work.
@calm silo I think the best workaround at the moment would be to create a 0% tax rate and then make this call setting default_tax_rates to what you want the deleted item to be taxed at and set tax_rates to that 0% tax rate on the specific items that you don't want to be taxed.
Otherwise I think you'd have to make two preview calls and then later two update calls. One call with default_tax_rates set to an empty string so that no tax is applied to those updates, and one with default_tax_rates set to have the tax rate and that update changes the items that should be taxed.
Not ideal, but I think those are how to do this in the API at the moment. As mentioned I will escalte this but I can't promise if/when we would address it.
That was going to be my workaround solution so I will go with that. Will I be able to get notified if the API gets updated to accommodate this?
Yeah, we can create an email thread and I can ask a colleague to keep you updated.
Hello @calm silo, we have sent you a direct message, please check it at https://discord.com/channels/@me/1377750540770873486
- πThe message has instructions on how to open a direct support case with our Developer Support team, in order to help you more effectively.
If you can let me know when you've completed the above instructions I can grab that and send you and email to acknowledge when I've escalated and asked a colleague to follow
Done
I am having trouble finding that email, is this on the same account that your test API requests were on?
Found it, thank you!
Too many accounts π
So I will finish up filing on my side and get back to you via that email thread. Thanks again for sticking this one out, glad we were able to find a workaround of some kind