#mehdi-invoice

1 messages ยท Page 1 of 1 (latest)

sullen atlas
#

Hello! There isn't a way to update the Invoice description once the Invoice has been finalized, which can be difficult with Subscriptions because in a lot of cases they automatically finalize the first Invoice when the Subscription is created

#

There's a couple of ways around this

#

You could create the Subscription with a really short trial (like a couple of seconds), so that the first Invoice is the $0 trial one, and the second Invoice (that you care about) can still be updated

mossy elbow
#

oh but for instance

#

if you look at event evt_1LpmZhGMqtYOJnNwlKKSiHwt

sullen atlas
#

You could also use Subscription Schedules instead

mossy elbow
#

it created the first invoice for a subscription, with a description

sullen atlas
#

Ahhh, I see how the dashboard does it - they're using a dashboard-only parameter (invoice_settings.description) when they create a Subscription. But you can only set this through the dashboard, so it won't work for you

mossy elbow
#

oh hmmm

#

why can't I pass that as a parameter?

#

is it blocked on the backend? or can I just manually pass it

sullen atlas
#

If you pass it in the request will fail, because we only allow it to be set from requests made through the dashboard

mossy elbow
#

hmmm

#

if I use a subscription schedule, can I set it as part of default_settings.invoice_settings ?

sullen atlas
#

No, if you use Subscription Schedules you'd make a separate API request to update the Invoice description (which you would be able to do because the Invoice wasn't finalized yet)

mossy elbow
#

ahhh I prefer not having to finalized the invoice manually

#

or have weird states for the subscription

#

is there any plan to let the API set invoice_settings.description?

sullen atlas
#

The Invoice will still finalize automatically, but it'll start off as a draft and then automatically finalize in an hour

#

I don't believe there's any plan to allow general usage of invoice_settings.description (but I'm definitely flagging it as feedback)

mossy elbow
#

oh with subscription schedules though, we would send an invoice to the user, right?

sullen atlas
#

No, you could still use charge_automatically with Subscription Schedules - Schedules are just a different way of creating and making updates to a Subscription

mossy elbow
#

hmmm so would the right way to do this, make a schedule, create a subscription from it and then release the subscription from the schedule?

sullen atlas
#

Yeah, that's one way to do it ๐Ÿ‘

#

the other way around this is the short trial thing I mentioned earlier

mossy elbow
#

what would be the right end date for the phase in a schedule?

wispy slate
#

Hi ๐Ÿ‘‹ @sullen atlas had to step away so I'm jumping in here. Can you describe which phase in a schedule you are talking about?

mossy elbow
#

hey, we were talking about using subscription schedule phases so that we could set description on the first invoice in a subscription

wispy slate
#

If I understand correctly the point of using a Subscription schedule is to use charge_automatically but still have the 1 hour draft period to edit the first invoice. Is that correct?

mossy elbow
#

ahh yeah

wispy slate
#

Okay so you can set either the end_date or the iterations of the phase to whichever you want and by default, the subscription schedule will transition to a plain Subscription once the phase is over.

#

I just tested this out creating a Subscription Schedule and the first invoice was created in Draft mode.

mossy elbow
#

if I want it to immediately turn into a plain subscription, can I put end_date 'now' ?

wispy slate
#

I wouldn't do that just in case it alters the behavior of that initial invoice. Instead I would add an iteration of 1

#

The behavior (except for the initial invoice) will be identical to a plain subscription.

mossy elbow
#

is there some reason why the default payment method from the customer is not applying to the subscription schedule?

#

for example, I tried to finalize this invoice: in_1Lq0XWGMqtYOJnNwC1j3vzDY

#

the customer has a default payment method

#

or do I need to set default_settings.collection_method to charge_automatically?

wispy slate
#

Okay looking at the Customer I see the default_payment_method is pm_1LlGQkGMqtYOJnNwXO27jebF. When I look at the Invoice and I check the related Payment Intent (where we actually collect payment) I see the Payment Method used is pm_1LlGQkGMqtYOJnNwXO27jebF. The current stat of that payment intent is requires_confirmation.

mossy elbow
#

oh, what does that mean?

#

I need to manually call stripe.invoices.pay?

wispy slate
mossy elbow
#

uhhh, why do I need to confirm the payment intent? when I create a subscription normally with this payment intent, it works

#

hmm okay, I think I worked around by it paying the invoice instead of finalizing it

wispy slate
#

Well the invoice was already finalized

#

But yeah I guess that step also confirms the Payment Intent.

mossy elbow
#

ahhhh okay

#

thanks for all your help! this was a round-about way to set description on the invoice but it worked

wispy slate
#

I'm glad we got it working for you!