#Munaim-subscriptions
1 messages ยท Page 1 of 1 (latest)
ok let me clear you a scenario
I have created a schedule subscription of customer and the schedule time is today and that schedule subscription was converted into subscription now how Can i know that schedule subscription has been converted into subscription successfully?
How Can i get the subscription which previously a schedule subscription of particular customer?
Do you understand what i want to say?
sure, I think so
how Can i know that schedule subscription has been converted into subscription successfully?
it fires acustomer.subscription.createdwebhook event
and the Subscription links to the Schedule that created it : https://stripe.com/docs/api/subscriptions/object#subscription_object-schedule , so that's how you know
you have to use webhooks to use Stripe Subscriptions, it's not optional
I am using stripe prebuilt page
Let me clear you a full problem
I Have a scenario.Suppose I have following package plans
Three months (One Time Payment):
Basic
Standard
Professional
One month Subscription ( Recurring )
Basic
Standard
Professional
Now i want to deduct payment for three monthly basic one time only and after deduction I have created schedule subscription for basic one month recurring.
Now Three months finished and that schedule subscription is now converted to subscription. I want this latest subscription of that customer.
Important Note:
I am using stripe prebuilt or hosted page for one time payment deduction.
Dear Stripe has converted schedule subscription to subscription on it's end now I want to call stripe api for this subscription of particular customer.
Which api is useful for me for knowing latest subscription of that customer
we'll send you a webhook when we do that conversion! at which point you can update your own records.
if you only have "schedule subscription i d or customer id" as you said, then you could try listing the customer's subscriptions (https://stripe.com/docs/api/subscriptions/list#list_subscriptions-customer) and looking for the one matching the schedule you're interested in(https://stripe.com/docs/api/subscriptions/object#subscription_object-schedule).
I am creating a cron job for this task after this months this cron job run and update the record and in this cron job i want latest subscription of customer
ok! you should use webhooks but I guess I can't convince you.
How can I use web hook in cron job?
you wouldn't use a cron job at all
My scenario needs a cron job dear
like you are telling Stripe to schedule something in the future, and we do it for you, and then we tell you when it happened by sending you a webhook
Can I get the latest invoice of customer?
so it makes no sense to me to use a cron job, since Stripe is the one doing this, you just have to react to what changed
anyway I have to go! my colleague @limpid kayak can help if you have more questions.
ok
@old widget Let me know if I can help!
Just catching up ๐
Well, @obtuse ermine already answered you โ you should use webhooks with the associated events. But I guess there's a endpoint you could call (with paramaters): https://stripe.com/docs/api/subscriptions/list
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
You should pass the customer parameter, as long with a limit of 1 and also status to only get the active subscription
ok thanks