#sai_rez

1 messages · Page 1 of 1 (latest)

lapis atlasBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

limber apex
#

hi there!

#

how can I help?

subtle wraith
#

I am in the process of writing some integration tests using Stripe API and want to understand this behaviour.

I am creating two draft invoices with different amounts for a test customer and finalising them so their status is open. The first invoice is not attached to a subscription while the second is.

I noticed when logging the results of the invoices, that the first invoice has an amount due of 0 and it's status is paid, while the second invoice has an amount which is the sum of the first and second, and it's status is open.

As I haven't manually paid the invoices, I was expecting both to have a status of open, could you explain why the first invoice in this scenario automatically pays and its amount is transferred to the second invoice?

limber apex
#

I noticed when logging the results of the invoices, that the first invoice has an amount due of 0 and it's status is paid
can you share the Invoice ID (in_xxx)?

subtle wraith
#

in_1OfKXkCXkWwmRJKmALsjKnEm

#

If I link both invoices to a subscription, both remain open after finalising which is what I am expecting for me test, however when one isn't it's amount get's transferred to the second one if that makes sense

limber apex
#

what's the issue exactly? you created that Invoice but didn't add any Invoice Item to it, so it's expected that the total is 0.

#

Step 1: create an Invoice
Step 2: add InvoiceItems to the Invoice
Step 3: finalize the invoice

#

looks like you forgot to do step 2.

subtle wraith
#

Ah yes sorry, both invoices have an invoice item created

limber apex
#

the one you shared has no InvoiceItems.

subtle wraith
#

Hmm how does an invoice item link to an invoice, I am currently using a customer ID, is that the correct way?

limber apex
#

But it's either pulling InvoiceItems from the customer object, or directly adding the InvoiceItems to the Invoice itself

subtle wraith
#

Ok thanks I will take a look at those, how can you confirm if an invoice has an invoice item?

limber apex
#

you can look at the Invoice in the dashboard or with the API

subtle wraith
#

Okay thanks, I'll take look!