Skip to main content
All CollectionsApideck Unify
How to download invoices from the Accounting API
How to download invoices from the Accounting API

Download invoices via the Proxy API

Updated over a week ago

Downloading invoices is not a dedicated endpoint on the Accounting API yet. You can use the Proxy API to download the invoices directly to work around this. Please find a few examples below:

For QuickBooks: CURL example

curl --location --request GET '<https://unify.apideck.com/proxy>' \\ --header 'x-apideck-consumer-id: ******' \\ --header 'x-apideck-app-id: ***********' \\ --header 'x-apideck-service-id: quickbooks' \\ --header 'x-apideck-downstream-url:<https://sandbox-quickbooks.api.intuit.com/v3/company/{company_id}/invoice/{id}/pdf?minorversion=63>' \\ --header 'Accept: application/pdf' \\ --header 'Authorization: Bearer ********'

For Xero: CURL example

curl --location --request GET '<https://unify.apideck.com/proxy>' \\ --header 'x-apideck-consumer-id: ******' \\ --header 'x-apideck-app-id: ***********' \\ --header 'x-apideck-service-id: xero' \\ --header 'x-apideck-downstream-url: <https://api.xero.com/api.xro/2.0/Invoices/{id}>' \\ --header 'Accept: application/pdf' \\ --header 'Authorization: Bearer ********' 

For NetSuite: CURL example

curl --location 'https://unify.apideck.com/proxy' \ --header 'x-apideck-app-id: ***********' \ --header 'x-apideck-consumer-id: ***********' \ --header 'x-apideck-downstream-url: https://{account_id}.suitetalk.api.netsuite.com/services/NetSuitePort_2022_2' \ --header 'x-apideck-service-id: netsuite' \ --header 'soapaction: search' \ --header 'Content-Type: application/xml' \ --header 'Authorization: ••••••' \ --data '<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="urn:platform_2022_2.webservices.netsuite.com" xmlns:platformMsgs="urn:messages_2022_2.platform.webservices.netsuite.com" xmlns:platformFaults="urn:faults_2022_2.platform.webservices.netsuite.com" xmlns:platformCommon="urn:common_2022_2.platform.webservices.netsuite.com" xmlns:platformCore="urn:core_2022_2.platform.webservices.netsuite.com" xmlns:setupCustom="urn:customization_2022_2.setup.webservices.netsuite.com"> <soap:Header> <platformMsgs:tokenPassport> <platformCore:account>{account_id}</platformCore:account> <platformCore:consumerKey>{consumer_key}</platformCore:consumerKey> <platformCore:token>{token_id}</platformCore:token> <platformCore:version>1.0</platformCore:version> <platformCore:nonce>{nonce}</platformCore:nonce> <platformCore:timestamp>{timestamp}</platformCore:timestamp> <platformCore:signature algorithm="HMAC_SHA256">{signature}</platformCore:signature> </platformMsgs:tokenPassport> <searchPreferences xsi:type="SearchPreferences"> <bodyFieldsOnly>false</bodyFieldsOnly> <returnSearchColumns>true</returnSearchColumns> <pageSize>20</pageSize> </searchPreferences> </soap:Header> <soap:Body> <search xmlns="urn:messages_2022_2.platform.webservices.netsuite.com"> <searchRecord xsi:type="ns1:FileSearchBasic" xmlns:ns1="urn:common_2022_2.platform.webservices.netsuite.com"> </searchRecord> </search> </soap:Body> </soap:Envelope>'

For Sage Business Accounting: CURL example

curl --location --request GET '<https://unify.apideck.com/proxy>' \\ --header 'x-apideck-consumer-id: ******' \\ --header 'x-apideck-app-id: ***********' \\ --header 'x-apideck-service-id: sage-business-cloud-accounting' \\ --header 'x-apideck-downstream-url:<https://api.accounting.sage.com/v3.1/sales_invoices/{id}>' \\ --header 'Accept: application/pdf' \\ --header 'Authorization: Bearer ********'

Did this answer your question?