#gecko - Subscription Events
1 messages · Page 1 of 1 (latest)
Hello!
I don't think incomplete_expired would be possible. For canceled let me think about that a moment...
well...here's my problem:
case 'customer.subscription.created':
this is an event type i switch on, from webhook handler
and I'm getting those as error conditions
when I look at the docs, it doesn't show these as part of the enum
I do think canceled would be possible in certain situations if your payment retry settings were configured in a certain way.
Which docs are you looking at?
so I wonder A) why this is showing up in this event, and B) what are the possible enum values overall, so I can handle them appropriately
That's a Checkout Session. A customer.subscription.created event contains a Subscription object, not a Checkout Session.
oh yes wrong tab....hang on
This is the status on the Subscription object: https://stripe.com/docs/api/subscriptions/object#subscription_object-status
status
enum
Possible values are incomplete, incomplete_expired, trialing, active, past_due, canceled, or unpaid.
this is for the customer subscription status....if I'm reading right....I check here, right?
and of all these, only "active" represents a "paid" scenario?
or does trialing count as "paid" too?
Trialing means there's a free trial, so nothing has been paid yet, but the Subscription should be considered in good standing.
got it
in this case, I'm trying to adjust the subscription, and was advised here previously for a new subscription, to move the trial_end to my date desired. and this update is failing because I'm trying to do it on invalid enum cases
so I think i just need this for "trialing" cases, and "active" ones don't?
Not sure I understand, can you provide more details about why the update is failing? Do you have request ID showing the error?
sure
req_7ZhZyxV8jxieea
this case of why it failed, I understand...it's an incomplete transaction that timed out
Ah, gotcha.
but my question is about these new subscriptions
I have a customer who signs up today, and I want recurring to be 1st of the month
It looks like that Subscription was canceled in the Dashboard here: https://dashboard.stripe.com/logs/req_ETkIkBWsezoqw5
so I was told to set trial-end to be the right epoch i want
and set proration to none
which is what I want
so when....does "active' status get used in an event context? will a customer.subscription.created have 'active' and 'trialing' to me? when do these occur, in what order....hopefully this makes sense
A subscription that is currently in a trial period is trialing and moves to active when the trial period is over.
this implies to me that all would start as a trial, regardless?
i create a checkout sesion with mode set to subscription, but nothing about a trial....it's started this way for me....so what comes first, trial, even though they've paid?
sorry it's just non-obvious, the flow for me
Any Subscription that starts with a trial period will have a status of trialing. Any Subscription that's created without a trial and has successfully been paid, or if there's no payment due, will start with active.
Does that help?
hmm
maybe
I do a create checkout, subscription mode, and no trial in any parameter. in this case, the status will be active, as soon as payment is successful?
Yes.
ok good.
now if I "update" a subscription, will this trigger a 'trialing' status?
i.e. can it go from active to trialing?
Yes, that's possible, if you add a trial like you're talking about above.
ok, got it. thanks.
now as a recurring subsciption occurs (renewal)....will this cause a checkout.session.completed type event, and not a customer.subscription.xxx type event...right?
No.
checkout.session.completed events only come from Checkout. Checkout is only used to create the Subscription. After that you'll get no more Checkout events related to that Subscription, only Subscription events: https://stripe.com/docs/billing/subscriptions/overview#subscription-events
ah...checkout is only for the setup or the one-time....thanks!
Yep!
so if I want to catch the renewal events, I can listen for 'invoice.paid', right?
yep, and you can look at the billing reason to see if it's for a new subscription or a renewal : https://stripe.com/docs/api/invoices/object#invoice_object-billing_reason
wouldn't subscription status tell me that...by trialing or by active?
maybe can you share more on what you're trying to achieve here by trying to catch the "renewal events"?
let's stay on invoices
invoice.pad event: invoice.billing_reason === subscription_create is a payment succeeded for the first time a subscription is created. and invoice.billing_reason === subscription_cycle is for payment succeeding on the subsequent renewal cycles. right?
yes, that's correct
ok thx much! support here is always top notch!!!!