#jimmyjimmy-schedule
1 messages · Page 1 of 1 (latest)
hi there, do you mean you want to automatically stop payment after a certain period of time?
yes
looks like subscription schedules are what you're looking for then : https://stripe.com/docs/billing/subscriptions/subscription-schedules
Example : https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases#installment-plans
this is for new customer, they no customer ID
can set schedule during checkout?
how to get customer ID, after checkout?
Hi there! Jumping in for Alex, hope you don't mind.
There are a number of ways, one way I would recommend is to listen to checkout.session.completed webhook events.
Where the underlying Checkout Session contains a field customer, which is the Customer ID: https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-customer
but this field is null
The new way Checkout Session works, if the Customer ID is not defined when creating the Checkout Session, the customer is acknowledged as "Guest", therefore there is no respective Customer object.
You can either:
- create the Customer object in advance and use its Customer ID for the Checkout Session
- or set the Checkout Session field
customer_creationtoalwayswhen creating it.