#elias117-automatic-tax
1 messages · Page 1 of 1 (latest)
Going with the error message, have you checked that each of the invoice items has a tax behavior specified?
Do you have a request ID req_123 from when this happened?
yeah I can actually say that is breaks upon creation of the invoice before I add any invoice Line items to the invoice
the status code im getting back is bad request
so I dont even have a request_id
the flow I'm following is
1.) Make an empty invoice with auto tax enabled and a customer.
2.) Create invoice Line items and add them to the invoice using the invoice.Id parameter. Each of these line items has an associated product and price with a tax_behaviour set to "exclusive"
3.) then call invoiceService.PayAsync(invoice.Id)
Now for some reason I'm getting the bad request when I try to create an empty invoice
As long as you are calling the invoice creation method and we are responding, that should have a request ID
Can you see this request in your logs? https://dashboard.stripe.com/test/logs
Thank you, looking in to it...
is there anything I'm missing?
Apologies for the delay, got busy, will circle back to this question in a moment.
ok thanks
@molten sedge looking give me a sec
@molten sedge yeah you're making the wrong sequence of events
you want InvoiceItems first
then create Invoice
ohh
ok
Just one question then. I create the invoice Items but how do i associate them with the invoice
How should the flow work?
any InvoiceItems on a Customer are pulled in, when you create an Invoice
I see the CreateInvoiceItemOptions require a customer stripe id
and when i create an invoice for a customer
all those invoiceitems associated with the same customer are added to the invoice?
What happens after an invoice is paid? And the customer later on wants to buy something else do i have to delete those old invoice items for that customer?
also if I dont want to charge tax on a product can I just leave out tax_code on product?
all those invoiceitems associated with the same customer are added to the invoice?
yes
And the customer later on wants to buy something else do i have to delete those old invoice items for that customer?
No, the InvoiceItems are pulled into the first Invoice, no "pending Invoice Items" remain on the Customer
also if I dont want to charge tax on a product can I just leave out tax_code on product?
yues
ok thanks I'm going to try it now and see what happens
I'm trying to make a discount
req_Lc5TEqPlAvLcc8
What I would like to do is make a price with a negative value so that it gets treated as a discount
{
"currency": "CAD",
"product": "prod_Khibyzb7vGyZ3T",
"tax_behavior": "exclusive",
"unit_amount": "-300"
}```
Is that the right way to do it?