PDF Statement Generation

This guide will walk you through how you can create a PDF version of your statement data and make it available within Canopy.

High-Level Steps:

  1. Get the data: Listen for the statement webhook.
  2. Create the PDF: Use the data in the webhook to populate a PDF statement template.
  3. Make the PDF available in Canopy: Make a call back to the pre_signed_url included in the webhook with the PDF in the request body.

Step 1: Get the Data

Where do I get the data?

When a statement cycle is cut within Canopy, you will be notified via the statement webhook.

If you have not already subscribed to receive webhooks, setup instructions to do so can be found here: Webhooks.

What Data is Included?

The data included in the statement webhook can be found in the Statement section of our api documentation here: Statements Endpoint.


Step 2: Create the PDF

There are a number of options for using webhook data to create your PDF statements. Ultimately, you are free to use whatever means best suits your situation, but below are a few options and guides to help you get started.

General Steps

Independent of the tool you choose, these will be the general steps:

  1. Create a template PDF statement in the tooling of your choice.
  2. Add placeholders for any values that will change from statement to statement. For example, borrower name, balance, due date, etc.
  3. Use the data received in the statement webhook to populate the placeholders.

Low-Code Option

Anvil offers an easy, low-code REST API option for generating PDF statements.

  1. Create your PDF statement template: Tutorial
  2. Make a POST request to Anvil’s /fill endpoint with the relevant fields from the statement webhook payload in the body of the request: Tutorial
  3. The body of the response from this call will contain your filled out PDF statement.

Custom Development Integration Option

If you have an in-house development team, you can make use of a PDF library to generate your PDF statements directly in your existing system. Based on your tech stack, there are a number of PDF manipulation libraries available.


Step 3: Make the PDF Available in Canopy

Great! You’ve generate your PDF statement! Now, we’ll want to save that PDF in a secure location within Canopy’s system to make it available within your Borrower Portal and CanopyOS.

Attaching a PDF Statement to a Canopy Account Cycle

  1. The payload of the statement webhook contains a field called pre_signed_url
  2. Make a PUT call to the URL provided from the pre_signed_url field with your statement PDF in the request body.

When successful, calls to the PDF will also be available for download from the borrower portal and CanopyOS.


Where to find Statement PDFs in Canopy

API Request

  1. GET /accounts/{account_id}/statements/list will include a downloadable URL for the PDF.

CanopyOS

  1. From an Account page, look for the Account Statements section.
  2. Click on View for a listed statement.
  3. A drawer will appear appear displaying statement data.
  4. In the upper right hand corner, there will be a download button if a statement PDF has been attached.
  5. Clicking on this button will download the statement PDF you attached.

Borrower Portal

  1. From an Account page, look for the Statements tab at the top.
  2. This page will contain a list of statement cycles for that account.
  3. On the right hand side of each statement cycle there will be a download icon if a statement PDF has been attached.
  4. Clicking on this icon will download the statement PDF you attached.

Example PDF Statement Field Mapping

[Insert Example PDF file here]

LabelData Field
Company Detailsorganization.organization_overview
Header Statement Start Datestatement.cycle_summary.cycle_inclusive_start
Header Statement End DateSubtract 1 second from: statement.cycle_summary.cycle_exclusive_end
Customer Detailsaccount.customers[0]
Account Numberaccount.account_id
Payments Receivedstatement.cycle_summary.cycle_payments_cents
Other Creditsstatement.cycle_summary.cycle_debit_adjustments_cents
Past Due Amountstatement.additional_min_pay_details.previous_min_pay_cents
Returned Paymentsstatement.cycle_summary.cycle_payment_reversals_cents
Fees ChargedSum of statement.cycle_summary.[Fee_Fields]
Interest Chargedstatement.cycle_summary.cycle_interest_cents + statement.cycle_summary.cycle_am_interest_cents
New Balancestatement.balance_summary.total_balance_cents
Credit Limitstatement.open_to_buy.credit_limit_cents
Available Balanceaccount.summary.available_credit_cents
Payment Duestatement.min_pay_due.min_pay_cents
Due DateSubtract 1 second from: statement.min_pay_due.min_pay_due_at
Autopay Enabledaccount.payment_processor_config.autopay_enabled
Return Payment Feeaccount.account_product.product_lifecycle.payment_reversal_fee_impl_cents
Late Feeaccount.account_product.product_lifecycle.late_fee_impl_cents
Transaction Created Datestatement.line_items.created_at
Transaction Effective Datestatement.line_items.effective_at
Transaction Descriptionstatement.line_items.line_item_overview.description
Transaction Amountstatement.line_items.line_item_summary.original_amount_cents
Total Payments and Other Creditsstatement.cycle_summary.cycle_payments_cents + statement.cycle_summary.cycle_debit_adjustments_cents
Total Period Intereststatement.cycle_summary.cycle_am_interest_cents + statement.cycle_summary.cycle_interest_cents
APRaccount.summary.interest_rate_percent