#gempain-invoices

1 messages ยท Page 1 of 1 (latest)

silver swallow
#

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

feral pagoda
#

Wow, I didn't expect such a quick response, this is incredible, thanks !

silver swallow
#

no worries

#

out of curiosity, what did you expect? haha

#

(I mean around response, not the API lol)

feral pagoda
#

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.

silver swallow
#

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!

feral pagoda
#

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 ๐Ÿ’ช

silver swallow
#

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

feral pagoda
#

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.

silver swallow
#

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

feral pagoda
#

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

silver swallow
#

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

feral pagoda
#

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.

silver swallow
#

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!

feral pagoda
#

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.

silver swallow
#

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

feral pagoda
#

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.

silver swallow
#

ah yep

feral pagoda
#

^^ 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

silver swallow
#

hey @feral pagoda I'm stepping away but a colleague is catching up soon, they'll respond in a min

hot ice
#

Hello! I'm catching up, one sec...

feral pagoda
#

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
hot ice
feral pagoda
#

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 ๐Ÿ™‚

hot ice
#

Gotcha. There are workarounds, but the simplicity of Checkout is quite nice!

feral pagoda
#

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 ?

hot ice
#

It's mainly geared toward Subscriptions, but you can use it for payment method updates only and whatnot. What do you have in mind?

feral pagoda
#

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 ๐Ÿ˜„

hot ice
#

That should work, yeah.

#

Heh. ๐Ÿ™‚

feral pagoda
#

haha sorry :p

hot ice
#

No worries!

feral pagoda
#

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.

hot ice
#

The less code you write the less that can go wrong on your end!

feral pagoda
#

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.

hot ice
#

I can flag that internally as a feature request if you'd like.

feral pagoda
#

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.

hot ice
#

Feedback recorded!

feral pagoda
#

Thanks for the help anyway, outstanding. Worth the commission every step of the way.

hot ice
#

Always happy to help!

#

What commission though?

feral pagoda
#

Haha the 1.5% on charges ๐Ÿ˜„

#

It was joke, sorry ^^

hot ice
#

Ah, the fees! ๐Ÿ˜„

feral pagoda
#

yeah the fees hahaa

hot ice
#

Gotcha. ๐Ÿ™‚

feral pagoda
#

Worth the fees all the way if you prefer ๐Ÿ˜„

hot ice
#

Yeah, I was going to say, I don't get a commission... should I get a commission? ๐Ÿ˜„

feral pagoda
#

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 ๐Ÿ’ช

hot ice
#

No problem! Have a great night! ๐Ÿ™‚

feral pagoda
#

๐Ÿ™‡