#zachucks
1 messages ยท Page 1 of 1 (latest)
Hello ๐
Subscription can change in a way but the ID still stays the same (unless you cancel it and re-create it)
You can use List Subscriptions API and pass customer ID as parameter to retrieve all subscriptions for a customer
https://stripe.com/docs/api/subscriptions/list
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
is there a way to limit the list subscriptions api response to active subscriptions only?
excellent thank you!
๐
is it possible to get sample data structure for checkout.session.completed post request for the webhook?
You can trigger a test mode event for this
https://stripe.com/docs/webhooks#trigger-test-events
i did try this, but the subscription was null in the test event, so i couldn't see what i could grab data wise, and the customer was null as well
Ah the fixure only creates a test mode event for "payment" mode.
The other option is to create a test mode checkout session for a subscription and complete it.
It should generate a checkout.session.completed event
is there any documentation on how to do that, or do i just enable test mode on my account and re-create the webhook for test mode?
Documentation for what exactly? We have a guide for creating a subscription with checkout here
https://stripe.com/docs/billing/subscriptions/build-subscriptions
It also covers webhook handling.
i just put my account in test mode and made a payment link and did a test subscription that way and was able to get the data i needed. thanks!