Unable to download Stripe quote

Hi folks,

I'm using the built-in Stripe resource to create customers, products, quotes and invoices. Everything is working swell so far. But now I'm having troubles with downloading a PDF from a quote. I get the following error:

{"status":400,"message":"","error":{"message":"Unrecognized request URL (GET: /v1/quotes/qt_1OcSOGFAulxHvzfHYhC85d6B/pdf). Please see https://stripe.com/docs or we can help at https://support.stripe.com/.","type":"invalid_request_error"}}

The Stripe docs tells you to use the endpoint GET /v1/quotes/:id/pdf. But it's with a different base url than the other endpoints. It should be files.stripe.com instead of api.stripe.com (see Download quote PDF | Stripe API Reference). Took me a while to spot that.

I believe it's a bug that should be fixed inside the resource definition.
Is there a workaround other than using a extra REST API resource for this and setting up authentication myself?

Thanks for any help.

Hello @David_Maneuver,

The issue you're experiencing with downloading a PDF from a Stripe quote is a known limitation with the built-in Stripe resource in Retool. The Stripe API uses a different base URL for downloading PDFs compared to the other Stripe API endpoints.

Unfortunately, there is no built-in workaround for this within Retool at the moment. The only option would be to create a custom REST API resource to handle the PDF download, as you mentioned.

Here's a potential workaround you could try:

  1. Create a new custom REST API resource in Retool, with the following configuration:

    • Base URL: https://files.stripe.com/v1
    • Authentication: Use the same Stripe API key as your other Stripe resources
    • Endpoint: /quotes/:id/pdf
  2. In your Retool app, use this custom resource to download the PDF, passing in the quote ID as a parameter.

This approach will allow you to download the PDF without having to set up authentication yourself. Just make sure to use the same Stripe API key as your other Stripe resources.

Hope this helps! Let me know if you have any other questions.

:grinning:

Patrick

Hi @PatrickMast,

Thanks for your reply. I understand that this is a current limitation.
I will try your proposed solution and get back to you.

gr.