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:
- Get the data: Listen for the statement webhook.
- Create the PDF: Use the data in the webhook to populate a PDF statement template.
- 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:
- Create a template PDF statement in the tooling of your choice.
- Add placeholders for any values that will change from statement to statement. For example, borrower name, balance, due date, etc.
- 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.
- Create your PDF statement template: Tutorial
- 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
- 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
- The payload of the statement webhook contains a field called
pre_signed_url
- 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
- GET
/accounts/{account_id}/statements/list
will include a downloadable URL for the PDF.
CanopyOS
- From an Account page, look for the Account Statements section.
- Click on View for a listed statement.
- A drawer will appear appear displaying statement data.
- In the upper right hand corner, there will be a download button if a statement PDF has been attached.
- Clicking on this button will download the statement PDF you attached.
Borrower Portal
- From an Account page, look for the Statements tab at the top.
- This page will contain a list of statement cycles for that account.
- On the right hand side of each statement cycle there will be a download icon if a statement PDF has been attached.
- Clicking on this icon will download the statement PDF you attached.
Example PDF Statement Field Mapping
[Insert Example PDF file here]
Label | Data Field |
---|---|
Company Details | organization.organization_overview |
Header Statement Start Date | statement.cycle_summary.cycle_inclusive_start |
Header Statement End Date | Subtract 1 second from: statement.cycle_summary.cycle_exclusive_end |
Customer Details | account.customers[0] |
Account Number | account.account_id |
Payments Received | statement.cycle_summary.cycle_payments_cents |
Other Credits | statement.cycle_summary.cycle_debit_adjustments_cents |
Past Due Amount | statement.additional_min_pay_details.previous_min_pay_cents |
Returned Payments | statement.cycle_summary.cycle_payment_reversals_cents |
Fees Charged | Sum of statement.cycle_summary.[Fee_Fields] |
Interest Charged | statement.cycle_summary.cycle_interest_cents + statement.cycle_summary.cycle_am_interest_cents |
New Balance | statement.balance_summary.total_balance_cents |
Credit Limit | statement.open_to_buy.credit_limit_cents |
Available Balance | account.summary.available_credit_cents |
Payment Due | statement.min_pay_due.min_pay_cents |
Due Date | Subtract 1 second from: statement.min_pay_due.min_pay_due_at |
Autopay Enabled | account.payment_processor_config.autopay_enabled |
Return Payment Fee | account.account_product.product_lifecycle.payment_reversal_fee_impl_cents |
Late Fee | account.account_product.product_lifecycle.late_fee_impl_cents |
Transaction Created Date | statement.line_items.created_at |
Transaction Effective Date | statement.line_items.effective_at |
Transaction Description | statement.line_items.line_item_overview.description |
Transaction Amount | statement.line_items.line_item_summary.original_amount_cents |
Total Payments and Other Credits | statement.cycle_summary.cycle_payments_cents + statement.cycle_summary.cycle_debit_adjustments_cents |
Total Period Interest | statement.cycle_summary.cycle_am_interest_cents + statement.cycle_summary.cycle_interest_cents |
APR | account.summary.interest_rate_percent |
Updated over 1 year ago