#jesse677_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1270011561209233542
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
When I tried getting the customer via customers.retrieve, I wasn't able to access the user subscriptions in the customer object
Hi ๐ checking to see if this is possible with our object structures, but if so you'll use our expand functionality for that. You can start to read about it here while I look at the object structures real quick:
https://docs.stripe.com/api/expanding_objects
Do you know if you're storing the default payment method to be used for the Subscription on the Subscription object? Or are you using the Customer-level default payment method for those?
let me check
in the subscription, I'm storing the pm_123, but not the actual card
Gotcha, but it is on the Subscription object, in this field?
https://docs.stripe.com/api/subscriptions/object#subscription_object-default_payment_method
If so, you can retrieve the Subscription object and use expand to expand the default_payment_method field inline in the response.
Then you'll be able to step into the default_payment_method field and find the full Payment Method object rather than just the ID. But let me know if that doesn't work for you.
I'll try it now
like this?
const subscription = await stripeInstance.subscriptions.retrieve(
subscriptionID, { expand: ["default_payment_method"] }
);
Yup, looks right