#jbuck94-checkout-billing-anchor

1 messages ยท Page 1 of 1 (latest)

dry dagger
#

Hi ๐Ÿ‘‹ you're correct that it is not possible to specify a Subscription's billing cycle anchor when using a Checkout Session.

The closest option is to add a trial period to the Subscription via subscription_data.trial_end or subscription_data.trial_period_days that will push back the billing cycle anchor to the end of the trial period, but this could look odd to your customers.
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-subscription_data-trial_end

The other option is to use a Checkout Session in setup mode to collect your customer's payment method information, and then use the created payment method to create a Subscription from you server where you can control the billing_cycle_anchor and backdate_start_date values directly:
https://stripe.com/docs/api/subscriptions/create#create_subscription-backdate_start_date

worn idol
#

Ah ok - didnt realize there was a setup mode. What webhook events will i receive around the setup that I would listen for to start a subscription

dry dagger
worn idol
#

Cool, let me take a look here

#

Ill post back shortly with any additional q's

worn idol
#

when creating the subscription - what field to i pass the setup_intent to?

green nacelle
#

Hi ๐Ÿ‘‹ What are you trying to do with the Setup Intent?

worn idol
#

See above. Trying to use the setup intent to collect payment info - then intialize a subscription from my backend

green nacelle
#

This would automatically use that payment method when a subscription for that customer is created

worn idol
#

Is it "more correct" to set it as the default payment method of the customer, or the subscription?

#

Or - doesnt completing the checkout session attach the payment method to the customer already?

green nacelle
#

It depends on the behavior you want. You can specify it on the subscription and the PM will get used for all recurring charges on that Subscription, or you can specify it on the Customer. You are right, the PM will get associated with the customer. If they do not already have a PM specified as the default it may set that too but I would want to test that first.

worn idol
#

Got it - sounds good, Thanks!

#

how do the billing_cycle_anchor and backdate_start_date work together?