#eugnie-uyb_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/1329468992519274548
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello
What do you mean exactly by "the payment methods on a related Invoice"?
You are trying to retrieve the PaymentMethod used to pay an Invoice?
Hello I want to get the payments methods available to pay an invoice.
Like the payment_method_types?
Let's back up
What are you trying to accomplish here?
I want to get a list of invoices to implement in my app. And in the list I want to show the active types of payments methods so my clients can see how they can pay their bills. But I have trouble finding how to get this information with an API call.
When you say "active type of payment methods" do you mean those already attached to a Customer? Or what could potentially be collected to pay the Invoice?
the ones already attached to a customer
Okay then you do want to use the List a Customer's PaymentMethods endpoint: https://docs.stripe.com/api/payment_methods/customer_list
The request you shared above is for the List PaymentMethods endpoint which is only relevant for Treasury flows and wouldn't return what you want here (see: https://docs.stripe.com/api/payment_methods/customer_list)
When I tried use the List a Customer's PaymentMethods endpoint I have no data but I can see this on the dasboard :
Those are the information I am trying to get
That indicates the new payment methods that can be collected to pay the Invoice
That does not indicate those are already collected and attached to the Customer
ok I see, how can I get the new payment methods ?
To get that list you can retrieve the Invoice and look at payment_settings.payment_method_types: https://docs.stripe.com/api/invoices/object#invoice_object-payment_settings-payment_method_types
I my invoice object te payment_method_types is null :
Can you share the Invoice ID?
Ah actually that is likely null unless you are setting it explicitly. Sorry, you wnat to expand the PaymentIntent and look at its payment_method_types
If you aren't familiar with expansion then see: https://docs.stripe.com/expand
in_1MH8F3JpByXW1DEUFHGuiJkH
Yeah sorry, you'll want to do the above instead.
Thank you I will try to expand te payment settings
Hello again, I tried to expand data.payment_settings but I had no much more infos; So I tried to expand data.payment_settings.payment_method_types but I had an error message saying : "This property cannot be expanded (data.payment_settings.payment_method_types)"
You should expand payment_intent
Then you look at the payment_intent.payment_method_types
Ok, I tested that and I got what I want. Thank you very much for your time.