#savan
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- savan, 23 hours ago, 5 messages
hi the invoice is in_1OP3YRJJCQbUhES2qa5wPEpu
and what exactly would you like to be different in this invoice?
the next invoice date i guess should be 12/13/24
the subscription started and paid 12/13 on another platform and it's annual
should i set a trial period to end on 12/13 in this case?
12/13/24 that is
the api seems keyed in on import date instead of the billing anchor
If you want the first invoice on 2/13/24, then you need to create a free trial until 2/13/24 yes
should the free trial be a different "phase"?
in my example code 12/13/23 is the value of product_start_epoch_pacific
the trial period documentation does not describe how to do it with SubscriptionSchedule https://stripe.com/docs/billing/subscriptions/trials
but the subscription migration page recommends using SubscriptionSchedule https://stripe.com/docs/billing/subscriptions/import-subscriptions
Hi there 👋 jumping in as my teammate needs to step away soon. It looks like you're already using Subscription Schedules, which based on what you're describing is the approach I would have suggested.
Do you need the new Subscription in Stripe to start immediately as well? I see you're using the start_date parameter on the Subscription Schedule, and was thinking you could drop the trial period and instead use that start_date to have the new Subscription start on the first date it should send an Invoice.
Yes, i'm leaving my old platform and some customer will be in the middle of an annual subscription.
a person could've paid for an annual sub on 12/13 and I'll import them at the end of the year. they need to show subscribed and next billing be 12/13/24
Hm, if you need them to start right away, it may be easier to just create Subscriptions, let me take another look there.
this subscription actually is close
sub_1OP3sgJJCQbUhES2bRykBNyi
looks like the sub started on 12/13/23, shows active, but the invoice date is 12/19/24. not sure why it's not 12/13/24
Do you still have the code that created that Subscription handy? There are two parameters I'd recommend trying to add to it if so.
some difference between started and created:
and wants to invoice on the created date instead of started date
One is billing_cycle_anchor, which allows you to pin the billing cycle anchor for the Subscription (I'm a little fuzzy on whether you can use it with backdate start date, so let me know if that gives you problems).
https://stripe.com/docs/api/subscriptions/create#create_subscription-billing_cycle_anchor
In the scenario you're describing, it sounds like you would want to set that to the backdated start date + 1 year.
yup, i used billing anchor
stripe.SubscriptionSchedule.create(
customer=customersByEmail[customer_email].id,
metadata={"imported_from": "trainerize"},
default_settings={
"billing_cycle_anchor": "start_date",
"collection_method": "charge_automatically"},
phases=[
{"items": [{"price": PRICE_ID}],
"proration_behavior": "none",
# "trial_end": 1704138038
}
],
start_date=product_start_epoch_pacific,
)
the start date is 12/13 or 1702526400 as epoch
the price is
price_1OMm0xJJCQbUhES2GOYOrAdQ
That code doesn't seem to be what created the Subscription you shared. The Subscription you shared was started directly, rather than using a Subscription Schedule as that snippet does.
and it's a test customer
cus_PCO9lisQhEi1XY
in the subscription log shows an api call i just made
The Subscription you shared appears to have been created by this request:
https://dashboard.stripe.com/test/logs/req_vyD0Pj4j1yiE8X
Which was creating a Subscription rather than a Subscription Schedule.
hm, yes, i see it doesnt have my metadata in it either
could you look again plz
the sub is sub_1OP41vJJCQbUhES2vpD5WAn4
That one came from a Subscription Schedule, but is it closer to what you want than the one you shared previously? I'm thinking Subscription Schedules may be unnecessary here.
the invoice day still is the create date as opposed to start day
Can you try your request to create a Subscription again, the one similar to this request.
But this time include:
backdate_start_date- set to the start date of the existing subscriptionbilling_cycle_anchor- set this to backdate_start_date + 1 yearproration_behavior- set tonone
sub_1OP4GwJJCQbUhES2CGVX3eiM
looks like that set the dates correctly
am i going to miss out on anything by not using schedule?
Nope. Subscription Schedules are there to wrap Subscriptions, they allow you to schedule changes that will happen to the associated Subscription in the future. As long as you don't need to do that, you should be fine working directly with Subscriptions.
I would recommend double checking that's behaving exactly as you want inside of a Test Clock:
https://stripe.com/docs/billing/testing/test-clocks
That will let you create a Customer/Subscription inside of a small sandbox where you can advance time and see how the Subscription will behave throughout it's lifecycle.
great, I'll test it w/ the clock. Thanks for the help Mr. Toby-