Retrieve account statements
In this tutorial, you’ll learn how to use the J.P. Morgan Business Direct Connect API to search for and download statements for a consented account. By the end of this tutorial, you'll know how to:
- Retrieve a lightweight list of consented accounts.
- Search for available statement records for a specific account and date range.
- Retrieve additional pages of statement results.
- Download an available statement in PDF format.
Before you begin
To use this capability, you will need to have:
- Complete onboarding and obtain client credentials.
- Complete the consent flow and obtain a valid access token.
Send a request
To retrieve statements for consented accounts, follow these steps:
Retrieve a lightweight account list:
Send a
GETrequest to the/accountsendpoint. SetresultTypetolightweight, or omit the parameter becauselightweightis the default. The response contains minimal descriptive information and anaccountIdfor each returned account.
- Search for statements:
Use the accountId returned by the account-list request to send a GET request to /accounts/{accountId}/statements. Replace {accountId} with the identifier for the account you want to query. The response contains available statement records, which may include a statementId, statementDate, availability status, and a link for downloading the statement.
- Search for statements by date
- Use one of the following parameter pairs to define the statement period:
- Use
startDateandendDatefor dates inYYYY-MM-DDformat. - Use
startTimeandendTimefor values in International Organization for Standardization (ISO) 8601 format.
- Use
- Follow these rules:
- Don’t combine
startDateorendDatewithstartTimeorendTimein the same request. - The start value must be less than or equal to the corresponding end value.
- The requested date range can’t exceed three years.
- The start date can’t be earlier than three years before the request date.
- If you don’t provide a date or time range, the search defaults to the current month.
- Don’t combine
- Use one of the following parameter pairs to define the statement period:
- Retrieve additional statement results
- Statement-search responses are paginated and return up to 100 statement records per page.
- Use either offset or pageKey to navigate statement results. Don’t include both parameters in the same request
- Use the pagination information and links in the response to retrieve additional results.
- The limit parameter is optional and defaults to 100. Its value must be between 1 and 100.
-
Include a valid access token and the required
x-fapi-interaction-idheader in each request. Providex-fapi-interaction-idas an Internet Engineering Task Force Request for Comments 4122 universally unique identifier (UUID). Additional Financial Data Exchange (FDX) headers may apply to your integration. Refer to the integration guide and API specification for details.
- Statement-search responses are paginated and return up to 100 statement records per page.
-
Download an available statement:Select an available statement record that includes a
statementIdand download link. Send aGETrequest to/accounts/{accountId}/statements/{statementId}, replacing the path parameters with the values returned by the statement-search response. A successful request returns the statement as a PDF.Statements with more than 400 pages aren’t supported for download through the API. For these statements, the search response returnsTOOLARGE_DO_NOT_DOWNLOADin thestatusandstatementIdfields and doesn’t return a statement download link.
Request and response details
For details on required and optional parameters, error codes, response formats, and request and response examples, refer to the API specification.