#akdj_subscription-list

1 messages · Page 1 of 1 (latest)

tulip meteorBOT
#

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

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

digital haven
#

Current period refers to the start and end of a subscription's cycle that is active right now. I am trying to think of how you could try to find subscriptions that were active at a different point in time. Can you tell me a bit more about your subscriptions? Are they all monthly? or do they have different periods?

sullen fossil
#

I don't know if it's ‘monthly’ or not, they can start at any time, but the duration of the period is a month, for example if the subscription cycle started on the 15th of the month, it will be renewed on the 15th of the following month.

digital haven
#

Gotcha, still thinking on this and will get back to you

sullen fossil
#

thank you!

digital haven
#

So I think what you will have to do is write a query using our search API. It looks like the fields in the list API aren't flexible enough for this. Still thinking about what the actual query should be. I think it will basically come down to if the subscription was created before the end of september and then whether it is still active or has a cancelled_at that came after the start of september
https://docs.stripe.com/api/subscriptions/search
https://docs.stripe.com/search#query-fields-for-subscriptions

tulip meteorBOT
sullen fossil
#

ok, so I should do a search request with a query like created > 'aaa' and cancelled_at > 'bbb' ? can you confirm me that created and cancelled_at are referring to the subscription cycle? for instance, the user subscribed at Aug 2024, and had a renewal in Setp 2024, does created will be updated to the September renewal date ? same question for cancelled_at, is it the end of renewed perdiod or the end of Aug subscription ?

tulip meteorBOT
formal bolt
#

@sullen fossil no it will not be updated

#

akdj_subscription-list

#

We don't have anything similar to what you describe in our API where you can find Subscriptions that were active during a certain period

sullen fossil
#

ok, thank you 🙂

#

will try to find another way

#

is it possible to do a query with cancelled_at = null?

#

I would like to do something like

{
  created_at: {
    lte: 1725148800,
  },
  cancelled_at: {
    gte: 1727654400,
    or: null? 
  },
}
formal bolt
#

If you use the Search API you can do (canceled_at>1721521117 OR canceled_at:null) I think