#yashesh-Invoice
1 messages · Page 1 of 1 (latest)
Hi, are you able to share the request id with me? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
req_tc9GX8cChI6gZf @cinder tinsel
Thank you, taking a look on my end
I see what might be the issue here. You'd need an InvoiceItem with a negative unit_amount_decimal: https://stripe.com/docs/api/invoiceitems/create#create_invoiceitem-unit_amount_decimal
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?
Let me test this real quick on my end
my input was -67 cents and I am using unit_amount . if that helps
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
the nested unit_amount was used... on my test I used: https://stripe.com/docs/api/invoiceitems/create#create_invoiceitem-unit_amount
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?
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
Did you create the invoice line item for that customer?
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
Yep, on that invoice, there is only one invoice item
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
give me a couple of minutes please
no problem at all
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.
just created a new invoice for that customer in_1LQKM0Gzezc5sNyIml7ON0c6
same problem
Could you pass this: https://stripe.com/docs/api/invoices/create#create_invoice-pending_invoice_items_behavior to include the the pending invoice items?
that should not be necessary. Documentation says
include_and_require if the parameter is omitted.```
Hello! Taking over and catching up...
cool .. thanks @sharp kindle . pls let me know the next steps
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?
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.
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?
You would need to disable automatic tax. Negative Invoice Items are not compatible: https://stripe.com/docs/api/invoices/create#create_invoice-automatic_tax-enabled
I see... disabling automatic tax is not an option for us. What would be a different way to give credits to our customers?
If I create a credit note, will the note show up on the invoice? https://stripe.com/docs/invoicing/integration/programmatic-credit-notes
Alternatively you could issue the Customer a credit: https://stripe.com/docs/invoicing/customer/balance
I would recommend investigating Customer credits before looking into credit notes.
I can give this a shot. Couple of questions @sharp kindle:
- 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)
- 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?
Hey, stepping in for Rubeus
gimme a few minutes
- Testing on Dashboard I think yes you have the option to display it as an explicit line item
- 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)