#maxime_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/1227256194859663450
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Example: I have a default payment method set for a customer:
I've got an active trial for that customer's subscription
When I GET https://api.stripe.com/v1/invoices/upcoming for the subscription, I get "default_payment_method": null, and I don't understand
Oh and precision as well, it's not an invoice, I've got "collection_method": "charge_automatically", in the response
Hi @waxen obsidian so sorry for the delay, the server has been quite busy today. I'm taking a look.
Thanks Toby!
I believe that is correct. I think we leave that field null if it's not direclty provided for the Invoice, and pull from either the Subscription object or Customer object when it is null. I don't think we backfill the field on the Invoice with the value from the Subscription/Customer.
Ok so if I want to know how is the customer going to pay, what's my best option? ๐ค
Check on the current subscription? Get the default payment? But it could be set differently on this particular sub
Check the Subscription, if default_payment_method isn't set there, then look at the Customer object.
Umh.. that's a lot to get from the API. Ok I'll figure something out thanks!
You might be able to get all of it inline in the invoice preview request if you use expand to expand subscription.customer
https://docs.stripe.com/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.