#Masum-invoice-items

1 messages · Page 1 of 1 (latest)

muted swallow
sinful dome
#

No I am not passing any price id just customer id

muted swallow
#

Gotcha so that is why you are hitting that error. Can you tell me more about what you are trying to do?

sinful dome
#

I was trying to create invoice with this code $stripe->invoices->create([
'customer' => 'cus_4QE4N83DfMpDkX',
]);

#

Using my own customer id of course

#

but it is showing "Nothing to invoice..."

muted swallow
#

Sure but what is your goal? Are you trying to charge them for something?

#

Why are you creating the invoice?

sinful dome
#

My goal is to create invoice and send it to customer

#

'collection_method' => 'send_invoice'

muted swallow
#

Okay and will you know what you want to charge the customer when you create the invoice?

#

Like how much you want to charge them?

sinful dome
#

yes, I have product for that

muted swallow
#

Got it, then take a look at the above docs and you must create an Invoice Item first before you create the invoice. Then the invoice will pick up that item to charge.

sinful dome
#

okay

#

let me try

#

Thank you. Now its worked

muted swallow
#

Wahoo!

sinful dome
#

It's created but as draft

muted swallow
#

Yep, did you read the above doc? You will want to finalize/send it via the API

sinful dome
#

Sent via api

#

My question is, when I call send api, will it send to customer's email id or I have to send that manully as Invoice not yet sent to custom

muted swallow
#

It will send the customer's email

#

I recommend testing this out! You can only send these emails in testmode if you use your own email that is associated with the Stripe Account for the customer email