### Setup Script for Customer Onboarding (PowerShell) Source: https://developer.mastercard.com/open-finance-us/documentation/quick-start-guide/index This PowerShell script automates the setup of a test customer and sharing of test accounts with Mastercard Open Finance. It requires `partnerId`, `partnerSecret`, and `appKey` as parameters. ```powershell ./setup.ps1 {partnerId} {partnerSecret} {appKey} ``` -------------------------------- ### C# Authentication Implementation Example Source: https://developer.mastercard.com/open-finance-us/documentation/quick-start-guide/index An example illustrating how to extend the generated `ApiClient` class in C# to include 'Finicity-App-Key' and 'Finicity-App-Token' headers for API requests. ```APIDOC ## C# Authentication Implementation This example shows how to create a custom `ApiClient` in C# that extends the partially generated API client to handle authentication headers, specifically `Finicity-App-Key` and `Finicity-App-Token`. ### Code Example ```csharp // Create a FinicityApiClient.cs file that extends the partial ApiClient from ApiClient.cs using Org.OpenAPITools.Client; using RestSharp; using System; namespace Org.OpenAPITools { public partial class ApiClient { private readonly string _partnerId; private readonly string _partnerSecret; private readonly string _appKey; private string _token; private DateTime _tokenExpiryTime; public ApiClient(string partnerId, string partnerSecret, string appKey) { _baseUrl = GlobalConfiguration.Instance.BasePath; _appKey = appKey; _partnerId = partnerId; _partnerSecret = partnerSecret; } partial void InterceptRequest(IRestRequest request) { // Always add "Finicity-App-Key" request.AddHeader("Finicity-App-Key", _appKey); var url = request.Resource; if (url.Contains("/authentication")) { // No "Finicity-App-Token" header needed for /authentication return; } // Logic to refresh token if expired would go here, similar to the Java example. // For brevity, this is omitted but essential for a complete implementation. if (_tokenExpiryTime == DateTime.MinValue || _tokenExpiryTime < DateTime.Now) { // Call authenticationApi.CreateToken(...) and update _token and _tokenExpiryTime // Example: _token = CreateToken(); _tokenExpiryTime = DateTime.Now.AddMinutes(90); } // Add access token if available if (!string.IsNullOrEmpty(_token)) { request.AddHeader("Finicity-App-Token", _token); } } // Placeholder for token creation logic (needs actual implementation) // private string CreateToken() { ... } } } ``` ### Usage 1. Create a new C# file (e.g., `FinicityApiClient.cs`) within your project. 2. Copy the code above into this file. This extends the partial `ApiClient` class generated by OpenAPI Generator. 3. Modify the constructor to accept `partnerId`, `partnerSecret`, and `appKey`. 4. Implement the token refresh logic within the `InterceptRequest` method or a separate helper method, similar to the Java example. 5. When instantiating your API client, provide the necessary credentials: `var apiClient = new ApiClient(partnerId, partnerSecret, appKey);`. ``` -------------------------------- ### Setup Script for Customer Onboarding (Bash) Source: https://developer.mastercard.com/open-finance-us/documentation/quick-start-guide/index This bash script is used to set up a test customer and share test accounts with Mastercard Open Finance. It requires `partnerId`, `partnerSecret`, and `appKey` as arguments. ```bash ./setup.sh {partnerId} {partnerSecret} {appKey} ``` -------------------------------- ### Install nvm and Node.js in Docker for CI/CD Source: https://github.com/creationix/nvm This Dockerfile example is designed for robust installation in CI/CD pipelines. It installs nvm, sets the NVM_DIR, and then installs a specified Node.js version. It also configures an ENTRYPOINT to ensure the nvm environment is sourced for subsequent commands. ```dockerfile FROM ubuntu:latest ARG NODE_VERSION=20 # install curl RUN apt update && apt install curl -y # install nvm RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash # set env ENV NVM_DIR=/root/.nvm # install node RUN bash -c "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION" # set ENTRYPOINT for reloading nvm-environment ENTRYPOINT ["bash", "-c", "source $NVM_DIR/nvm.sh && exec \"$@\"", "--"] # set cmd to bash CMD ["/bin/bash"] ``` -------------------------------- ### Install Dependencies and Start App Locally (npm) Source: https://github.com/Mastercard/open-banking-reference-application/blob/main/README This section details how to install the necessary dependencies for the application using npm and then start the reference application locally. This method is suitable for direct development and testing without containerization. Ensure Node.js and npm are installed on your system. ```shell npm i npm start ``` -------------------------------- ### nvm Install Node.js and Migrate Global Packages Source: https://github.com/creationix/nvm Covers the process of installing a new Node.js version and automatically migrating all globally installed npm packages from a previous version. This simplifies the setup of new Node.js environments by preserving existing dependencies. ```bash nvm install --reinstall-packages-from=node node nvm install --reinstall-packages-from=5 6 nvm install --reinstall-packages-from=iojs v4.2 ``` -------------------------------- ### Run Interactive Docker Container and Check Versions Source: https://github.com/creationix/nvm This command starts an interactive Docker container from the built image. Inside the container, you can verify the installed NVM, Node.js, and npm versions. This is useful for testing the setup and ensuring the correct versions are active. ```bash docker run --rm -it nvmimage root@0a6b5a237c14:/# nvm -v 0.40.3 root@0a6b5a237c14:/# node -v v19.9.0 root@0a6b5a237c14:/# npm -v 9.6.3 ``` -------------------------------- ### Java Authentication Interceptor Example Source: https://developer.mastercard.com/open-finance-us/documentation/quick-start-guide/index An example of an OkHttp3 interceptor for Java that handles the attachment of 'Finicity-App-Token' and 'Finicity-App-Key' HTTP headers for Mastercard Open Finance API requests. ```APIDOC ## Java Authentication Interceptor This example demonstrates how to implement an `Interceptor` for OkHttp3 in Java to automatically manage and attach the `Finicity-App-Token` and `Finicity-App-Key` headers to your API requests. ### Code Example ```java // An example of okHttp3 interceptor handling Mastercard Open Finance authentication. import com.mastercard.openbanking.client.api.AuthenticationApi; import com.mastercard.openbanking.client.ApiException; import com.mastercard.openbanking.client.model.PartnerCredentials; import okhttp3.Interceptor; import okhttp3.Request; import okhttp3.Response; import org.jetbrains.annotations.NotNull; import java.io.IOException; import java.time.LocalDateTime; public class OpenBankingAuthInterceptor implements Interceptor { private final AuthenticationApi authenticationApi; private final String partnerId; private final String partnerSecret; private final String appKey; private String token; private LocalDateTime tokenExpiryTime; public OpenBankingAuthInterceptor(String partnerId, String partnerSecret, String appKey) { this.partnerId = partnerId; this.partnerSecret = partnerSecret; this.appKey = appKey; this.authenticationApi = new AuthenticationApi(); } @NotNull public Response intercept(@NotNull Chain chain) throws IOException { try { // Always add "Finicity-App-Key" Request request = chain.request(); Request.Builder requestBuilder = request .newBuilder() .addHeader("Finicity-App-Key", this.appKey); String url = request.url().toString(); if (url.contains("/authentication")) { // No "Finicity-App-Token" header needed for /authentication return chain.proceed(requestBuilder.build()); } if (this.tokenExpiryTime == null || this.tokenExpiryTime.isBefore(LocalDateTime.now())) { this.refreshToken(); } // Add access token to the "Finicity-App-Token" header requestBuilder = requestBuilder .addHeader("Finicity-App-Token", this.token); return chain.proceed(requestBuilder.build()); } catch (Exception e) { throw new IOException(e.getMessage()); } } private void refreshToken() throws ApiException { this.token = createToken(); this.tokenExpiryTime = LocalDateTime.now().plusMinutes(90); } private String createToken() throws ApiException { return authenticationApi.createToken(new PartnerCredentials() .partnerId(partnerId) .partnerSecret(partnerSecret)).getToken(); } } ``` ### Usage 1. Instantiate the interceptor with your `partnerId`, `partnerSecret`, and `appKey`. 2. Add the interceptor to your OkHttp client instance. 3. Ensure the `AuthenticationApi` and `PartnerCredentials` classes are correctly imported from the generated client library. ``` -------------------------------- ### Manual NVM Installation using Git Source: https://github.com/creationix/nvm This script performs a manual installation of NVM by cloning the repository and checking out the latest tag. It then sources the nvm.sh script to load NVM into the current shell session. Ensure Git is installed and accessible. ```shell export NVM_DIR="$HOME/.nvm" && (git clone https://github.com/nvm-sh/nvm.git "$NVM_DIR" cd "$NVM_DIR" git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)` ) && . "$NVM_DIR/nvm.sh" ``` -------------------------------- ### Dockerfile Setup for Node.js with NVM Source: https://github.com/creationix/nvm This Dockerfile installs Node.js using NVM on an Ubuntu base image. It takes a NODE_VERSION argument for customization. Dependencies like curl are installed first, followed by nvm and the specified Node.js version. It configures the entrypoint and command for running Node.js applications within the container. ```dockerfile FROM ubuntu:latest ARG NODE_VERSION=20 # install curl RUN apt update && apt install curl -y # install nvm RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash # set env ENV NVM_DIR=/root/.nvm # install node RUN bash -c "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION" # set ENTRYPOINT for reloading nvm-environment ENTRYPOINT ["bash", "-c", "source $NVM_DIR/nvm.sh && exec \"$@\"", "--"] # set cmd to bash CMD ["/bin/bash"] ``` -------------------------------- ### Install NVM using Wget and Bash Source: https://github.com/creationix/nvm This command uses Wget to download the nvm installation script quietly and pipes it to bash for execution. Similar to the cURL method, it facilitates quick installation or updates of NVM. Wget and bash are required. ```shell wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash ``` -------------------------------- ### NVM Install with Mirror and Authorization Source: https://github.com/creationix/nvm Demonstrates installing Node.js using a specified mirror URL and passing an authorization header. This is useful for controlled environments or private repositories. ```bash export NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist NVM_AUTH_HEADER="Bearer secret-token" nvm install node ``` -------------------------------- ### nvm Install and Manage io.js Versions Source: https://github.com/creationix/nvm Provides instructions for installing io.js using nvm, including options to migrate global npm packages from a previous io.js or Node.js version. This allows users to manage io.js installations alongside Node.js. ```bash nvm install iojs nvm install --reinstall-packages-from=iojs iojs ``` -------------------------------- ### Update Installation: npm Uninstall and Install Source: https://developer.mastercard.com/open-finance-us/documentation/connect/integrating/sdk/web-sdk/websdk-migration/index These commands demonstrate how to uninstall the old Finicity Connect Web SDK package and install the new Connect Web SDK package using npm. ```bash npm uninstall @finicity/connect-web-sdk npm install connect-web-sdk ``` -------------------------------- ### Git Install nvm Source: https://github.com/creationix/nvm Installs nvm directly from its Git repository. This method is useful for developers who want the latest code or need to test specific branches. Ensure you have Git installed. ```shell git clone https://github.com/nvm-sh/nvm.git . "nvm/nvm.sh" ``` -------------------------------- ### Install NVM using cURL and Bash Source: https://github.com/creationix/nvm This command uses cURL to download the nvm installation script from a specified URL and pipes it directly to bash for execution. It's a quick way to install or update NVM. Ensure you have cURL and bash installed. ```shell curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash ``` -------------------------------- ### Switch and Install Node.js Versions with nvm Source: https://github.com/creationix/nvm This snippet shows how to use `nvm` to switch between installed Node.js versions and install new ones. It demonstrates the commands `nvm use `, `node -v`, and `nvm install `. This is useful for managing different project requirements that depend on specific Node.js versions. ```shell $ nvm use 16 Now using node v16.9.1 (npm v7.21.1) $ node -v v16.9.1 $ nvm use 14 Now using node v14.18.0 (npm v6.14.15) $ node -v v14.18.0 $ nvm install 12 Now using node v12.22.6 (npm v6.14.5) $ node -v v12.22.6 ``` -------------------------------- ### nvm Install Latest npm with Node.js Source: https://github.com/creationix/nvm Demonstrates how to install the latest available npm version along with a new Node.js installation, using the `--latest-npm` flag. This ensures compatibility and access to the newest npm features when setting up Node.js environments. ```bash nvm install --reinstall-packages-from=default --latest-npm 'lts/*' nvm install-latest-npm ``` -------------------------------- ### nvm List Installed and Remote Node.js Versions Source: https://github.com/creationix/nvm Demonstrates the nvm commands to list all installed Node.js versions on the local system (`nvm ls`) and all available versions that can be installed remotely (`nvm ls-remote`). This helps in managing and discovering Node.js versions. ```bash nvm ls nvm ls-remote ``` -------------------------------- ### Install Node.js using Devbox Source: https://nodejs.org/en/download Installs Devbox, a tool for creating isolated development environments. It then initializes Devbox in the project, adds Node.js, and starts a Devbox shell. This method ensures reproducible environments. ```bash # Download and install Devbox curl -fsSL https://get.jetify.com/devbox | bash # Initialize Devbox in your project devbox init # Download and install Node.js: devbox add node@${props.release.major} # Open a Devbox shell devbox shell ``` -------------------------------- ### GET /aggregation/v3/customers/{customerId}/transactions Source: https://developer.mastercard.com/open-finance-us/documentation/quick-start-guide/index Fetches all transactions for a particular customer between the specified start and end dates. ```APIDOC ## GET /aggregation/v3/customers/{customerId}/transactions ### Description Retrieves all transactions for a specific customer within a given date range. The dates must be provided as Unix epoch timestamps. ### Method GET ### Endpoint `/aggregation/v3/customers/{customerId}/transactions` ### Parameters #### Path Parameters - **customerId** (string) - Required - The ID of the customer whose transactions are to be fetched. #### Query Parameters - **fromDate** (integer) - Required - The start date for fetching transactions as a Unix epoch timestamp. - **toDate** (integer) - Required - The end date for fetching transactions as a Unix epoch timestamp. - **includePending** (boolean) - Optional - Whether to include pending transactions. - **sort** (string) - Optional - The order in which to sort transactions (e.g., 'asc', 'desc'). - **limit** (integer) - Optional - The maximum number of transactions to return. ### Request Example ```sh curl --location --request GET \ 'https://api.finicity.com/aggregation/v3/customers/{{customerId}}/transactions?fromDate={{fromDate}}&toDate={{toDate}}&includePending=true&sort=desc&limit=25' \ --header 'Finicity-App-Key: {{appKey}}' \ --header 'Accept: application/json' \ --header 'Finicity-App-Token: {{appToken}}' ``` ### Response #### Success Response (200) - **found** (integer) - The total number of transactions found. - **displaying** (integer) - The number of transactions currently being displayed. - **moreAvailable** (string) - Indicates if more transactions are available ('true' or 'false'). - **fromDate** (string) - The start date of the transaction fetch in Unix epoch format. - **toDate** (string) - The end date of the transaction fetch in Unix epoch format. - **sort** (string) - The sorting order applied to the transactions. - **transactions** (array) - A list of transaction objects. - **id** (integer) - The unique identifier for the transaction. - **amount** (number) - The amount of the transaction. - **accountId** (integer) - The ID of the account associated with the transaction. - **customerId** (integer) - The ID of the customer associated with the transaction. - **status** (string) - The status of the transaction (e.g., 'active'). - **description** (string) - A description of the transaction. - **memo** (string) - A memo associated with the transaction. - **postedDate** (integer) - The date the transaction was posted as a Unix epoch timestamp. - **transactionDate** (integer) - The date of the transaction as a Unix epoch timestamp. - **createdDate** (integer) - The date the transaction record was created as a Unix epoch timestamp. - **categorization** (object) - Information about the transaction's categorization. - **normalizedPayeeName** (string) - The normalized name of the payee. - **category** (string) - The category assigned to the transaction. - **bestRepresentation** (string) - The best representation of the transaction payee. - **country** (string) - The country of the payee. #### Response Example ```json { "found": 64, "displaying": 25, "moreAvailable": "true", "fromDate": "1349701444", "toDate": "1665234244", "sort": "desc", "transactions": [ { "id": 13212489147, "amount": 1208.15, "accountId": 6020605022, "customerId": 6012188750, "status": "active", "description": "REMOTE ONLINE DEPOSIT #", "memo": "1", "postedDate": 1665144000, "transactionDate": 1665144000, "createdDate": 1665248277, "categorization": { "normalizedPayeeName": "Remote Online", "category": "Income", "bestRepresentation": "REMOTE ONLINE DEPOSIT", "country": "USA" } } ] } ``` ``` -------------------------------- ### Get Node.js Installation Path with NVM Source: https://github.com/creationix/nvm Retrieves the installation path for a specific Node.js version managed by NVM. This can be helpful for troubleshooting or manual configuration. ```shell nvm which 12.22 ``` -------------------------------- ### Build from Source using Go Source: https://github.com/coreybutler/nvm-windows This snippet outlines the steps to build the project from its source code using Go. It requires installing Go, cloning the repository, adjusting build configurations, and running a batch script. The output is an executable located in the 'dist' directory. Dependencies include 'github.com/blang/semver' and 'github.com/olekukonko/tablewriter'. ```bash go get github.com/blang/semver go get github.com/olekukonko/tablewriter build.bat ``` -------------------------------- ### Install Node Modules from Starter Code Source: https://developer.mastercard.com/open-finance-us/documentation/connect/integrating/sdk/web-sdk/sdk/index Installs all project dependencies, including `connect-web-sdk` and `core-js`, after downloading the starter code zip file. This command should be run from the root directory of the extracted starter code. ```bash npm i ``` -------------------------------- ### Robust NVM Installation for CI/CD in Docker Source: https://github.com/creationix/nvm This Dockerfile illustrates a more robust method for installing NVM within Docker, suitable for CI/CD jobs. It starts from a Ubuntu base image, installs curl, and then downloads and executes the NVM installation script, allowing for a specified Node.js version to be set. ```dockerfile FROM ubuntu:latest ARG NODE_VERSION=20 # install curl RUN apt update && apt install curl -y # install nvm RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash # Set up NVM environment variables and install the specified Node.js version ENV NVM_DIR="$HOME/.nvm" RUN . "$NVM_DIR/nvm.sh" && nvm install $NODE_VERSION && nvm alias default $NODE_VERSION ``` -------------------------------- ### Example Transaction Response JSON Source: https://developer.mastercard.com/open-finance-us/documentation/quick-start-guide/index This is an example of the JSON response structure when fetching customer transactions. It includes metadata about the results and a list of individual transaction objects, each with details like ID, amount, dates, and categorization. ```json { "found": 64, "displaying": 25, "moreAvailable": "true", "fromDate": "1349701444", "toDate": "1665234244", "sort": "desc", "transactions": [ { "id": 13212489147, "amount": 1208.15, "accountId": 6020605022, "customerId": 6012188750, "status": "active", "description": "REMOTE ONLINE DEPOSIT #", "memo": "1", "postedDate": 1665144000, "transactionDate": 1665144000, "createdDate": 1665248277, "categorization": { "normalizedPayeeName": "Remote Online", "category": "Income", "bestRepresentation": "REMOTE ONLINE DEPOSIT", "country": "USA" } }, { "id": 13212489182, "amount": 1216.2, "accountId": 6020605022, "customerId": 6012188750, "status": "active", "description": "Mad Science Research PR PAYMENT", "memo": "PPD ID: 1234567899", "postedDate": 1664884800, "transactionDate": 1664884800, "createdDate": 1665248277, "categorization": { "normalizedPayeeName": "Mad Science Research", "category": "Paycheck", "bestRepresentation": "MAD SCIENCE RESEARCH PR PAYMENT PPD ID", "country": "USA" } }, { "id": 13212489179, "amount": 1500.0, "accountId": 6020605022, "customerId": 6012188750, "status": "active", "description": "JABERWOCKY CREDIT N.A. JABERWOCKY", "memo": "PPD ID: 1234567893", "postedDate": 1664712000, "transactionDate": 1664712000, "createdDate": 1665248277, "categorization": { "normalizedPayeeName": "jaberwocky credit jaberwocky ppd id", "category": "Income", "bestRepresentation": "JABERWOCKY CREDIT JABERWOCKY PPD ID", "country": "USA" } }, { "id": 13212489172, "amount": 1834.49, "accountId": 6020605022, "customerId": 6012188750, "status": "active", "description": "ROCKET SURGERY PAYROLL", "memo": "PPD ID: 1234567892", "postedDate": 1664625600, "transactionDate": 1664625600, "createdDate": 1665248277, "categorization": { "normalizedPayeeName": "Rocket Surgery", "category": "Paycheck", "bestRepresentation": "ROCKET SURGERY PAYROLL PPD ID", "country": "USA" } }, { "id": 13212489185, "amount": 1197.33, "accountId": 6020605022, "customerId": 6012188750, "status": "active", "description": "Mad Science Research PR PAYMENT", "memo": "PPD ID: 1234567899", "postedDate": 1663588800, "transactionDate": 1663588800, "createdDate": 1665248277, "categorization": { "normalizedPayeeName": "Mad Science Research", "category": "Paycheck", "bestRepresentation": "MAD SCIENCE RESEARCH PR PAYMENT PPD ID", "country": "USA" } }, { "id": 13212489150, "amount": 0.03, "accountId": 6020605022, "customerId": 6012188750, "status": "active", "description": "INTEREST PAYMENT", "postedDate": 1663502400, "transactionDate": 1663502400, "createdDate": 1665248277, "categorization": { "normalizedPayeeName": "interest payment", "category": "Interest Income", "bestRepresentation": "INTEREST PAYMENT", "country": "USA" } }, { "id": 13212489145, "amount": 50.0, "accountId": 6020605022, "customerId": 6012188750, "status": "active", "description": "Credit Return: Online Payment 49", "memo": "12345679 To ABC Roofers", "postedDate": 1663329600, "transactionDate": 1663329600 } ] } ``` -------------------------------- ### Configure Default Global Packages with NVM Source: https://github.com/creationix/nvm Specifies a list of npm packages to be installed globally every time a new Node.js version is installed via NVM. This streamlines the setup process by ensuring frequently used packages are pre-installed. ```shell # $NVM_DIR/default-packages rimraf object-inspect@1.0.2 stevemao/left-pad ``` -------------------------------- ### Install and Run Urchin Tests Source: https://github.com/creationix/nvm Instructions for setting up and running tests for the nvm project using Urchin, a testing framework. It covers installing dependencies via npm and executing different sets of tests (fast, slow, or all). ```bash npm install npm run test/fast npm run test/slow npm test ``` -------------------------------- ### Install Node.js Versions with NVM Source: https://github.com/creationix/nvm Commands to install Node.js using NVM. 'nvm install node' installs the latest available version. 'nvm install ' installs a specific version, e.g., 'nvm install 14.7.0'. Comments indicate usage for the latest version and specific version examples. ```shell nvm install node # "node" is an alias for the latest version ``` ```shell nvm install 14.7.0 # or 16.3.0, 12.22.1, etc ``` -------------------------------- ### Manual Install nvm Source: https://github.com/creationix/nvm Provides instructions for manually installing nvm by cloning the repository and sourcing the nvm.sh script. This method requires manual updates and is suitable for environments where automated scripts might not be feasible. ```shell # Clone the repository git clone https://github.com/nvm-sh/nvm.git # Source the nvm script to make it available in the current shell session . "./nvm/nvm.sh" ``` -------------------------------- ### Manual Install NVM Source: https://github.com/creationix/nvm Manually installs NVM by cloning the repository and loading it. This method involves cloning the NVM repository to the specified directory and then sourcing the NVM script. Shell profile configuration is included. ```shell export NVM_DIR="$HOME/.nvm" && ( git clone https://github.com/nvm-sh/nvm.git "$NVM_DIR" cd "$NVM_DIR" git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)` ) && \. "$NVM_DIR/nvm.sh" export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion ``` -------------------------------- ### Get Report Example Source: https://developer.mastercard.com/open-finance-us/documentation/products/lend/reports/cash-flow-analytics/index This endpoint provides an example of a successful JSON response for a Get Report API call. The content of the response varies depending on the specific report requested. ```APIDOC ## Get Report API Example ### Description Provides an example of a successful JSON response for the Get Report API. The data structure varies based on the report type requested. Examples are for reference and may not reflect the latest production changes. ### Method GET ### Endpoint `/example-report` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example (Not applicable for this example response) ### Response #### Success Response (200) - **id** (string) - Unique identifier for the report. - **customerType** (string) - Type of customer. - **customerId** (integer) - Identifier for the customer. - **requestId** (string) - Identifier for the request. - **requesterName** (string) - Name of the entity making the request. - **endUser** (object) - Information about the end user. - **name** (string) - **address** (string) - **city** (string) - **state** (string) - **zip** (string) - **phone** (string) - **email** (string) - **url** (string) - **title** (string) - Title of the report. - **consumerId** (string) - Identifier for the consumer. - **consumerSsn** (string) - Social Security Number of the consumer (masked or partial). - **disputeStatement** (string) - Statement regarding disputes. - **type** (string) - Type of the report. - **status** (string) - Status of the report generation. - **constraints** (object) - Constraints applied to the report. - **analyticsReportData** (object) - **forCraPurpose** (boolean) - **timeIntervalTypes** (array of strings) - **createdDate** (integer) - Timestamp when the report was created. - **startDate** (integer) - Start date of the report data. - **endDate** (integer) - End date of the report data. - **days** (integer) - Number of days covered by the report. - **institutions** (array of objects) - List of financial institutions included. - **id** (integer) - **name** (string) - **urlHomeApp** (string) - **accounts** (array of objects) - **id** (integer) - **ownerName** (string) - **ownerAddress** (string) - **ownerAsOfDate** (integer) - **name** (string) - **number** (string) - **type** (string) - **aggregationStatusCode** (integer) - **currentBalance** (number) - **balanceDate** (integer) - **availableBalance** (number) - Only for checking account types. - **transactions** (array of objects) - **id** (integer) - **amount** (number) - **postedDate** (integer) - **description** (string) - **memo** (string) - **normalizedPayee** (string) - **institutionTransactionId** (string) - **category** (string) - **analytics** (object or null) - **transactionalAttributes** (array of objects) - **attributeName** (string) - **aggregatedByTimePeriods** (array of objects) - **periods** (array of objects) - **count** (integer) - **endDate** (string) - **startDate** (string) - **max** (number) - Optional - **mean** (number) - Optional - **median** (number) - Optional - **min** (number) - Optional - **standardDeviation** (number) - Optional - **sum** (number) - Optional - **currency** (string) #### Response Example ```json { "id": "n1siaxtrn1ni-cfrpcra", "customerType": "testing", "customerId": 1011077785, "requestId": "m8ks9vjq2u", "requesterName": "Open Banking API Tests", "endUser": { "name": "ABC Apartments", "address": "123 Main St", "city": "Murray", "state": "UT", "zip": "84123", "phone": "555-2106", "email": "customerservice@abcapartments.com", "url": "abcapartments.com" }, "title": "Mastercard Open Banking Cash Flow Analytics", "consumerId": "8d510370aae83d459da0b905ee59e714", "consumerSsn": "1147", "disputeStatement": "Invalid data present.", "type": "cfrpcra", "status": "success", "constraints": { "analyticsReportData": { "forCraPurpose": true, "timeIntervalTypes": [ "MONTHLY_CALENDAR" ] } }, "createdDate": 1721813301, "startDate": 1658654901, "endDate": 1721813301, "days": 730, "institutions": [ { "id": 102105, "name": "FinBank Profiles - A", "urlHomeApp": "http://www.finbank.com", "accounts": [ { "id": 3027530342, "ownerName": "JNC PROPERTIES LLC", "ownerAddress": "1944 JAKETOWN RD DONNELLSON IL 62019", "ownerAsOfDate": 1721818584, "name": "Business Investment", "number": "1101", "type": "investment", "aggregationStatusCode": 0, "currentBalance": 100000, "balanceDate": 1721813305, "transactions": [], "analytics": null, "currency": "USD" }, { "id": 3027530343, "ownerName": "NSF USER", "ownerAddress": "123 VINE ST MURRAY, UT 84123", "ownerAsOfDate": 1721813301, "name": "NSF Checking", "number": "0111", "type": "checking", "aggregationStatusCode": 0, "currentBalance": 37700.65, "availableBalance": 38000.45, "balanceDate": 1721813306, "transactions": [ { "id": 101402234899, "amount": -34, "postedDate": 1708776000, "description": "INSUFFICIENT FUNDS FEE FOR A $12", "memo": ".07 ITEM - DETAILS: ALLSTATE INS", "normalizedPayee": "Allstate", "institutionTransactionId": "0000000000", "category": "Low Balance" }, { "id": 101402234924, "amount": -34, "postedDate": 1706961600, "description": "INSUFFICIENT FUNDS FEE FOR A $21", "memo": ".50 ITEM - DETAILS: HK Paymt", "normalizedPayee": "Insufficient", "institutionTransactionId": "0000000000", "category": "Low Balance" }, { "id": 101402234869, "amount": -34, "postedDate": 1679140800, "description": "INSUFFICIENT FUNDS FEE FOR A $64", "memo": ".64 ITEM - DETAILS: UI WEB PAYME", "normalizedPayee": "Insufficient", "institutionTransactionId": "0000000000", "category": "Low Balance" }, { "id": 101402234923, "amount": 34, "postedDate": 1659009600, "description": "INSUFFICIENT FUNDS FEE REFUND", "normalizedPayee": "Insufficient", "institutionTransactionId": "0000000000", "category": "Low Balance" } ], "analytics": { "transactionalAttributes": [ { "attributeName": "CASH_OUTFLOW", "aggregatedByTimePeriods": [ { "periods": [ { "count": 0, "endDate": "2022-07-31", "startDate": "2022-07-28" }, { "count": 5, "endDate": "2022-08-31", "max": -24, "mean": -42.6, "median": -34, "min": -90, "standardDeviation": 26.847718711279736, "startDate": "2022-08-01", "sum": -213 }, { "count": 4, "endDate": "2024-06-30", "max": -26.23, "mean": -31.0575, "median": -32, "min": -34, "startDate": "2024-01-01", "sum": -124.23 } ] } ] } ] }, "currency": "USD" } ] } ] } ``` ``` -------------------------------- ### Install and Run Basic Express App Source: https://expressjs.com/ This snippet demonstrates how to install the Express framework using npm and then create a simple Node.js application that listens on a specified port and responds with 'Hello World!' to root requests. It requires Node.js and npm to be installed. ```bash $ npm install express --save ``` ```javascript const express = require('express') const app = express() const port = 3000 app.get('/', (req, res) => { res.send('Hello World!') }) app.listen(port, () => { console.log(`Example app listening on port ${port}`) }) ```