#Beans
1 messages ยท Page 1 of 1 (latest)
Yup. Retrieve the Subscription from the API. Expand the latest_invoice property (https://stripe.com/docs/api/subscriptions/object#subscription_object-latest_invoice), and check the status of the invoice.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
When i pull up the subscription i only get the invoice id?
So i need to do another request?
For retrieving the invoice
No, you need to expand the latest_invoice property.
https://stripe.com/docs/api/expanding_objects
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ohh nice
Or, alternatively, you could make a second API request to retrieve the Invoice (if it's a one-off).
https://stripe.com/docs/api/invoices/retrieve
But the expand option is better if you will make repeat calls
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
How can i use expend in Stripe Shell ๐
stripe subscriptions retrieve sub_id --expand ??
i got it
stripe subscriptions retrieve sub_id --expand latest_invoice
Bingo
Thank you! You help so much ๐