Building credit statements

How to gather and provide statement information to an end user.

Overview

Bond provides APIs that allow you to easily build compliant statements for your end-users. This guide shows you how to use Bond's APIs in conjunction with our statement templates to build and customize statements for your users.

To create statements for your users:

  1. Retrieve the data needed for your statements
  2. Get the appropriate statement legal disclosures from Bond's operations and compliance team
  3. Build a template (or use our sample template)
  4. Transfer your values to the template and distribute it to end-users

Retrieving statement data

You need to retrieve statement data for the billing month as well as customer information which you print on the statement. To do so, use the following API calls:

👍

Getting statement_response

For GET /get-statements API calls, the correct statement month to use for the {mm} path variable is the month the statement period started, not ended. The value will depend on whether the statement period ends before or at the end of the month.

For example, for the statement ending EOD on July 27th 2022 for account with ID 057c6074-a02d-4a5a-bad9-bbc64b047df7, you would use 06 as the month value, as follows:
/accounts/057c6074-a02d-4a5a-bad9-bbc64b047df7/statements/2022/06

However, if the statement coincides with the end of the month, such as EOD on July 31st 2022, the statement period will begin on July 1st 2022, and the month value would be 07, as follows:
/accounts/057c6074-a02d-4a5a-bad9-bbc64b047df7/statements/2022/07

Our global rate-limit across all your API calls is 1000 API calls per minute, so aim to stay well below this value.

🚧

Avoid rate-limiting

If you are making bulk API calls to our services at the end of a month to create statements for all your users, you need to limit your request frequency to avoid being rate-limited by our APIs.

Getting disclosures

Statements for consumer programs are legally required to contain certain disclosures to inform your consumers of specific rights. Your disclosures may be different, depending on your program. Contact your Bond operations point-of-contact to get the relevant disclosures applicable to your program.

Building a template

We provide all the data necessary to allow you to customize and style your statements to match the branding of your product. However, we encourage you to start with the sample HTML templates shown below. Doing so ensures that your statements fit the basic structure that is expected for compliance.

The following is an HTML sample credit statement.

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Monthly Account Statement</title>
  </head>
  <body>
    <h1>Monthly Account Statement</h1>
    <h2>Account Summary</h2>
    <p>$customer_name</p>
    <p>$customer_address</p>
    <h4>Summary of Account Activity</h4>
    <p>Previous balance: $previous_balance</p>
    <p>Payments and Credits: $payments_and_credits</p>
    <p>Purchases: $purchases</p>
    <p>Fees: $fees</p>
    <p>New balance as of $end_date: $new_balance</p>
    <h4>Credit Limit</h4>
    <p>Credit Limit: $credit_limit</p>
    <p>Available Credit: $available_credit</p>
    <p>Statement Start Date: $start_date</p>
    <p>Statement Closing Date: $end_date</p>
    <h4>Payment Information</h4>
    <p>New balance as of $end_date: $new_balance</p>
    <p>Payment Due: $payment_due</p>
    <p>Payment Due Date: $payment_due_date</p>
    <p><b>Late Payment Warning</b>: If we do not receive your payment by the date listed above, you may have to pay a late fee of up to $late_fee</p>
    <h4>Questions?</h4>
    <p>Call Customer Service: $customer_service_number</p>
    <p>Lost or Stolen Credit Card: $lost_stolen_number</p>
    <hr> 
    <p>$bank_address</p>
    <p>Account Number: $account_number</p>
    <p>New Balance: $new_balance</p>
    <p>Minimum Payment Due: $new_balance</p>
    <p>Payment Due Date: $payment_due_date</p>
    <p>AMOUNT ENCLOSED: </p>
    <div style='border: 1px solid #000; padding: 20px'></div>
    <p>Please send billing inquiries and correspondence to: $billing_inquiry_address </p>
    <h4>Your rights</h4>
    INSERT YOUR RIGHTS SECTION
    <hr> 
    <p>Billing period: $start_date - $end_date</p>
    <table>
      <tr>
        <th>Transactions</th>
      </tr>
      <tr>
        <th>Transaction Date</th>
        <th>Posted Date</th> 
        <th>Description</th>
        <th>Amount</th>
      </tr>
      $transaction_rows
    </table>
  </body>
</html>

The following is an HTML sample deposit account statement.

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Monthly Account Statement</title>
  </head>
  <body>
    <h1>Monthly Account Statement</h1>
    <h2>Account Summary</h2>
    <p>$customer_name</p>
    <p>$customer_address</p>
    <h4>Summary of Account Activity</h4>
    <p>Previous balance: $previous_balance</p>
    <p>Payments and Credits: $payments_and_credits</p>
    <p>Purchases: $purchases</p>
    <p>Fees: $fees</p>
    <p>New balance as of $end_date: $new_balance</p>
    <h4>Questions?</h4>
    <p>Call Customer Service: $customer_service_number</p>
    <p>Lost or Stolen Credit Card: $lost_stolen_number</p>
    <hr> 
    <p>Please send billing inquiries and correspondence to: $billing_inquiry_address </p>
    <h4>Your rights</h4>
    INSERT YOUR RIGHTS SECTION
    <hr> 
    <p>Statement period: $start_date - $end_date</p>
    <table>
      <tr>
        <th>Transactions</th>
      </tr>
      <tr>
        <th>Transaction Date</th>
        <th>Posted Date</th> 
        <th>Description</th>
        <th>Amount</th>
      </tr>
      $transaction_rows
    </table>
  </body>
</html>

Transferring values to the template and distributing it

Once you have a statement template that's ready for your users, you can substitute values into your statement from the statement data you retrieved earlier.

In addition to the data you retrieved earlier in statement_response, customer_response, and account_response, note that there are also the following static values common across all statements:

  • customer_service_number—The general customer service number end-users should use for your program
  • lost_stolen_number—The number end-users should use for for lost/stolen cards

The following is an example of substituting data into the template and converting into a PDF.

🚧

Masking full account numbers

For security purposes, the script below masks the account numbers provided in the account_response before substitution into the HTML statement template. It is important to do this in every statement, as account_response uses full account numbers.

from string import Template

template = t = Template(template_str)
statement_str = t.substitute(
    previous_balance=statement_response['data'][0]['credit']['previous_balance'],
    payments_and_credits=statement_response['data'][0]['credit']['payments_and_credits'],
    purchases=statement_response['data'][0]['credit']['purchases'],
    fees=statement_response['data'][0]['fees'],
    start_date=statement_response['data'][0]['statement_start_date'],
    end_date=statement_response['data'][0]['statement_end_date'],
    new_balance=statement_response['data'][0]['credit']['new_balance'],
    credit_limit=statement_response['data'][0]['credit']['credit_limit'],
    available_credit=statement_response['data'][0]['credit']['available_credit'],
    payment_due=statement_response['data'][0]['credit']['new_balance'],
    payment_due_date=statement_response['data'][0]['credit']['payment_due_date'],
    account_number=f'XXXXXXXXXXX{account_response['data'][0]['account_number'][:-4]}',
    late_fee=your_late_fee,
    customer_service_number=customer_service_number,
    lost_stolen_number=lost_stolen_number,
    bank_address=bank_address.replace('\n', '<br/>'),
    billing_inquiry_address=billing_inquiry_address,
    transaction_rows=''.join([f'''<tr>
        <td>{tx['transaction_date']}</td>
        <td>{tx['settled_date']}</td>
        <td>{tx['transaction_description']}</td>
        <td>{tx['amount']}</td>
    </tr>''' for tx in statement_response['data'][0]['transactions']])
)

import pdfkit
pdfkit.from_string(statement,'example_statement.pdf')

Once the statement is constructed, you can deliver the statement PDF via email after the close-date of the payment period.


Next Steps