#adityalystlocdeveloper_33428

1 messages · Page 1 of 1 (latest)

hidden thunderBOT
#

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.

cedar tree
#

Hi there!

gusty fern
#

await stripe.subscriptions.update(subscription.stripe_subscription_id, {
trial_end: "now",
billing_cycle_anchor: "unchanged",
});

cedar tree
#

it's difficult to understand the issue. can you share a concrete example of Subscription ID (sub_xxx) with this issue?

gusty fern
#

sub_1OMRd5ARWDrZZuiftOGWWCci CHEACK THIS SUBSCRIPTION ID

#

subscription created 12 dec but i have usage limit in trial if user crosses that limit i want to set trial end now but billing anchor should be same first day of month

silent quail
#

you'd need to track the usage you are reporting from your side and then manually call the API to end the trial when your system decides it's time to do so.

gusty fern
#

if (subscription.trial_trans_count + 1 > subscription.PlansFeature.trial_trans) {
const currentSubscription = await stripe.subscriptions.retrieve(stripe.stripe_subscription_id);
await stripe.subscriptions.update(stripe.stripe_subscription_id, {
trial_end: "now",
billing_cycle_anchor: currentSubscription.current_period_end,
});

#

i am doing that only

#

but it resets billing anchor thats the only issue

silent quail
#

ending a trial will always reset the billing cycle to the current time yes

#

there is not really a way to avoid that

gusty fern
#

is their way to set billing from trial end to next month first day

#

when trial end

silent quail
#

you could make a separate API call that sets billing_cycle_anchor, after the API call that sets trial_end:now

#

make sure to use proration_behavior:none to avoid possible issues

gusty fern
#

so two api calls first ends the trial and second billing anchor?

silent quail
#

yes

gusty fern
#

hen updating an existing subscription, billing_cycle_anchor must be either unset, 'now', or 'unchanged'?

silent quail
#

ah yeah, I forgot you can't do that. The only way to change the billing cycle is with a trial.

gusty fern
#

how to achive this behaviour not getting

silent quail
#

sorry, I didn't understand that sentence.

gusty fern
#

what to do now?

silent quail
#

ultimately this is not behaviour that's really possible to have. Ending the trial will reset the billing cycle anchor. Using a trial is also how you set the billing cycle anchor. So either don't end the trial, or just set trial_end to your current_period_end directly.

gusty fern
#

actully i have limit in trial so i have to make use of active plan so that one is needed

silent quail
#

sorry, I didn't understand that sentence.

gusty fern
#

can we set start date and end date manually after trial end?

silent quail
gusty fern
#

can you help me if customer exceed the limit will charge that customer is this possible in metred

#

i will give the no of api hits done by the user

silent quail
gusty fern
#

will create this while creating subscription

hidden thunderBOT
valid whale
#

👋 taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

gusty fern
#

is it possible to add this threshold only for trial period

silent quail
tulip meadow
#

@gusty fern I've just open it

gusty fern
#

so we can add threshold in trial then how can we solve this issue basically i want to set usages limit in trial

#

@tulip meadow ?

tulip meadow
#

You need to track the usage in your integration in that case

gusty fern
#

i have usages track

#

basically i want to do when limit exceed trial end now

#

that one is working but not able to set billing anchor

tulip meadow
gusty fern
#

api is not failing

#

let me explain you in very simple words

tulip meadow
gusty fern
#

I have my application in which i am charging user according to number of api hits done by the user.
So my plan is flat rate+metered volume usages.
I have billing anchor at starting of every month.
e.g i have one plan in which $99 is fixed and 0.02 per api hit.
So if user subscribed to plan i am taking 99 upfront then 0.02 * no of hits.
In every plan i am giving 14 days trial with 25000 free hits.
So if user cross this 25000 hit before trial end i want to end the trial.
So user can use actual plan and will charge accordingly.
But when i am ending my trial my billing anchor gets effected.
eg DATE -1 user subscribed to plan till date-14 user have trial but user cross this limit on day 7 so i want to end trial and user plan will be from day 7 to next month 1st

#

When i am ending trial it behaves trial end date + 30 days

#

just issue with billing anchor

#

i want billing anchor for every month first day when i am ending trial early

tulip meadow
#

Thanks for sharing these details

#

now could you create a concrete test using Stripe test clock

#

But when i am ending my trial my billing anchor gets effected.
and share the requestId that is affecting the billing anchor and what are you expecting.

gusty fern
#

req_YLpX1rA3q3AHmx this this id

#

i ended trial but billing goes to 12 jan but i want 1 jan

tulip meadow
#

You can update the billing cycle anchor when updating the Subscirption

#

But you can update it only to now the datetime on which you made the request

#

you can't update it to a feature date

gusty fern
#

is it possible to billing should 12 - 1 jan when trial end

tulip meadow
#

This is a custom period, while you are using a monthlt prices

#

Try using subscription scheduler

gusty fern
#

can we end trial in schudle

#

first we will convert subscription in schudle then will end trail and modify start end date and remove schudle again is this possible

tulip meadow
#

You can end a trial in a schedul yes

#

I invite you to do some tests