#soma - BalanceTransaction created filter
1 messages · Page 1 of 1 (latest)
Interesting. Are the results that you are getting not changing at all?
Do you have an example charge that is being returned from before that timestamp?
thanks for responding
I have 8 items in the balance list
these items are returned over and over
no matter what the "created" parameter is
Can you send me the 8 items that you are getting?
This filter is working for e at the moment, unsure what may be going wrong here
how can I do that?
I just meant like pasting the json response here
can you show me the curl you are sending?
Was doing it in python but can figure out the curl, one minute
Sorry I'm kind of new on this, and discord is telling me the message I was trying to send to you as json is too long
this is my curl:
curl --location --request POST 'URL'
--header 'Authorization: Bearer token'
--header 'Content-Type: application/json'
--data-raw '{
"limit": 10,
"currency": "usd",
"created": {
"gte": "1653609600"
}
}'
Interesting. When I make that curl call I also do not see the filter work
Checking in to what we see on our backend...
by the way is there any playground for testing the api?
Ah it looks like we don't get the body at all from that curl command
Yes there is
If you create an account with us you will get a test mode API key that you can use to create your own data
how so?
Or you can use your existing account in test mode which it sounds like you have
That was poor language on my part, I don't see the request body that you pass in via --data-raw in my own API logs
then how can I send it properly in nodejs?
So here is a modified version of the curl command from our docs, it works for me
-u sk_test_12345: \
-d limit=3 \
-d created[gte]=1653609600
-G```
Our node-js library has a way of sending this parameter. Can you show me your node code that you are currently using to make this call? https://stripe.com/docs/api/balance_transactions/list?lang=node
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
you are redirecting me to the same documentation I've been consulting
could you share with me a single example on how to manage this using nodejs besides the example in the documentation related to the limit?
Yep I can figure out the node.js syntax, will get back to you when I have it nailed down
Can you send me your current node code?
sure
const resp = await stripe.balanceTransactions.list(body);
from here body is
const body = {
limit: 10,
currency: 'usd',
created: {
gte: "1653609600"
}
}
Interesting, that code works for me
limit: 3,
created: {
gte: 1653609600
}
}
const balanceTransactions = await stripe.balanceTransactions.list(body);```
That only gives me balance transactions after that timestamp
I was testing with 3 as I only have 2 after then.
Does the limit variable work for you? If you change it to be less than 8 do you get less than 8 transactions back?
it was working last time I checked... please, let me retry
nothing seems to be working on my side
thanks for your time
I will try to figure it out by myself
I note soma shows the timestamp as a string, and you as a number
documentation says: A filter on the list based on the object created field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with the following options:
Shame it didn't help - just noticing differences.
String works for me as well.
Can you try the request again and send me the request ID from it? I can check what we see on our backend https://stripe.com/docs/api/request_ids?lang=node
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Was bouncing around to other threads. Checking in to that request now
Interesting. I am not seeing a request body on that call either. Wonder if it is a difference in our stripe-node bodies or something
this is overwhelming
I'm sorry to hear that. I am really not sure what might be happening here. Trying to think of what differences might cause this
Out of curiosity, are you running this code locally?
yes, I have a local server of express pointing to stripe
I think that I found the issue
Nice! What is it?
taking over for Pompey! are you getting any results from this request, or any errors?
got it, thanks for clarifying. could you share which version of the Stripe API you're using for these requests?
thanks for confirming. this might take me a bit to test
I thank you
hey stripe guys, do not look anymore, the thing is this
await stripe.balanceTransactions.list(body, {
stripeAccount: stripeAccountId
});
you need to pass the stripeAccount as an option
I thank you guys for your time and I thank you so much for walk this with me. I hope this might be helpful next time