#twinkle0293
1 messages · Page 1 of 1 (latest)
Can you share a request id where you try this?
I am not sure how to retreive the request id
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
req_Vn36eebl8w6XgP
On the stripe docs, under payouts I see
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
I see 2 payouts were returned for that request though
So I made one call, but on your side, I believe it calls based upon the starting_after filter<
So if you see that request, at the same time multiple requests have gone through
which means I made a single call with a limit but on your end multiple calls were made
That's not how starting_after works though. It still only makes 1 request and just returns results after that page
Is your code implementing pagination
That would explain the multiple requests
We won't automatically make any requests like that
params := &stripe.PayoutListParams{}
params.SetStripeAccount(account)
/limit := int64(10)
params.Limit = &limit/
// Expand Destination object for each Payout & include total count of result set
destinationExpansionKey := "data.destination"
includeFilterKey := "include[]"
totalCountFilterParam := "total_count"
emptyOperationParam := ""
params.AddExpand(destinationExpansionKey)
params.Filters.AddFilter("limit", "", "3")
params.Filters.AddFilter(includeFilterKey, emptyOperationParam, totalCountFilterParam)
i := payout.List(params)
count := 0
for i.Next() {
p := i.Payout()
fmt.Println(p)
count++
}
hasMore := i.Meta().HasMore
fmt.Println(hasMore)
fmt.Println(count)
I am not Using pagination
and the hasMore fmt prints 155
even though I passed limit 3, it still returned me all the payouts
That is auto pagination
Where did you get that code?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I wrote it to test limit
You just told me you don't have pagination
The above is autopagination
That's why you get back more than 3 results
How can we get the required limited payouts in a single request?
I thought If I applied the limit to 3, List should return only 3 objects but I guess when I am iterating over the list, it's actually doing each request one by one
Just remove the autopagination
If you only want to run one request and return 3 results
got it, let me try
it worked, thankyou
now if I want to fetch the next payout, how would I do that?
and how do we apply skip?
yes, in the documentation I see if has_more is true, we should get next_page, which object returns next_page ?
I don't see it in meta
next_page
string
A cursor for use in pagination. If has_more is true, you can pass the value of next_page to a subsequent call to fetch the next page of results.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
thankyou
is there a way we can filter the payouts on the basis of amount, I see other filters like date and status
Unfortunately not