How to download invoice PDFs from QuickBooks Online
The Apideck Accounting unified API doesn't expose invoice PDF download as a unified operation, but you can retrieve them via the Proxy API. This guide shows how to do this for QuickBooks Online.
The flow is two steps: use the unified GET /accounting/invoices endpoint to find the invoice you want, then use its id in a Proxy API call to download the PDF.
Prerequisites
An active Apideck Vault connection for QuickBooks (
service-id: quickbooks)The Apideck
consumer-id,app-id, andapi-keyAn invoice in QuickBooks. Unlike Xero, any saved invoice will render - there's no minimum status requirement.
Step 1: Find the invoice ID
Use the unified Accounting API to list invoices and find the one you want:
curl --location 'https://unify.apideck.com/accounting/invoices' \
--header 'Authorization: Bearer {APIDECK_API_KEY}' \
--header 'x-apideck-app-id: {APP_ID}' \
--header 'x-apideck-consumer-id: {CONSUMER_ID}' \
--header 'x-apideck-service-id: quickbooks'
The response contains an array of invoices. Copy the id of the invoice you want as a PDF - you'll use it in the next step. The unified id matches QuickBooks's invoice ID.
Step 2: Download the PDF via Proxy
curl --location 'https://unify.apideck.com/proxy' \
--header 'Authorization: Bearer {APIDECK_API_KEY}' \
--header 'x-apideck-app-id: {APP_ID}' \
--header 'x-apideck-consumer-id: {CONSUMER_ID}' \
--header 'x-apideck-service-id: quickbooks' \
--header 'x-apideck-downstream-url: https://quickbooks.api.intuit.com/v3/company/{realm_id}/invoice/{INVOICE_ID}/pdf?minorversion=75' \
--header 'Accept: application/pdf' \
--output quickbooks-invoice.pdf
For sandbox connections, swap the host to https://sandbox-quickbooks.api.intuit.com/....
Note that {realm_id} is kept as a placeholder in the URL - Vault automatically substitutes it with the connection's QuickBooks company ID at runtime. See QuickBooks: What is the purpose of the "realm_id" property? for details.
The Apideck Proxy detects the binary response and base64-encodes it internally; API Gateway decodes it back to raw bytes before delivery, so your HTTP client receives a normal PDF binary.
Gotchas
The Accept header must be exactly application/pdf. QuickBooks is the strictest of the supported connectors on this. Sending application/json, */*, or omitting the header returns a confusing error:
{
"Fault": {
"Error": [{
"Message": "An application error has occurred while processing your request",
"Detail": "System Failure Error: No match for accept header",
"code": "10000"
}]
}
}
This isn't an Apideck or auth issue - it's QuickBooks rejecting the request because the route only emits PDF. Set the header correctly and it works.
Sandbox vs production hosts. The Vault connection determines which environment the credentials are valid for. If your connection is sandbox-authenticated but you point the downstream URL at the production host (quickbooks.api.intuit.com), you'll get errorCode=003100 (ApplicationAuthorizationFailed). Always match the host to the connection environment.
