#nugax_invoice-email
1 messages · Page 1 of 1 (latest)
👋 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/1233540359791968316
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
HI!
I am simply trying to create a draft invoice with php. for send_invoice it says i need a customer_email, but customer_email is not a valid identifier according to the api response
Hey @ripe mauve do you have more specific details? The request id you shared is unrelated and has a completely different error.
Our Create Invoice API https://docs.stripe.com/api/invoices/create does not have customer_email as a parameter anywhere though
"customer_address": null,
"customer_email": "jennyrosen@example.com",
that doc does
yeah that's the object though, that's the response from our API
hmm
//Create Draft Invoice
$invoice = $stripe->invoices->create([
'customer' => $stripe_customer_id,
'auto_advance' => false,
'description' => $invoice_desc,
'collection_method' => 'send_invoice',
//'billing' => 'send_invoice',
'days_until_due' => $days_until_due_given,
]);
what's the problem? Like what exact error do you get?
getting it one sec
Stripe Error: Missing email. In order to create invoices that are sent to the customer, the customer must have a valid email.
does this mean in the customer object? not the invoice?
thats what im starting to think
This is my customer creation
//Create The Customer
$cust_obj = $stripe->customers->create([
'name' => $customer_name,
'description' => $customer_description,
'email' => $customer_email,
'phone' => $customer_phone,
]);
ah yes you need to make sure your Customer has an email address since you use send_invoice which will force an email to them
is there a way in customer account to set to not auto send invoices?
like billing or something? and i fixed that in my code. works now
don't use collection_method: 'send_invoice' if you don't want to send an email
nugax_invoice-email
correct, it doesn't really make sense to have a due date in that case, it'd be charged immediately
I see. I'm trying to have stripe create an invoice though my app I'm dev then allow the user to post payment
But I wanted to keep up with due datw
Date
Hello! I'm taking over and catching up...
I didn't want to automate stripe to collect . Do you have an exampl3 you can send me of what a invoice from stripe would look like? Maybe i do set auto collection.
Hi rubes! Been a while!
Rubeus.
To clarify, you want to create an Invoice with a due date but not have it sent to a Customer to collect payment?
Yea I wanted the user of my app to initiate payment. But I think auto payment on date might work too
Now that I'm thinking about it.
I'd really just like to see what the customer would see from stripe.
You want to see it yourself, or you want to provide like a preview to your customer?
I'm still learning the api so appreciate the help ND patience
I just want to see what stripes gonna send. Like a copy of a payment request or something
Is this just while you're testing, or is this something you want to do in production?
This is testing rn. Eventually production
It would help me if I understood more about what you're building at a high level. What's the desired customer/payment flow?
OK, so two types of payments.
Invoices with invoice items , tax rate, that are created at various times for merchandise or service sold
And subscription service that is recurring invoice
I should say two types of invoices and payments
I am working on the invoice portion now. I want to create an invoice with items and taxes that had a due date which a customer can pay whenever
Okay, so you want the customer to be able to pay the Invoice any time before the due date, including right now, correct?
I have the api creating the invoice with a due date, tax rates, and correct due date
Yes! And autonpay on due date is fine.
Autopay or stripe autocharge
We don't really support automatically paying for an Invoice in the future like you're describing. Your choices when creating an Invoice are to set collection_method to either charge_automatically (where we attempt to charge them when the Invoice is ready to go) or send_invoice (where you send the Invoice to the Customer and they have until the due date to pay it).
It sounds like you want to go with send_invoice, but you need to have a Customer with an email to send the Invoice to for that to work.
But couldn't I do a payment at any time on that invoice if I set it that way?
Say I create an invoice send invoice due in 30 days. They can pay anytime via the email, but I can using api create a method for it to be paid from my application
Correct?
Paid at anytime prior to the 30 days
Not sure I fully understand this part: "but I can using api create a method for it to be paid from my application". Can you clarify?
Do you mean can you have them pay the Invoice from your system after you create it and send it to them?
Yeah, you can do that. The Invoice will generate a Payment Intent, can you can build a payment form on your site that will confirm (pay) that Payment Intent.
What specifically did you want to happen in your system? Do you want to build a payment form with the Payment Element, for example?
I'll probably just build it from the api. Haven't gotten that far yet
I can build my own form to match the system.
Do you happen to have a email you can send that shows what stripe sends for the invoice?
So I can see what stripe will send my customers
The easiest way to see that is to create an Invoice in the Dashboard in test mode and send it to yourself (use the same email address you use to log in to the Dashboard).
OK.
Yea I been using the dev api keys
I can set my app to test or liv3 and change the keys which are stored
Note that this is a public server, not sure if you want all of the information in that screenshot public.
It's fine
I'll regenerate it
That's all bogus info
That's the form I'm working on that adds invoice items. At this point it's generated a draft invoice
You really shouldn't share your API key like that.
You can just recreate a test key right
That's all it is
I will do
I just wanted to show what It was doing
I just wasn't sure what happens after I finalize the invocie
Invoice
From draft
The Invoice lifecycle and statuses are explained in detail here: https://docs.stripe.com/invoicing/overview#invoice-lifecycle
Cool. I'll read it. You have been very helpful - as usual. Thank you! I'll msg in if I have other issues. Appreciate it!
There's also a lot of useful information here: https://docs.stripe.com/invoicing/integration/workflow-transitions
Happy to help! Good luck with your project!
Thank-you! Oh one last question
The percentage fee for stripe is 2.9 + 30ceny
Cents
Right?
The cc processing fee
That's the standard fee in the US, yeah, but I recommend you always consult https://stripe.com/pricing for pricing information.
OK. Ty. Have a great weekend