How to get invoice PDF and display to user

Short question: Using the get_invoices endpoint, when I try to access the URL from the InvoiceFiles.pdfFileUrl response, it pops up a api.zuora login form. I need my customers to be able to access these PDFs.

If I enter my Zuora creds, it will display the invoice, but of course my customers don't have Zuora creds.

Is there some sort of setting to allow customers to view PDFs from the URL?

Re: How to get invoice PDF and display to user

First step was to call "/transactions/invoices/accounts/{accountId}" to get a list of invoices.

Second, pick the invoice out of the list that matched the invoice number we were trying to view.

On that object is a list called "invoiceFiles" - if it was non-empty, grab the first item.

Use the "pdfFileUrl" property on that item as the URL to fetch the PDF from, but in the GET request, include headers "apiAccessKeyId" and "apiSecretAccessKey" with the values set to our applicable api key. This eliminates the auth problem, but also makes it so you have to do this on your backend to avoid exposing your apiAccessKeyId and Secret.

Assuming the request for the PDF coming into us was authenticated, we'd do a pipe command on the response coming back from Zuora onto the outgoing response we are currently handling on our server: zuoraResponse.pipe(ourOutgoingResponseObj)

Re: How to get invoice PDF and display to user

First step was to call "/transactions/invoices/accounts/{accountId}" to get a list of invoices.

Second, pick the invoice out of the list that matched the invoice number we were trying to view.

On that object is a list called "invoiceFiles" - if it was non-empty, grab the first item.

Use the "pdfFileUrl" property on that item as the URL to fetch the PDF from, but in the GET request, include headers "apiAccessKeyId" and "apiSecretAccessKey" with the values set to our applicable api key. This eliminates the auth problem, but also makes it so you have to do this on your backend to avoid exposing your apiAccessKeyId and Secret.

Assuming the request for the PDF coming into us was authenticated, we'd do a pipe command on the response coming back from Zuora onto the outgoing response we are currently handling on our server: zuoraResponse.pipe(ourOutgoingResponseObj)