#harshitbhargava
1 messages · Page 1 of 1 (latest)
I mean when i retrieve through api
You can use List customer's payment methods API: https://stripe.com/docs/api/payment_methods/customer_list
The list API represents in a reverse chronological stream of object
Yes i am using the same api si when i do get(0) i will get newly added payment method
?
Is this correct?
Yup! Or you can check created parameter for the latest payment method added: https://stripe.com/docs/api/payment_methods/object#payment_method_object-created
In created parameter what i have to send?
No, created is the timestamp that a payment method was created. It can used to determine the latest payment method created
Ok got it
Then its very difficult to check the latest payment method added through created parameter
Why is it difficult? You should only need to check the created with the largest number, or you can get the first object for the latest payment method since Stripe return the objects in chronological order