#clement2931
1 messages · Page 1 of 1 (latest)
Hi, this API is a bit uncommon one and yes it expects a customer id
Returns a list of PaymentMethods for Treasury flows. If you want to list the PaymentMethods attached to a Customer for payments, you should use the List a Customer’s PaymentMethods API instead.
There are currently no way to list all Payment Methods of all customer
Ok, but it says that the customer parameter is optional
And it does return a response even without providing a customer id
It doesn't make sense that adding some filters would result in more results being returned, does it?
@tawdry geyser are you still here?
Yes, I know it says optional but it's an UI bug we needed to fix, sorry
(We have received similar asks in the past)
are you saying that the doc should say that the customer is a required parameter instead of optional?
a bit different. Requied means if you don't supply it, the API will error. Here it doesn't error but return an empty list. I know it's meaningless and that's something we will improve
I guess I don't see the point of making it optional, if the result is always an empty list when it's not provided?
Yes you are right. It's Doc issue. What are you trying to achieve? Do you want to get all Payment Methods regardless of customer id?
I'm trying to list all payment methods of all customers
I guess I have to paginate through each customer?
What is the difference between api.stripe.com/v1/payment_methods?customer=<customer_id>
AND api.stripe.com/v1/customers/<customer_id>/payment_methods?
Yeah you would need to go for each customer unfortunately. api.stripe.com/v1/customers/<customer_id>/payment_methods? is the recommended API. The other one is on a Treasury flow which is uncommon
Theoretically yes. But my advice is just don't use the Treasury one
that's scary when an API returns results only in theory. please update your documentation, it's extremely confusing.
Yes I will forward your feedback
thanks