#skoshkarli-subscription-setup-fee

1 messages ยท Page 1 of 1 (latest)

crimson copperBOT
sharp flume
#

and how do i charge upfront for the setup fee only and not the recurring subscription fee in cases of trial?

tawdry plume
#

Hi there ๐Ÿ‘‹ yes, when creating a Subscription that has a one-time fee included in the first Invoice, you will provide that when creating the Subscription. Please bear with me a moment while I double check whether that goes into the items array or add_invoice_items.

sharp flume
#

๐Ÿ‘

tawdry plume
#

Thank you for your patience while I confirmed. The one-off items would go in add_invoice_items.

sharp flume
#

and how do i make it so that they get charged right away regardless of trial period for that one off item?

tawdry plume
#

Nothing special needs to be done for that. When you include a one-off Invoice Item, it is included in the first Invoice that is generated which still happens immediately for Subscriptions with trials (but typically these are zero-dollar Invoices when a trial is involved).

#

skoshkarli-subscription-setup-fee

sharp flume
#

so in this case it just wont be a 0 dollar invoice? do i still do a setupIntent in the cases when ther is a trial?

tawdry plume
#

Correct, in that case the first Invoice will not be a zero-dollar Invoice. Instead it will include a single (unless you're providing multiple Invoice Items) line for the setup fee that you specified.

It is up to you whether you want to create and handle a Setup Intent before creating the Subscription. If you do then you can provide the ID of the created Payment Method when creating the Subscription to have the Subscription automatically try to charge that Payment Method each cycle, via the default_payment_method field.

If you don't, then you can use the Payment Intent that is automatically created by the first Invoice to process the payment and save the payment method details for reuse.

sharp flume
#

got it. ok thank you, let me try this and see if it works as i want.

tawdry plume
#

Happy to help! Let me know if it doesn't and we can talk through that.

sharp flume
#

sorry have another follow up question

#

so i pass the priceId of the setup fee, how do i ensure its in the currency that the subscription in as well?

tawdry plume
#

You set the currency when you create the Price. If you're using multiple currencies you'll either need to maintain a way to know when to use which Price, or you'll need to retrieve/list your Price objects when creating the Subscription to know which one is the right one to use.
https://stripe.com/docs/api/prices/object#price_object-currency

sharp flume
#

doesnt have a currency field to pass in

#

oh wait, unless the same currency will be used as what i pass to subscription.create call?