Stripe API - listing elements in a given order (asc/desc)

Viewed 152

In my Ruby app I am trying to retrieve Payouts from Stripe API.

Following the doc https://stripe.com/docs/api/payouts/list#list_payouts-created

Stripe::Payout.list({limit: 3})

The problem is that I don't see any option to change the sorting order (asc/desc).

I would expect something like this:

Stripe::Payout.list({limit: 3, order: 'asc'})

I couldn't find anything like this in Stripe API doc. Not only for Payouts but actually for any kind of elements.

Any ideas?

1 Answers

That's not possible - the API returns items ordered newest first, usually by created timestamp.

eg: https://stripe.com/docs/api/payouts/list

The payouts are returned in sorted order, with the most recently created payouts appearing first.

Related