#gempain-invoices
1 messages ยท Page 1 of 1 (latest)
hello!
Am I supposed to create an invoice item, then an invoice, finalize it and give my customer the hosted url ?
yes, or you can "send" an Invoice to email it to a Customer with collection_method: send_invoice
Also, it seems it's not possible to create an invoice without invoice items first existing
yep you first create InvoiceItems
I find this strange as the API endpoint for creating invoice items accepts an invoice id...
that case works for where you have an Invoice from a Subscription to which you want to add InvoiceItems
Wow, I didn't expect such a quick response, this is incredible, thanks !
no worries
out of curiosity, what did you expect? haha
(I mean around response, not the API lol)
Well, idk, at least an h or so. I've actually worked with the tax team before as beta tester with @unkempt canopy, had a Slack channel through the tax team and they were blazing fast.
I just wish every company was like that.
ah I know CJ! CJ's awesome!
and yeah we (a team of engineers from Stripe) operate in this Discord server near ~24/5 and are always around to answer questions, just like you asked!
Yeah that's pretty awesome. Must be really cool to work for you guys. I've always admired your APIs and UX/Devx. You rock ๐ช
thanks for the kind feedback! really, means a lot! appreciate it!
let me know about if you have more qs about one off Invoices
but really you covered 99% of it, you create InvoiceItems first, then either redirect the customer to the hosted_url or you "email" the Invoice using collection_method: send_invoice param
I'm just curious about race conditions.
Between the time I create the item and the time I create the invoice.
If the invoice creation endpoint allowed passing items, it'd be nice.
and the other thing you mentioned, teams do know of the feedback of users wanting to create the Invoice first, then the InvoiceItems but from the little I know, they are aware of that feedback but don't know of any plans to change that yet, I wasn't around on "why" the design decision was to build it this way
oh don't worry I'm not saying it's a bad design ๐
Just thinking that it may cause unexpected results even though very unlikely
If the invoice creation endpoint allowed passing items, it'd be nice.
yep that would be an ideal option but yeah that doesn't exist
and yeah race conditions can be an issue if say, you have 1 Customer and 2 "vendors" who want to Charge that Customer near ~instantly
so your requests have to be "sequential" so that you don't send 1 Invoice to the Customer with both vendor 1 and vendor 2 InvoiceItems
yup exactly
very unlikely but you never know
it's unfortunate that checkout doesn't do this automatically
I mean, I know that when I go to a store, I generally pay with my card, then ask for the invoice.
I actually hoped (but tried with the API and obviously failed) that webhook checkout events would have an invoice via session.payment_intent.invoice
but that was null lol
I also tried creating a "paid" invoice.
After all, all I wanted was an invoice corresponding to the payment done in my customer's checkout, so they can download it afterwards.
I generally pay with my card, then ask for the invoice.
Checkout does send a "charge receipt" but yeah not an Invoice right now. Which is also feedback I've heard!
But in my understanding, the flow is either checkout, or you have to create the invoice and let them pay it online.
And if you want an invoice, you have to go with the invoice API and forget checkout.
After all, all I wanted was an invoice corresponding to the payment done in my customer's checkout, so they can download it afterwards.
the PaymentIntent's Charge receipt url could work in this case?
It won't be an "Invoice" really (like the actual regulatory definition of an invoice) but it would be a charge record of sorts
And if you want an invoice, you have to go with the invoice API and forget checkout.
but yes this is correct
Yup but the receipt won't work for B2B. In my case my customers need a legal invoice with their tax id so they can get the VAT back.
ah yep
^^ I always feel like I have the one case that just doesn't fit lol
@silver swallow is there a way to create an invoice and mark it as "paid" ?
I could then use checkout and create invoices as I wish without having people actually pay them.
Sounds like a hack but who knows :p
The dashboard lets you do this apparently:
but I don't see an API url for this
hey @feral pagoda I'm stepping away but a colleague is catching up soon, they'll respond in a min
Hello! I'm catching up, one sec...
You can mark the Invoice as paid using the API and set paid_out_of_band to true if the money came in outside of Stripe: https://stripe.com/docs/api/invoices/pay#pay_invoice-paid_out_of_band
sounds good, thanks @silver swallow , good day !
and hi @hot ice ๐
Oh okay, interesting way to do it ๐
So I think what i'll do is this:
- checkout customers without invoices
Also, I know you mentioned wanting to use Checkout before... have you looked at the hosted_invoice_url on Invoices? https://stripe.com/docs/api/invoices/object#invoice_object-hosted_invoice_url
More info here: https://stripe.com/docs/invoicing/hosted-invoice-page
yup, I knew about this, but the fact that you can't create an invoice in one go
meaning, items. + invoice at once
make race conditions possible
I think it's okay for most platform (including mine) but could be an issue with bigger ones
where checkout is sort of race condition free ๐
Gotcha. There are workarounds, but the simplicity of Checkout is quite nice!
Okay yeah hosted invoice will do, I juste tested it and it's great.
However, i'm wondering
Can customer portal be used without subscriptions ?
It's mainly geared toward Subscriptions, but you can use it for payment method updates only and whatnot. What do you have in mind?
I basically want to write as little code on my end as I can. When my customers click "Billing settings", I redirect them to the customer portal. I just wanted to make sure that if they, for example, set their tax id in their customer portal, that the hosted invoice would have their tax id on it and that their billing info would be set as well.
But I just tried and it works ๐
haha sorry :p
No worries!
I'm just trying to write as little code as I can - you know the pareto way lol
Rewriting tax id verification and proxying CRUD through my backend would just be a waste of time since you guys have added tax ids to customer portal.
The less code you write the less that can go wrong on your end!
Yup that as well ๐
However, I will say
Customer portal is missing one feature: editing your customer name
RIght now I still have to let my customers edit this on my end.
A bit strange having to edit your customer name (company / person) on one side and editing the rest of your billing info on the other.
I can flag that internally as a feature request if you'd like.
Yeah that'd be great.
You can already change your billing / shipping address as well as tax ids, payment methods, even your email, so why not add your customer name ๐
You can even toggle the ability to edit these fields in the CP from the dashboard, so I guess they can add a toggle there as well.
Feedback recorded!
Thanks for the help anyway, outstanding. Worth the commission every step of the way.
Ah, the fees! ๐
yeah the fees hahaa
Gotcha. ๐
Worth the fees all the way if you prefer ๐
Yeah, I was going to say, I don't get a commission... should I get a commission? ๐
You should lol
Anyhow, I'll wrap up for today and go to bed, it's like 1AM and I'm done for today with invoicing APIs.
Thanks again for the help ๐ช
No problem! Have a great night! ๐
๐