#meisei81

1 messages · Page 1 of 1 (latest)

wraith lilyBOT
viral pelican
#

hi! that's because you're using an old API version basically, where the invoice items work differently

tawdry wasp
#

My stripe sdk is 20.86.1

#

is it old?

viral pelican
tawdry wasp
#

it's just one year ago

#

I don't think I should upgrade so frequently

#

because we should test the whole business process

viral pelican
#

cool, I never said you had to upgrade, I gave you three options and only one of them was upgrading

tawdry wasp
#
  • create the invoice items first, then create the invoice(which is not what our docs describe) --- about this option, is there any correct docs?
viral pelican
#

no since we deleted the docs for the old approach

#

try it out and if you get stuck let me know and share the code you tried

tawdry wasp
#

this is my code

#

I've created the invoice item in step 1

#

And this is the full code what step 1 will execute

viral pelican
#

is there a problem exactly? do you get some error?

tawdry wasp
#

the error is "Nothing to invoice for customer; code: invoice_no_customer_line_items; request-id: req_e5ZSGgXfmxPfoV"

viral pelican
#

I'm so confused, that is the request you posted 30 minutes ago and I thought you were changing code to fix it per my advice?

tawdry wasp
#

it's weird. this customer has created some invoice before and the currency code is EUR. now I try to create a MAD currency code invoice, and the problem comes

#

no

#

i don't change any code

viral pelican
#

why not?

#

ok any way , looking for a sec

#

https://dashboard.stripe.com/test/logs/req_Lwv92R5dbTRA9W is you creating the invoice item
https://dashboard.stripe.com/test/logs/req_e5ZSGgXfmxPfoV is you creating the invoice which failed

#

it is weird it would return that error

#

often that means that something else (like a subscription) created an invoice for the same customer inbetween those requests

#

looking.

tawdry wasp
#

I created invoice successfully this morning

#

but it failed in afternoon

#

so I don't think it's the code issue

viral pelican
#

what happens if you try to create an invoice now?

#

but yeah weird, there was no other invoice

tawdry wasp
#

I've just created an invoice and it pay successfully

viral pelican
#

I don't know why those items didn't get pulled in

tawdry wasp
#

the same customer

#

you could check it

viral pelican
#

just did

#

cool. Must have been some timing issue then where the items weren't available for some reason and you'd have to retry the request

#

ultimatley this is why we changed the API to not work this way(create items first, then create the item), it's unreliable unfortunately

#

I'd suggest using the other approaches(opting into the new pending behavior or using the newer API version by upgrading stripe-java)

tawdry wasp
#

I've just created an invoice and got the same error Nothing to invoice for customer; code: invoice_no_customer_line_items; request-id: req_Q7JLJCm252Fn0c

#

The difference between this two requests, is that they are not the same product and price

#

and the currency code is eur and mad

viral pelican
#

like I said, I don't know

#

feels unlikely that would matter

tawdry wasp
#

you could try it

viral pelican
#

if you wait a couple of minutes and try to create the Invoice does that work?

tawdry wasp
#

i can wait

viral pelican
#

ok let me know

#

ah right I'm an idiot

#

the API error is just confusing, what it means is it can't find any available items to invoice for(since there are only MAD items and the customer is locked to EUR) so that's why.

tawdry wasp
#

ok

#

can I change the customer's currency?

viral pelican
#

no, see the support article for the answer to that question

tawdry wasp
#

the customer's default currency is eur?