#yashesh-Invoice

1 messages · Page 1 of 1 (latest)

cinder tinsel
ocean cobalt
#

req_tc9GX8cChI6gZf @cinder tinsel

cinder tinsel
#

Thank you, taking a look on my end

ocean cobalt
#

To ensure I understnad the problem, the issue occurs because the amount is 67.5 cents? If it was 67 cents, I could keep using unit_amount?

cinder tinsel
#

Let me test this real quick on my end

ocean cobalt
#

my input was -67 cents and I am using unit_amount . if that helps

cinder tinsel
#

I was able to test this, and can confirm that passing the following, does create the above invoice line item

amount: '-67',
currency: 'usd'
#

Testing 'unit_amount' now

#

That seems to be working as expected.

#

Closely looking at the request id you've shared

#

On your request, price_data was used

#

When it's nested like that, a positive integer in cents (or 0 for a free price) representing how much to charge.

#

Could you try this and see if it's working as expected on your end?

ocean cobalt
#

thanks for digging deeper. will update you shortly

#

ok it created the line item now but its not reflected on the invoice @cinder tinsel in_1LQJxKGzezc5sNyI5gcfF5BX

cinder tinsel
#

Did you create the invoice line item for that customer?

ocean cobalt
#

yup same customer-id

#

line item id that doesn't show up: ii_1LQJxJGzezc5sNyIyUukrYXO
another line item for the same customer that shows up in the invoice ii_1LQJxIGzezc5sNyInqmx5DEP

cinder tinsel
#

Yep, on that invoice, there is only one invoice item

ocean cobalt
#

for what its worth, the line that shows up was created using price/product object embedded in the line item. the line item that does not show up was created without any nesting

cinder tinsel
#

give me a couple of minutes please

ocean cobalt
#

no problem at all

cinder tinsel
#

For the customer, cus_M2JaRvyNXvAcH7 I still see pending Invoice Line items. So you'd want to create an invoice now for the customer and it will show all of the pending items you've created.

ocean cobalt
#

just created a new invoice for that customer in_1LQKM0Gzezc5sNyIml7ON0c6
same problem

cinder tinsel
ocean cobalt
#

that should not be necessary. Documentation says

include_and_require if the parameter is omitted.```
sharp kindle
#

Hello! Taking over and catching up...

ocean cobalt
#

cool .. thanks @sharp kindle . pls let me know the next steps

sharp kindle
#

At first glance this is a bit of a mystery, but I also notice you're making these requests pretty rapidly. Can you insert a small delay of a few seconds between creating the negative Invoice Item and creating the Invoice and see if that makes any difference?

sharp kindle
#

Ah, we were able to reproduce the issue, and it looks like the issue is that the negative Invoice Item has no tax info associated with it, and you're enabling automatic tax on the Invoice, so that Invoice Item doesn't get pulled in.

ocean cobalt
#

Phew!! Thanks for figuring that out 👍
How do I get around this? This line item is supposed to be a credit the customer already has with us. Can this be excluded from taxes?

sharp kindle
ocean cobalt
sharp kindle
#

I would recommend investigating Customer credits before looking into credit notes.

ocean cobalt
#

I can give this a shot. Couple of questions @sharp kindle:

  1. when we issue a credit, does it show up on the invoice once it is finalized? It needs to show up as an explicit line item (like a discount for instance)
  2. The amount due in the finalized invoice is reduced by the number of credits applied right? And the reduced amount is taxed for the customer I hope?
quasi bramble
#

Hey, stepping in for Rubeus

#

gimme a few minutes

#
  1. Testing on Dashboard I think yes you have the option to display it as an explicit line item
#
  1. I think so yes, you can test on Test mode to be sure!
#

I tested it with 3000(10% inclusive tax, so it's 2727 + 273), then issued a credit note for 1000(also 909 + 91) So final adjusted amount is 2000 (3000 inclusive - 1000 inclusive)