#tonymx227-subscription
1 messages ยท Page 1 of 1 (latest)
Hi! You can use this to directly create a Subscription: https://stripe.com/docs/api/subscriptions/create
If you want the subscription to be active without a payment method, then you could add a free trial to the subscription.
Ok but I have two questions :
=> how to create a customer ?
=> And the last one, is that possible to update the current_period_end of a subcription ?
how to create a customer ?
With this: https://stripe.com/docs/api/customers/create
And the last one, is that possible to update the current_period_end of a subcription ?
Can you clarify what you are trying to do?
I got a error => This customer has no attached payment source or default payment method
an*
Have you set payment_behavior: default_incomplete when creating the subscription? Otherwise it will require a payment method. https://stripe.com/docs/api/subscriptions/create
Ok it works with "payement_behavior". And is there any way to specify the first date of paiement ?
Add a free trial, either with:
Ok thank you it works, and to update the paiement method of this subscription with a checkout session ?
(because I have not use a checkout session to create the subscription)
You could create a Checkout Session in setup mode https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-mode for the customer, and then set that payment method as the default one for the customer (or the subscription)
To set the default Payment method:
Glad to hear! My teammate needed to step away, but I'll be sure to pass along your thanks. ๐
Sorry I have another question.
Do we have a webhook to capture only the update method paiement ?
There's the payment_method.updated event type that you can listen for:
https://stripe.com/docs/api/events/types#event_types-payment_method.updated
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ok thank you !