# JPMC-PDP Documentation from https://developer.payments.jpmorgan.com # Retrieve account transactions In this tutorial, learn how to use the J.P. Morgan Business Direct Connect API to retrieve a list of transactions for consented accounts. By the end of this tutorial, you will know how to: - Retrieve a list of accounts. - Fetch transactions for a specific account and date range. - Handle paginated transaction results. ## Before you begin To use this capability, you will need to have: - Complete onboarding and get client credentials. - Complete the consent flow and get a valid access token. ## Send a request To retrieve transactions for consented accounts, follow these steps: - Retrieve a list of accounts: Send a GET request to the /accounts endpoint, setting the resultType parameter to lightweight or details to retrieve a list of accounts with their associated descriptors. If resultType is not specified, it defaults to lightweight. - Fetch transactions for each account: For each account, send a GET request to the /accounts/{accountId}/transactions endpoint to retrieve transactions. ## Fetching transactions for a given date range - Specify both startTime and endTime query parameters to define the date range. - If only the startTime is specified, the end date defaults to the previous day. - The startTime must be less than or equal to the endTime. If not the API returns an invalid date range error (code 703, HTTP 400). - If the date range includes future dates, the response may be empty, as there are no future posted transactions. ## Handling pagination - The page object in the response contains pagination metadata, such as the total number of records. - The links object provides navigation links for paginated results: - links.next.href: Use this URL to fetch the next page of results. - links.next.action: Indicates the HTTP method (usually "GET"). - links.next.rel: Relationship type (e.g., "next" for next page). - links.next.types: Expected response type (e.g., "application/fdx+json"). - pageMetadata.totalElements: Provides the total number of records. - pageMetadata.nextOffSet and pageMetadata.prevOffSet, as well as links.prev.href, are not supported and do not need to be used. ## Request and response details A successful response will return a paginated list of transactions for the specified account and date range. For details on required and optional parameters, error codes, response formats, and request and response examples, refer to the [API specification](/api/treasury/jp-morgan-business-direct-connect/j-p-morgan-direct-connect).