Stripe API for getting Ivoices (test mode) is not working

HI
I am trying to get Stripe Invoices (in test mode) using resources (a) Retool provided inbuilt Srtipe API resource (b) REST API resource connecting to Stripe.
I have created two separate queries using above resources. When I run these queries using
GET https://api.stripe.com/v1/invoices (using resource 'a')
GET https://api.stripe.com/v1/invoices?limit=3 (using resource 'b')
As an output, I am getting list of invoices which are not created by me (may be they are some kind of dummy / example invoices which do not have any account attached to them).
When I use above URL and API Key in another tool like HTTPie, Postman, Stripe CLI, I am getting proper output (invoices created by me).
Not sure whether I am missing some thing or is it an issue with retool.
To check whether my API key is being used or not I gave wrong API key and I got an error, hence it is taking the API key provided by me, but returning some dummy data.
I am sharing screen shots

(a) Resource created using Retool inbuilt Stripe API

(b) Resource created Using Retool REST API resource

Stripe Output


Result for (a) - dummy data

Result for (b) - same dummy data

Please suggest how this can be resolved

Thanks in advance

Hey @srichint, according to the Stripe docs, this is expected behavior in test mode.

You should see your actual data by switching to an API key associated with live mode.

Hi
I tried same GET request with Bruno (or may be with Postman) using same test account and I am able to retrieve actual invoices created by me (image attached).
If what Retool is suggesting is true (to switch to live mode), then the basic purpose of having test account and allowing the developer to play with the data using client apps (after implementing business logic), before final publishing would be defeated.
I think there are some gaps that needs to be filled
Thanks

Hey @srichint, sorry misunderstood your issue. Just set up a new Stripe account to test and the API key for 'Test mode' returns the data that I inserted there.

Returns my test data for both customer and invoices endpoints.

Can you check the API logs and see if you see the API requests from Retool there? The API key used is the determining factor on which data is sent back from Stripe, there shouldn't be any additional setup required on the Retool side.

Thanks
Now I am able to get proper test data from Stripe

1 Like

Glad to hear it's working!