#mehdi

1 messages · Page 1 of 1 (latest)

shy ospreyBOT
celest estuary
#

hello! can you share more on why you're looking to set the description field on the first invoice?

fathom ore
#

yeah sure. the setup we have is the customer could purchase the same product from us multiple times. Rather than bundle it all into one subscription (because their start times could be different), we want to create a separate subscription per purchase

#

then to make it easier for the customer, we want to include some extra information in the description field

#

(I don't want to use a separate price as a single price makes it easier to track, etc.)

celest estuary
#

can you maybe illustrate this with an example description?

#

what would the description say?

fathom ore
#

oh sure, so our product is actually a job board

#

and we are charging customers (employers in this case) for job listings

#

so for example, one of the descriptions would be "Job posting for Designer role" while a different subscription's description would be "Job posting for Engineer role"

#

hmmm is the only way to do this with listening to the "invoice.created" webhook, and updating the description there?

celest estuary
#

this seems like a similar question to the thread before yours

fathom ore
#

hmmm it seems in my case, I cannot pass a description to the line item though

celest estuary
#

yeah, sorry, that only works for mode=payment

#

if you want to update the first invoice, it depends on the collection method of the subscription - you can when collection_method: send_invoice but it becomes more complicated if you're using collection_method: charge_automatically

Most invoices generated for a subscription have a one hour period before finalization where changes can be made. This time can be used to double check the amount/line items, add a description, add metadata, etc. This behavior applies to all invoices except for the first invoice generated for a subscription where collection_method: charge_automatically

fathom ore
#

oh, I am doing charge_automatically

#

because I don't want to send the user an email

celest estuary
#

The first invoice for charge_automatically subscription is immediately finalized and charged. As such, there is no one hour period in which you can update the invoice before finalization. All subsequent invoices generated for subscription renewals will have the one hour draft period

There are a couple of ways to work around this:

Create your subscription with trial_end set a couple of seconds into the future. The subscription will first generate a $0 invoice, and once the trial is over a non-zero invoice will be created with a one hour draft period. The initial status of this subscription will be trialing and will transition to either active or past_due depending on the payment outcome.

Or, create the subscription through a subscription schedule . When the schedule starts, the subscription’s initial status will be active with an initial draft invoice that is scheduled to finalize in an hour. Depending on whether payment of the initial invoice is successful or not, the subscription will either stay active or transition to past_due.

fathom ore
#

oh interesting

#

does responding to the invoice.created event help here?

celest estuary
#

i'm not entirely sure what do you mean by responding to the invoice.created event?

#

by default, if you use charge_automatically, the first invoice finalizes immediately

fathom ore
#

oh the site says

#

Sent when an invoice is created for a new or renewing subscription. If Stripe fails to receive a successful response to invoice.created, then finalizing all invoices with automatic collection is delayed for up to 72 hours. Read more about finalizing invoices.

#

I'll try that