#jot-singh_best-practices
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1242406438412877844
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
I would like my subscription to start in a past date
Unfortunately, Checkout's Session.subscription_data doesn't support backdate_start_date property: https://docs.stripe.com/billing/subscriptions/backdating
However, depending on your use case we could maybe find a workaround that would still allow you to use Checkout.
Ok, is there a way to change the current start date and the current end date of a subscription after it's created? Could I listen to the customer.subscription.created event and do just that?
I don't think you can update it on an existing Subscription. But maybe you could set the custom creation date in metadata, and just set a custom billing_cycle_anchor.
The subscription is annual and one of the ideas I had involved the billing_cycle_anchor, like you mentioned. I thought of putting the end date that I would like the subscription to have in the anchor, so that it would "mimic" a backdate. For example, if my subscription started on the 15th May 2024, but I wanted it to start on the 5th May 2024, I could put the billing_cycle_anchor value to 5th May 2025. This way technically the dates would be correct, but now my issue is the payment. I would like my payment to be complete so that it considers the entire year. If I prorate the payment, I lose those 10 days, so the client pays less. Is there a way to achieve a full payment in this situation?
It's quite a complex use case so I would suggest using the Subscriptions API directly. Instead, you can use Stripe Checkout in mode: "setup" to collect a Payment Method, and then use it when creating the Subscription with any custom logic you're looking for.
Ok. Do I have to create the Stripe Client manually in this case, if I don't have it already? In the subscription mode it was created automatically
I don't know what you mean by 'Stripe Client'
Sorry, I meant customer
Yes, you will. Guide here is end-to-end: https://docs.stripe.com/billing/subscriptions/build-subscriptions?platform=web&ui=elements