#derbytau_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/1425810016216158340
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
👋 Hi there! Let me take a look
Let me try this. Meanwhile, can you share the snippet where you're sending an empty list?
this is my python test script snipped:
invoice = stripe.Invoice.modify(
"in_1SGHmsBAY54yJ2Y0lceIUO8T",
default_tax_rates=[],
)
in our business application this is a bit more tricky due to its layers, this is one layer part:
const params: Stripe.InvoiceUpdateParams = {};
const { invoiceId, footer, usesSmallBusinessClause } = options;
let invoiceFooter = "";
if (usesSmallBusinessClause) {
invoiceFooter = (footer ? footer + "\n\n" : "") + "Gemäß § 19 UStG wird keine Umsatzsteuer berechnet.";
}
params.footer = invoiceFooter;
params.default_tax_rates = [];
return this.stripeProxy.updateInvoice(invoiceId, params);
and this is the function of the stripeProxy class:
public updateInvoice(
id: string,
params: Stripe.InvoiceUpdateParams,
): ReturnType<typeof this.stripe.invoices.update> {
return this.stripe.invoices.update(id, params);
}
and the member stripe is from:
this.stripe = new Stripe(API_KEY);
so i think the better example is the python snipped 😅
Thanks. Can you share a request where you set default_tax_rates="" (i.e. to an empty string), as that should work?
this is from the python script: req_hmlQ2xcU95Bn4t
and this is in the business application: req_P4wzsIDdpyqNhl
while looking at this I see it indeed worked in the python script but not in our business application.
the request body shows up, but did not remove the tax_rates while in the python script it indeed removed the tax rates
I see in both cases that default_tax_rates are now an empty list
But are you referring to tax_rates on individual line items?
maybe. By removing the first default_tax_rates the tax rates from the line items where removed to, while this did not happen with the second invoice.
So maybe this confused me
Yeah, I believe in the second case the tax rates came from the subscription schedule which explicitly set the tax_rate: req_5wajIF4904Ki1e
is there a simple way to remove the tax_rates from all invoice items afterwards? The problem is, that during subscription schedule creation we cant be sure the tax rates must apply. So in some cases we need to remove the tax rates before the invoice is finalized and we cant be sure before invoice creation
of cause not for this invoice because it is already finalized, but for future invoices before finalization
I believe you'd have to iterate over the items in the invoice and set tax_rate: ""
ok. A solution with less api calls would have been great but I can adjust the code to iterate over the items. Thanks for the help and the info that the removal of default_tax_rates indeed worked and my true problem was the tax rate of the invoice items
hey there, taking over from my colleague - please let me know if you have any follow-up questions
hey, changing to updating all invoice items and testing this, will take a while so, thanks but im good to go. If this is not working for some reason I will open another case but for now im happy thanks