#nugax_invoice-email
1 messages ยท Page 1 of 1 (latest)
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.
- nugax_api, 6 days ago, 75 messages
๐ 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.
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?
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,
]); ```
the error message is telling you the exact fix though
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.
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.
i didnt check the customer stripe account. let me check.
sure!
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'],
],
]);
Take the time to look at the Customer object, look at the request logs associated with it, etc.
See https://dashboard.stripe.com/test/logs/req_pLV8gmuw2XgI73 where you passed email: ''
you likely forgot to check/validate for empty values
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
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.
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.
ok, well whatever you need to.
Sounds good
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.
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
absolutely
i would then know to check my stripe customer object and find that my code wasnt updating customer object info correctly.
perfect!
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.
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 ๐
or about my last issue
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
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.
gotcha!