#Hellruba
1 messages ยท Page 1 of 1 (latest)
Hi! Let me help you with this.
hi ๐
Stripe does not guarantee order when delivering webhook events: https://stripe.com/docs/webhooks/best-practices#event-ordering
Yes but the stripe returned subscription upon the call of create subscription, is the status returned of it the one after all those event are made or can his status differ afterward because some of the event above are still running?
Sorry, I'm not sure I understand. What are you trying to do?
Upon the call of create subscription, we have as a value return a stripe subscription. The status of this subscription can either be "active" or "incomplete" but not quite sure that status is the one set after all the event mentionned above ran. Want to cut a specific flow in case the subscription returned is "incomplete" but for that, need to be certain that the status from the stripe subscription object returned in stripe.subscriptions.create is the current status of the subscription after all event above ran.
I see. How are you creating your subscription? Could you please share a subscription ID? sub_xxx
const params: Stripe.SubscriptionCreateParams = {
customer: stripeCustomerId,
items: [{price: stripePriceId }],
metadata: {
organizationId,
},
default_payment_method: stripePaymentMethod,
automatic_tax: { enabled: true }
}
console.log('params: ', params);
const res = await stripe.subscriptions.create(params);
console.log('result subscription: ', res);
``` Here how i create the subscription in my backend, and the res object is the returned subscription from creation. That the one i wonder if the status i get from it is the actual status of the subscription or if it is prone to again change. If it's actual status upon creation then i can cut my flow with the error i want to show otherwise gonna change my flow
a sub id example in case incomplete: sub_1MEwsjEKfryekeRfJmpmoCWT
You should rely on webhook events to decide on the status of your subscription. Listen to customer.subscription.created and customer.subscription.updated and check the status. Then, decide if you should start providing your service/product or not.
ok thanks
Happy to help. Let me know if you have any other questions.
sure thx ๐