#Rita Ly
1 messages · Page 1 of 1 (latest)
Hi! Let me help you with this.
You can use trial_period_end property: https://stripe.com/docs/api/subscriptions/update#update_subscription-trial_end
trial_end
optional
Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value now can be provided to end the customer’s trial immediately. Can be at most two years from billing_cycle_anchor.
I saw that previously, but this is API parametr which I can post.
I need the webhook that is incoming from stripe, and I listen to it
https://stripe.com/docs/webhooks
2 scenarios
User has the subscription valid until 10 april 23
👉 Customer support adds +10 days immediatly in Stripe panel
or
👉 Customer support adds schedule +10days when starting from the last day of current subscription in Stripe panel (so it should start at 10 april 23)
In both cases I need to track this information in my service so prolong current subscription in our database so user's subscription end is 20 april 23
I don't see this field
You don't see which field?
I want to use your webohooks, but there's no documentation of sys hooks. So how can correctly distinguish between the two scenarios
(which webhooks or webhooks & fields listen to) to get information about eligible free days
Well, which event(s) are you listening to? In the scenario you describe, I imagine customer.subscription.updated & subscription_schedule.created
yes I have customer.subscription.updated
and which fields?
we are currently not using subscription_schedule.created but is this hook comming immedietly
customer.subscription.updated will have a trial_end timestamp: https://stripe.com/docs/api/subscriptions/object#subscription_object-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.
and how about subscription_schedule.created but this one is also send immediatly and there will be info about trial?
do you have example event payload?
I just don't wanna to lose this threat
The payload is just the Schedule object. You'd check the phase.trial_end field: https://stripe.com/docs/api/subscription_schedules/object#subscription_schedule_object-phases-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.