Download Recurring Invoice PDF over API

Version v5.11.61

Environment Docker

Describe the bug

When trying to download a recurring invoice or quote via the public API using the /download endpoint, the response returns a corrupted PDF file or HTML instead of a valid PDF. This happens even though the invitation_key is correct and authentication headers are in place.

PDF’s work fine when logged into the portal itself and I am able to use the API for other things.

Steps To Reproduce

1.	Make a GET request to: 

curl -X GET “https://your.domain/api/v1/recurring_invoice/{invitation_key}/download
-H “X-API-TOKEN: YOUR_SECRET_TOKEN”
-H “X-Requested-With: XMLHttpRequest”
–output test.pdf

    2. Save the response as a PDF file

    3. Attempt to open it — the file appears corrupted or opens blank|

Expected Behavior

A valid PDF file containing the invoice or quote should be returned and rendered in the browser or PDF viewer.

Additional context

I am trying to integrate with my PHP website and get the same problem with invalid PDF.

Screenshots

Logs

No logs related to this.

Hi,

Recurring invoice PDF’s aren’t meant to be downloaded. When the recurring invoice runs it will generate a standard invoice which can be downloaded.

Hi,

Thank you for clarifying this.

Many thanks,
Luca