#piq9117
1 messages · Page 1 of 1 (latest)
Hi there
That's correct.
If you want to search by ID then you should just retrieve the Sub instead: https://stripe.com/docs/api/subscriptions/retrieve
If by period end then you want to use our List API: https://stripe.com/docs/api/subscriptions/list
aah. gotcha. thanks so much! 
Sure thing!
oh. got a follow up question. not sure if it's too late for this thread
Sure thing
Let's say I want to query subscriptions that will end tomorrow, i'm not quite sure which one of these I need to use https://stripe.com/docs/api/subscriptions/list#list_subscriptions-current_period_end
if i pass in an exact value, do i just get subscriptions that will end on that exact time?
if i use current_period_end.lte , will that get all subscriptions less than that date?
my intention is to query all subscriptions that will end between 3-28-2023 00:00 and 3-28-2023 23:59
Yep so you want to set current_period_end.gte and current_period_end.lte and use Unix Timestamps for the two values that you want to query between
i can have these two values in one query? or do you mean i make two separate queries?
Yep you can use both parameters in the same request
aah. just to clarify, i'm gonna use the nodejs example. like this?
const subscriptions = await stripe.subscriptions.list({
current_period_end: {
lte: <unixtime>,
gte: <unixtime>
}
});
Yep
gotcha. thank you so much! hopefully that's it for my question. lol 