#RafaCitec-subscription expiry

1 messages ยท Page 1 of 1 (latest)

weary shadow
#

๐Ÿ‘‹ happy to help

#

could you please elaborate?

hollow hedge
#

thanks

#

yesterday one of your collagues say me that I must use event checkout.session.completed for retrieve expiration_date of suscription

#

I get the expires_at field

#

but this field contains the date of Tomorrow

#

and my suscriptions are of 1 month

weary shadow
#

this is the expiration of the checkout session

hollow hedge
#

ahhh

weary shadow
#

you need to retrieve the subscription

hollow hedge
#

I need the expiration_date of suscription

#

yes

weary shadow
hollow hedge
#

and know that event use for that

#

because with webhook you send me a lot of events

weary shadow
#

but there is no expiration date

hollow hedge
#

ok, but this event not is send me, when a client renew his subscription

#

I receive this events

weary shadow
#

this would be another event

#

yes

hollow hedge
#

I receive in webhook customer.subscription.updated event

#

even when is a new client?

#

with first subscription

weary shadow
#

no that would be customer.subscription.created

#

so this is why you should rely on checkout.session.completed for the first event

#

and use customer.subscription.updated for the future calls

#

and you can always listen to invoice.paid if you're looking for a way to track the customer paying their invoices/subscription fees

hollow hedge
#

I like define a Flow but I can't see it

#

We need only customer_email and expiration_date

weary shadow
#

take some time to read that doc

#

it will explain the whole flow

hollow hedge
#

Ok, I read all

#

using event invoice.paid all my cases are covered

#

either a new subscription or a renewal

weary shadow
#

yes at first I didn't know what the use case is

dusty geyser
#

Hey, taking over here. Let me know if there's any follow-up Qs I can answer!