Skip to content

Get an employer invoice's PDF download link

client.employers.retrieveInvoicePdf(stringinvoiceID, EmployerRetrieveInvoicePdfParams { employer_id } params, RequestOptionsoptions?): EmployerRetrieveInvoicePdfResponse { data }
GET/v1/employers/{employer_id}/invoices/{invoice_id}/pdf

Returns the time-limited PDF download link for a single invoice belonging to the employer’s billing customer. invoice_id is the external Chargebee id (not a prefixed UUID). The caller must be authorized for the employer; an unknown or unauthorized employer or invoice returns 404.

ParametersExpand Collapse
invoiceID: string

External Chargebee invoice id (not a prefixed UUID).

params: EmployerRetrieveInvoicePdfParams { employer_id }
employer_id: string

Unique employer identifier (empr_*)

ReturnsExpand Collapse
EmployerRetrieveInvoicePdfResponse { data }

Response containing a single employer invoice pdf resource.

data: Data { download_url }
download_url: string

Time-limited Chargebee PDF download link for the invoice.

Get an employer invoice's PDF download link

import VitableConnect from '@vitable-inc/vitable-connect';

const client = new VitableConnect({
  apiKey: process.env['VITABLE_CONNECT_API_KEY'], // This is the default and can be omitted
});

const response = await client.employers.retrieveInvoicePdf('INV-00042', {
  employer_id: 'empr_abc123def456',
});

console.log(response.data);
{
  "data": {
    "download_url": "https://chargebee.example/invoices/INV-00042.pdf"
  }
}
Returns Examples
{
  "data": {
    "download_url": "https://chargebee.example/invoices/INV-00042.pdf"
  }
}