#mounika_customer-sources-list

1 messages ยท Page 1 of 1 (latest)

cosmic heronBOT
#

๐Ÿ‘‹ 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/1277722426632966288

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

ember portal
#

I am not finding the specific link for the sources list API but if you pass that limit parameter it should give you a longer list back

chilly steeple
#

But in this java object PaymentSourceCollection sources = Customer.retrieve(customerId).getSources() how can i set the limit using java

ember portal
#

Though I think on the call that you make to list more sources you should be able to specify a higher limit. Looking in to what that would look like

chilly steeple
#

Okay Got it, Thanks

ember portal
#

I am still looking in to this. I haven't been able to find an API call to do this. I will ask my colleagues and get back to you.

cosmic heronBOT
median knot
#

Hi ๐Ÿ‘‹

I'm stepping in as my colleague needs to go.

#

Unfortunately you cannot specify more than 10 sources when you retrieve them in this fashion, since you are expanding the sources in a Retrieve call to the Customer API.

You will need to make the first call to retrieve the Customer and a second call to retrieve the sources associated with that customer.

#

This might look like the following:


CustomerRetrieveParams customerParams =
      CustomerRetrieveParams.builder()
        .addExpand("sources")
        .build();


    Customer customer = Customer.retrieve("cus_123", customerParams, null);

    PaymentSourceCollectionListParams sourcesCollectionParams =
      PaymentSourceCollectionListParams.builder()
        .setObject("card")
        .build();

    PaymentSourceCollection collection = customer.getSources().list(sourcesCollectionParams);