#Jakub-Billing Cycle Anchor
1 messages ยท Page 1 of 1 (latest)
๐ happy to help
unfortunately there's no direct way of setting the billing_cycle_anchor in the Checkout Sessions
the only way of setting the billing cycle to a certain date using checkout is the use of trial_end https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-subscription_data-trial_end
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Thanks tarzan, using trial could be an option. We will look into it
another option would be to create the Subscription on the side and use the Checkout in setup mode to collect the payment method
hmm, the issue with trial is that the language on the checkout page is then misleading (it says Pay and start trial). I guess the only way to change what the texts on checkout say is to go with custom components, right?
If you don't use Checkout then you could setup billing_cycle_anchor when creating your subscription and using Stripe Elements(Payment Element, Card Element, etc.)
if we want to go with regular subscription API, the issue is that we would need to manually create the customer and product before payment, that means at least three separate API calls from our server to Stripe
- await create customer
- await create product
- await create subscription
it doesn't make sense to create products beforehand (they are constantly changing)
it also doesn't make sense to create customers beforehand as only about 10% of all our customers would by a subscription
Or am I misunderstanding something?
you don't need to create the product, you could use the https://stripe.com/docs/api/subscriptions/create#create_subscription-items-price_data
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
isn't product id a required parameter? See here https://stripe.com/docs/api/subscriptions/create#create_subscription-items-price_data-product
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.