#nugax_invoice-email

1 messages ยท Page 1 of 1 (latest)

primal domeBOT
flint pagodaBOT
#

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.

primal domeBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1238261265173053460

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

lapis cobalt
#

nugax_invoice-email

#

@quasi vault the error message is really descriptive in that error. Can you tell me what part is confusing so I better understand what you tried?

quasi vault
#

Sure, so I am attempting to create an invoice with the "send_invoice" collection method. The error i get shows that i must include an email. I tried adding an email of "customer_email" but that is not recogined in the api create invoice call. I am sure the variable used for the email is correct but the error states that customer_email isnt correct for the create call.

#

This is my call for creating a draft invoice:

#
$invoice = $stripe->invoices->create([
    'customer' => $stripe_customer_id,
    'auto_advance' => false, 
    'description' => $invoice_desc,
    'collection_method' => 'send_invoice',
    'days_until_due' => $days_until_due_given,
    'customer_email' => $account_email_given,

            
]); ```
lapis cobalt
#

the error message is telling you the exact fix though

quasi vault
#

In addition, i tried removing "customer_email" and get the following error. This used to work so I can not sure what the issue is.

#

Stripe Error: Missing email. In order to create invoices that are sent to the customer, the customer must have a valid email.

lapis cobalt
#

Sorry I push a bit because I need to figure out what's unclear with the error message so we can improve it.

#

here it clearly tells you the Customer must have a valid email.

#

So you need to update the Customer to have an email.

quasi vault
#

i didnt check the customer stripe account. let me check.

lapis cobalt
#

sure!

quasi vault
#

there isnt one.

#

thats weird. I do include the email when I create the customer, however.

#

This is the code for creating the customer:"

#

//Create The Customer
$cust_obj = $stripe->customers->create([
'name' => $customer_name,
'description' => $customer_description,
'email' => $customer_email,
'phone' => $customer_phone,
'address' => [
'line1' => $address['line1'],
'city' => $address['city'],
'state' => $address['state'],
'postal_code' => $address['zip'],
'country' => $address['country'],
],
]);

lapis cobalt
#

you likely forgot to check/validate for empty values

quasi vault
#

oooooh

#

you know what it t is.

#

i know the issue.

lapis cobalt
#

Can I ask you how you would reword that error message to help you self serve the issue?

#

My team helps improve error messages based on questions here so I'm really curious if there's a better wording that would have helped. Or if it's because you were sure you passed email so you didn't check the Customer

quasi vault
#

So for the API, wording it as (Stripe account does not have an email) would help us realize its not our system but what stripe itself sees. since we are dev'ng our on programs.

#

stripe customer account must have a valid email.

#

see i just updated the account in my program and it updated the stripe cistomer account with email.

#

bet it creates fine now.

#

Stripe Error: Missing email. In order to create invoices that are sent to the customer, the customer must have a valid email.

lapis cobalt
#

we would never say "Stripe account". That's a Customer object. A Stripe account is what you own for your company that lets you have access to the Dashboard, API keys, etc.

quasi vault
#

ok, well whatever you need to.

lapis cobalt
#

Sounds good

quasi vault
#

just letting us know its the account in stripe.

#

not something we are passing via api

#

because i can chase my tail with what im senidng via api. it gets very complicated

#

when it was the customer object creation causing it. not the actual invoice creation.

lapis cobalt
#

Right now it says

Missing email. In order to create invoices that are sent to the customer, the customer must have a valid email.
Would this be better
Missing email. In order to create invoices that are sent to the customer, the associated Customer object must have a valid email. You must update the Customer object first and then create the Invoice

quasi vault
#

absolutely

#

i would then know to check my stripe customer object and find that my code wasnt updating customer object info correctly.

lapis cobalt
#

perfect!

quasi vault
#

by the way, i owe you an apology. you were absolutely right last time we chatted about the issue

#

i had a form tag not closed causing the issue.

lapis cobalt
#

I appreciate you being the guinea pig. It's so hard to tweak those messages ourselves since we know the API inside out so the error we have right now seems obvious. But as we talked it's clear we can change the wording now ๐Ÿ™‚

quasi vault
#

or about my last issue

lapis cobalt
#

And no apology necessary, I remember our convo and I know it wasn't just an obvious thing. It's tough when you have a long succession of calls and not just one specific one failing

quasi vault
#

i wasnt trying to do what it was trying to do. It was trying to create the invoice because of an unapparant /form tag i didnt see.

lapis cobalt
#

gotcha!

quasi vault
#

but I see my issue here and can work to fix it. just have to change some code when i create my customer object.

#

appreciate the help. and i will probably chat in because i am going to start subscriptions soon, and they seem difficult.

#

you have a good night though.