#james-schedule-bca
1 messages · Page 1 of 1 (latest)
Hi 👋
yes you can do this. You set the billing cycle anchor for the initial phase.
https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-phases-billing_cycle_anchor
Yes I see I can set that but it only takes two values.
Can be set to phase_start to set the anchor to the start of the phase or automatic to automatically change it if needed. Cannot be set to phase_start if this phase specifies a trial. For more information, see the billing cycle
When i set a start and enddate the subscription seems to always just be created with the billing anchor timestamp of the current time
Is that the behavior you want?
No I want the subscription to be created with the billing cycle anchor of the enddate of the schedule
or at least at that interval
Do you mean the end-date for the trial phase?
Well I am not using the schedule to apply a trial I am using it to apply a coupon to the initial subscription creation
and add an invoice item Then have it resume its cycle with a billing_cycle_anchor of my choosing
The date for the due dates are set dates and i have a specific billing cycle anchor that need to be set on each subscription. Whenever i create a subscription schedule and set the start_date to a unix time stamp and set billing cycle to be set by phase start the anchor is just set to the current date.
Can you provide me with the request ID or a susbcription schedule ID so I can take a look at the creation request?
curl --location 'https://api.stripe.com/v1/subscription_schedules'
--header 'Content-Type: application/x-www-form-urlencoded'
--header 'Authorization: Basic c2tfdGVzdF81MU56bXVlTDdYSWN0R0tHb0pBemk0SUR3a2VtMGI4eFBUekZtVzdORDlrMFduUzNiVjRVbVllMTNHN3VrTVgyYlkwZGRKcUlvOXVwTXRKUGZEQmpueDFLRDAwRHNrWkNLWkw6'
--data-urlencode 'customer=cus_P6fy6kgfXBmapE'
--data-urlencode 'start_date=1694415600'
--data-urlencode 'end_behavior=release'
--data-urlencode 'phases%5B0%5D%5Bitems%5D%5B0%5D%5Bprice%5D=price_1O3Ri2L7XIctGKGove0VoCgS'
--data-urlencode 'phases%5B0%5D%5Bitems%5D%5B0%5D%5Bquantity%5D=1'
--data-urlencode 'phases%5B0%5D%5Bend_date%5D=1710130800'
--data-urlencode 'phases%5B0%5D%5Bcoupon%5D=3dQUsQj4'
--data-urlencode 'phases%5B0%5D%5Bbilling_cycle_anchor%5D=phase_start'
sub_sched_1OMDPuL7XIctGKGovMAv5YhG
Thanks, taking a look
So you pass a single phase and you specify the anchor should start at the start of the phase. What about the resulting susbcriptions is not what you expect?
"billing_cycle_anchor": 1702316238,
"created": 1702316238,
billing cycle anchor is set to the current date no matter which way i create the schedule
You can look into setting the start date in the future following this doc: https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases