Learn Center has been sunset. Visit our new Docs site at: docs.canopyservicing.com
logo

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. Listen for the statement webhook.
  1. Use the data in the webhook to populate a PDF statement template.
  1. 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.
👋
Heres’ an example statement webhook payload:
Statement schema statement_generation

Example PDF Statement Field Mapping


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.
  1. Add placeholders for any values that will change from statement to statement. For example, borrower name, balance, due date, etc.
  1. 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
  1. 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
  1. 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
  1. 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 can I find the statement PDFs in Canopy?

  • CanopyOS
      1. From an Account page, look for the Account Statements section.
      1. Click on View for a listed statement.
      1. A drawer will appear appear displaying statement data.
      1. In the upper right hand corner, there will be a download button if a statement PDF has been attached.
      1. 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.
      1. This page will contain a list of statement cycles for that account.
      1. On the right hand side of each statement cycle there will be a download icon if a statement PDF has been attached.
      1. Clicking on this icon will download the statement PDF you attached.
  • API Request
    • GET /accounts/{account_id}/statements/list will include a downloadable URL for the PDF.

Powered by Notaku