#growwithjen-create-invoice-zapier
1 messages ยท Page 1 of 1 (latest)
Of course, take your time. I have been fighting this for a week now ๐
Hello, I am taking over for hanzo. Do you have the request id (req_123) from a time you tried to use this parameter?
What is the error you are getting when you try to set the item, amount, description, etc?
req_dQmv1IFTlqyRbp is the ID. Let me try the items again.
here is another one req_v6MfKbznX3E0Up
I tried using parameter_unknown - line_items
Received unknown parameters: line_items, product, product_quantity
Thank you. I think I have a good idea on how you need to do this. I am about to test it and will get back to you with what I can find. Will check against your requests as well
ok thank you, much appreciated!
So it looks like there is not a line items or lines parameter for the create method for Invoices.
I think you will want to create a blank Invoice and then add items to it with the create invoice item call https://stripe.com/docs/api/invoiceitems/create?lang=curl
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
To create a blank invoice, you can pass pending_invoice_items_behavior = exclude when creating your invoice https://stripe.com/docs/api/invoices/create?lang=curl#create_invoice-pending_invoice_items_behavior
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
So if I send it blank, it gives me this
Ah, missed the second message one sec
OK Got the blank invoice!!
ok, so then the next step is to call the invoices url with the invoice id at the end of the url, and then I can pass the rest of the info, is what I am understanding?
Close, you will be POST-ing to /v1/invoiceitems and providing that ID in the invoice parameter https://stripe.com/docs/api/invoiceitems/create?lang=curl#create_invoiceitem-invoice
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
AH! I am starting to get it. Thanks so much for your help!
Thank you! Working on adding the line item now
OK last question, how do I get the url for the invoice programmatically?
I guess it's more how do I convert it from draft to live and then grab the link to the invoice
You would first finalize the invoice with this call https://stripe.com/docs/api/invoices/finalize
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
And the invoice object you get back should have a hosted_invoice_url https://stripe.com/docs/api/invoices/object#invoice_object-hosted_invoice_url
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
The second one yes
From that error, it sounds like you also have invoice = in_123 somewhere in the body of that post. It only needs to be in the URL
I added a new step in zapier and ensured there was no other data in the post but it still gives me the same error
Can you get me the request ID from that (req_123)?
req_SqSRtHzgVCa6vv
You might want to double check that. I am definitely seeing bodies on each of these requests in your logs https://dashboard.stripe.com/logs/req_SqSRtHzgVCa6vv
Yeah, it's super weird. I picked up the invoice from the previous step in the url but the data is completely empty