#lockekosta_api

1 messages ¡ Page 1 of 1 (latest)

fickle cypressBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1255906072229707847

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

fair zinc
#

I'm doing something like this:

timeToCheck = datetime.today() - timedelta(days=30) subs = stripe.Subscription.list(limit=50, created= timeToCheck)

Of course, this is only checking for subs created on that specific date but I'm trying to get any made on or after said date.

The documentation says that the created parameter can return subs "created during the given date interval" but I can't seem to figure out how to set an interval instead of a specific date.

gritty breach
#

that is greater than or equal to

fair zinc
#

created.gte = doesn't work, nor does timeToCheck,gte so I'm at a loss as to how to implement the .gte

#

I've also tried gte(timeToCheck) and (timeToCheck).gte

gritty breach
#

What do you mean it doesn't work

#

That's the parameter to use

fair zinc
#

subs = stripe.Subscription.list(limit=50, created.gte= timeToCheck)

returns: SyntaxError: expression cannot contain assignment, perhaps you meant "=="?

subs = stripe.Subscription.list(limit=50, created.gte== timeToCheck)

returns: positional argument follows keyword argument

gritty breach
#

Yeah that's not valid python syntax

#

If using python you need to pass as a dictionary

#

ie: created={'gte': time}

fair zinc
#

What kind of data is it looking for? I now keep getting "Invalid integer" in response and I'm tried both unix and just normal datetime notation

#

Nvm

#

I was being dumb.

#

Thank you for your help

gritty breach
#

No problem