#arggh-API

1 messages · Page 1 of 1 (latest)

tight latch
near epoch
#

Sure, req_azPuAXjLkQKpTk

tight latch
#

And can you also share with me the doc link?

near epoch
#

The explanation talks about custom line items, but the code example uses invoice_line_item, and the code example doesn't work.

tight latch
#

Thanks. Based on the log, you are passing lines as a object instead of an array. can you show me the code?

near epoch
#
stripeCreditNote = await stripe.creditNotes.create({
        invoice: stripeInvoiceId,
        lines: [
          {
            type: 'invoice_line_item',
            description,
            quantity: 1,
            unit_amount: Math.abs(amount)
          }
        ]
      });

EDIT: I changed the type to match the logged request

#

Probably some parsing happens in your API before the request gets logged. Or then Stripe's npm package has a bug.

#

My actual problem is related, I would be very happy to receive help for that. We are (apparently) using Stripe Tax. When I try to apply a Credit Note to an invoice, using custom_line_item, we get StripeInvalidRequestError: Custom line items are not supported for invoices with automatic_tax.enabled = true.

Our use case: we want to reduce arbitrary amounts from customers’ invoices. Example:

Fee 20$
Fee 25$
Fee adjustment -5$
Fee adjustment -2$
-------------------
Total 38$

or...

Fee 20$
Fee adjustment -25$
-------------------
Credit balance adjusted +5$
#

What is the correct way to achieve this? We are adjusting the invoices based on webhook calls before they are finalized.

tight latch
#

Ah, you are right! our doc is wrong, it should be custom_line_item instead of invoice_line_item

tight latch
#

Thanks for the feedback! I'll tell the team to get it fix soon.

near epoch
#

@tight latch sent a new message as I thought you either missed the question or that there's "one thread per issue" policy, but happy to address it here.

tight latch
#

Sorry the waiting, discord is quite busy today

#

Can you share with me the request ID of which you specified the custom_line_item ?

near epoch
#

req_464QdByhHyNmyA

tight latch
near epoch
#

Thanks. I believe this method has no way to tell customer where the balance/refund came from, like having a line item on the invoice does?

#

Also, if we remove automatic tax calculation, Credit Notes is the answer, am I correct?

tight latch
#

You can put a internal note when creating a credit balance, but it's not visible to the customer.

near epoch
#

I'm sure there is a valid reasoning for all this, but sure does seem like a random restriction that's preventing us from doing something trivial.

#

automatic tax = can't do many things you thought you could, only to find out after you have implemented 95% of the solution.

#

(as feedback)

tight latch
#

Thanks for the feedback. Can I trouble to write in to Stripe support https://support.stripe.com/contact so that we can pass along your feedback to the relevant team?