#marvin_api

1 messages ¡ Page 1 of 1 (latest)

sacred edgeBOT
#

👋 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/1268189679673675809

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

safe meadow
#

Found some information online thats it is sorting by `created` from newest to oldest, but nothing official from stripe and we are not sure whether we can rely on that.
Yeah AFAIK all our list endpoints are newest to oldest

#

Is there a reason you need results in a particular order? What's the context/what are you trying to implement?

dusty magnet
#

Thank you for the quick response. It is basically for a subscription history overview. To display them from oldest to newest

safe meadow
#

It is basically for a subscription history overview
For a particular customer?

dusty magnet
#

Yes, each customer has his profile page with a subscription history

#

so we fetch subscriptions as well as schedules with the customerId and then display them in their profile

safe meadow
#

Yeah I recommend you store this data in your database instead to reduce GET calls to our api

#

You shouldn't really have a lot of GETs in your integration, especially on pages where customers frequent

#

This could easily rate limit you

dusty magnet
#

we are currently also in the process of implementing that, but we still wonder if we can basically just reverse it or whether we should implement our own sorting logic

safe meadow
#

If storing in your own db, you should store the subscription created date as a column, that way you can just write a db query to return and sort them

dusty magnet
#

I see your point, but this is not answering the question. The question is whether we can rely on the default sorting which seems to be newest to oldest

safe meadow
dusty magnet
#

Okay, thank you. There is no official documentation regarding that or?

safe meadow
#

Normally we specify on the endpoint description, but we don't say for subscriptions

#

I can confirm it's newest to oldest

#

Idk if it'll change, but I doubt it