def send_v_2_connect_email_joint_borrower(self, accept, body): """Does a POST request to /connect/v2/send/email/jointBorrower. Send a Connect email to at least one of the joint borrower’s email addresses. Use the `experience` parameter to call the MVS application module in the body of the request. When the consumer opens the email, MVS prompts for both of the borrowers to enter all their financial, payroll, and paystub information. The primary and joint borrower’s experience is all done in one session. You can prepopulate the consumer’s SSN (only the last 4 digits appear) and DOB to display on the Find employment records page at the beginning of the MVS payroll module. Pass the SSN and DOB values for the consumer in the body of the request call. Args: accept (string): application/json body (V2ConnectEmailRequestJointBorrower): Expected body to be sent with the request Returns: GenerateV2ConnectEmailResponse: Response from the API. Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(accept=accept, body=body) # Prepare query URL _url_path = '/connect/v2/send/email/jointBorrower' _query_builder = Configuration.get_base_uri() _query_builder += _url_path _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'content-type': 'application/json; charset=utf-8', 'Finicity-App-Key': Configuration.finicity_app_key, 'Accept': accept } # Prepare and execute request _request = self.http_client.post(_query_url, headers=_headers, parameters=APIHelper.json_serialize(body)) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body, GenerateV2ConnectEmailResponse.from_dictionary)
def add_customer(self, accept, content_type, body): """Does a POST request to /aggregation/v2/customers/active. This is a version 2 service that replaces version 1. The new version supports passing an applicationId for assigning applicationId's to customers if a partner has more than one registered app. Enroll an active customer, which is the actual owner of one or more real-world accounts. This is a billable customer. This service is not available from the Test Drive. Calls to this service before enrolling in a paid plan will return HTTP 429 (Too Many Requests). Args: accept (string): application/json, application/xml content_type (string): application/json, application/xml body (AddCustomerRequest): The Fields For The New Customer Returns: AddCustomerResponse: Response from the API. default response Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(accept=accept, content_type=content_type, body=body) # Prepare query URL _url_path = '/aggregation/v2/customers/active' _query_builder = Configuration.get_base_uri() _query_builder += _url_path _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'Finicity-App-Key': Configuration.finicity_app_key, 'Accept': accept, 'Content-Type': content_type } # Prepare and execute request _request = self.http_client.post( _query_url, headers=_headers, parameters=APIHelper.json_serialize(body)) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body, AddCustomerResponse.from_dictionary)
def modify_app_registration(self, pre_app_id, body): """Does a PUT request to /aggregation/v1/partners/applications/{preAppId}. Update the field values you want to change for the registered applications accessing financial institutions using OAuth connections. Args: pre_app_id (long|int): The preAppId from the App Registration and Get App Registration Status endpoints body (ModifyAppRegistrationRequest): The values for the app registration modification Returns: AppRegistrationResponse: Response from the API. Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(pre_app_id=pre_app_id, body=body) # Prepare query URL _url_path = '/aggregation/v1/partners/applications/{preAppId}' _url_path = APIHelper.append_url_with_template_parameters( _url_path, {'preAppId': pre_app_id}) _query_builder = Configuration.get_base_uri() _query_builder += _url_path _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'accept': 'application/json', 'content-type': 'application/json; charset=utf-8', 'Finicity-App-Key': Configuration.finicity_app_key } # Prepare and execute request _request = self.http_client.put( _query_url, headers=_headers, parameters=APIHelper.json_serialize(body)) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize( _context.response.raw_body, AppRegistrationResponse.from_dictionary)
def generate_v_2_lite_connect_url(self, accept, body): """Does a POST request to /connect/v2/generate/lite. Connect Lite allows as much control of the customer experience as possible. Lite includes just the essential pages needed for handling credentials and multi-factor authentication that must be handled by Finicity. You would be providing the financial institution search and the account management pages. Connect Lite features: * Sign in, user’s credentials and Multi-Factor Authentication (MFA) * No user account management Args: accept (string): application/json, application/xml body (GenerateConnectURLRequestLiteV2): Expected body to be sent with the request Returns: GenerateConnectURLResponse: Response from the API. Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(accept=accept, body=body) # Prepare query URL _url_path = '/connect/v2/generate/lite' _query_builder = Configuration.get_base_uri() _query_builder += _url_path _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'content-type': 'application/json; charset=utf-8', 'Finicity-App-Key': Configuration.finicity_app_key, 'Accept': accept } # Prepare and execute request _request = self.http_client.post(_query_url, headers=_headers, parameters=APIHelper.json_serialize(body)) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body, GenerateConnectURLResponse.from_dictionary)
def generate_v_2_fix_connect_url(self, accept, body): """Does a POST request to /connect/v2/generate/fix. Fix provides a flow for customers to re-authenticate to their accounts, when the connection to the user’s financial institution is lost. The connection to their accounts can stop working if the account password has changed, the MFA challenge has expired, or the token provided by the financial institution has been revoked. Args: accept (string): application/json, application/xml body (GenerateConnectURLRequestFixV2): Expected body to be sent with the request Returns: GenerateConnectURLResponse: Response from the API. Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(accept=accept, body=body) # Prepare query URL _url_path = '/connect/v2/generate/fix' _query_builder = Configuration.get_base_uri() _query_builder += _url_path _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'content-type': 'application/json; charset=utf-8', 'Finicity-App-Key': Configuration.finicity_app_key, 'Accept': accept } # Prepare and execute request _request = self.http_client.post(_query_url, headers=_headers, parameters=APIHelper.json_serialize(body)) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body, GenerateConnectURLResponse.from_dictionary)
def modify_customer(self, content_type, customer_id, body): """Does a PUT request to /aggregation/v1/customers/{customerId}. Modify the details for an enrolled customer. You must specify either the first name, the last name, or both in the request. If the service is successful, HTTP 204 (No Content) will be returned. Args: content_type (string): application/json, application/xml customer_id (long|int): Finicity ‘s ID of the customer to modify body (ModifyCustomerRequest): The information to be modified for the customer Returns: void: Response from the API. default response Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(content_type=content_type, customer_id=customer_id, body=body) # Prepare query URL _url_path = '/aggregation/v1/customers/{customerId}' _url_path = APIHelper.append_url_with_template_parameters( _url_path, {'customerId': customer_id}) _query_builder = Configuration.get_base_uri() _query_builder += _url_path _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'Finicity-App-Key': Configuration.finicity_app_key, 'Content-Type': content_type } # Prepare and execute request _request = self.http_client.put( _query_url, headers=_headers, parameters=APIHelper.json_serialize(body)) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context)
def app_registration(self, body): """Does a POST request to /aggregation/v1/partners/applications. Register new applications to access financial institutions using OAuth connections. Args: body (AppRegistrationRequest): The values for the new app registration Returns: AppRegistrationResponse: Response from the API. Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(body=body) # Prepare query URL _url_path = '/aggregation/v1/partners/applications' _query_builder = Configuration.get_base_uri() _query_builder += _url_path _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'accept': 'application/json', 'content-type': 'application/json; charset=utf-8', 'Finicity-App-Key': Configuration.finicity_app_key } # Prepare and execute request _request = self.http_client.post( _query_url, headers=_headers, parameters=APIHelper.json_serialize(body)) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize( _context.response.raw_body, AppRegistrationResponse.from_dictionary)
def modify_partner_secret(self, content_type, body): """Does a PUT request to /aggregation/v2/partners/authentication. Change the partner secret that is used to authenticate this partner. The secret does not expire, but can be changed by calling Modify Partner Secret. A valid partner secret may contain upper- and lowercase characters, numbers, and the characters !, @, #, $, %, &, *, _, -, +. It must include at least one number and at least one letter, and its length should be between 12 and 255 characters. Args: content_type (string): application/json body (ModifyPartnerCredentials): Partner ID and Partner Secret From Developer Portal Along With A Value For The New Partner Secret Returns: void: Response from the API. default response Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(content_type=content_type, body=body) # Prepare query URL _url_path = '/aggregation/v2/partners/authentication' _query_builder = Configuration.get_base_uri() _query_builder += _url_path _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'Finicity-App-Key': Configuration.finicity_app_key, 'Content-Type': content_type } # Prepare and execute request _request = self.http_client.put( _query_url, headers=_headers, parameters=APIHelper.json_serialize(body)) _context = self.execute_request(_request) self.validate_response(_context)
def add_testing_customer(self, accept, content_type, body): """Does a POST request to /aggregation/v2/customers/testing. This is a version 2 service that replaces version 1. The new version supports passing an applicationId for assigning applicationId's to customers if a partner has more than one registered app. Enroll a testing customer that is available for Test Drive accounts. For using testing customers when testing Finbank OAuth register a test application with your systems engineer or account manager. You would then use that testing applicationId for the creating of any testing customers. Testing customers can only be assigned to testing OAuth applications and Testing customers can only add accounts to Finbank OAuth for testing OAuth implementation as well as other Finbank testing institutions. Args: accept (string): application/json, application/xml content_type (string): application/json, application/xml body (AddCustomerRequest): The Fields For The New Customer Returns: AddCustomerResponse: Response from the API. default response Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(accept=accept, content_type=content_type, body=body) # Prepare query URL _url_path = '/aggregation/v2/customers/testing' _query_builder = Configuration.get_base_uri() _query_builder += _url_path _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'Finicity-App-Key': Configuration.finicity_app_key, 'Accept': accept, 'Content-Type': content_type } # Prepare and execute request _request = self.http_client.post( _query_url, headers=_headers, parameters=APIHelper.json_serialize(body)) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body, AddCustomerResponse.from_dictionary)
def create_consumer(self, customer_id, body, accept, content_type): """Does a POST request to /decisioning/v1/customers/{customerId}/consumer. Create a consumer record associated with the given customer. A consumer persists as the owner of any reports that are generated, even after the original customer is deleted from the system. A consumer must be created for the given customer before calling any of the Generate Report services. If a consumer already exists for this customer, this service will return HTTP 409 (Conflict). If the consumer is successfully created, the service will return HTTP 201 (Created). Args: customer_id (long|int): Finicity’s ID for the customer body (CreateConsumerRequest): TODO: type description here. Example: accept (string): Replace 'json' with 'xml' if preferred content_type (string): Replace 'json' with 'xml' if preferred Returns: CreateConsumerResponse: Response from the API. Created Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(customer_id=customer_id, body=body, accept=accept, content_type=content_type) # Prepare query URL _url_path = '/decisioning/v1/customers/{customerId}/consumer' _url_path = APIHelper.append_url_with_template_parameters( _url_path, {'customerId': customer_id}) _query_builder = Configuration.get_base_uri() _query_builder += _url_path _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'Finicity-App-Key': Configuration.finicity_app_key, 'Accept': accept, 'Content-Type': content_type } # Prepare and execute request _request = self.http_client.post( _query_url, headers=_headers, parameters=APIHelper.json_serialize(body)) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) # Endpoint and global error handling using HTTP status codes. if _context.response.status_code == 404: raise Error1ErrorException('Bad Request', _context) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize( _context.response.raw_body, CreateConsumerResponse.from_dictionary)
def create_txpush_test_transaction(self, content_type, accept, customer_id, account_id, body): """Does a POST request to /aggregation/v1/customers/{customerId}/accounts/{accountId}/transactions. Inject a transaction into the transaction list for a testing account. This allows an app to trigger TxPush notifications for the account in order to test the app’s TxPush Listener service. This causes the platform to send one transaction event and one account event (showing that the account balance has changed). This service is only supported for testing accounts (accounts on institution 101732). Args: content_type (string): application/json, application/xml accept (string): application/json, application/xml customer_id (long|int): The ID of the customer who owns the account account_id (long|int): The Finicity ID of the account whose events will be sent to the TxPUSH Listener body (CreateTxpushTestTransactionRequest): TODO: type description here. Example: Returns: CreateTxpushTestTransactionResponse: Response from the API. default response Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(content_type=content_type, accept=accept, customer_id=customer_id, account_id=account_id, body=body) # Prepare query URL _url_path = '/aggregation/v1/customers/{customerId}/accounts/{accountId}/transactions' _url_path = APIHelper.append_url_with_template_parameters( _url_path, { 'customerId': customer_id, 'accountId': account_id }) _query_builder = Configuration.get_base_uri() _query_builder += _url_path _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'Finicity-App-Key': Configuration.finicity_app_key, 'Content-Type': content_type, 'Accept': accept } # Prepare and execute request _request = self.http_client.post( _query_url, headers=_headers, parameters=APIHelper.json_serialize(body)) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize( _context.response.raw_body, CreateTxpushTestTransactionResponse.from_dictionary)
def refresh_voie_payroll_report(self, customer_id, accept, content_type, body, callback_url=None): """Does a POST request to /decisioning/v2/customers/{customerId}/voiePayrollProvider. The VOIE – Payroll report generates when the customer completes Connect. Lenders, who commonly use this report for pre-close verification employment check, can refresh this report by passing the consumer’s SSN, DOB, and the `reportId` from the first VOIE – Payroll report they received. We’ll refresh this report and update any new pay histories since the first report generated, including borrower’s employment status as active or not. Note: Lenders can only refresh this report one time in a 60-day period starting from the date of the first report. Any further report refreshes will incur additional charges. The service immediately returns the status HTTP 202 (accepted). A notification gets sent to the report callback URL, if specified. After the call is made, the client’s application can wait for a notification sent by the Report Listener Service. Or it may enter a loop, which waits about 20 seconds and then calls the service, Get Report to check if the report is finished. While the report’s generating, Get Report returns a minimal report with a status of InProgress. The loop repeats every 20 seconds until Get Report returns a different status. Args: customer_id (long|int): Finicity ID for the customer accept (string): application/json content_type (string): application/json body (VOIEPayrollReportRefreshConstraints): TODO: type description here. Example: callback_url (string, optional): The Report Listener URL to receive notifications (optional, must be URL-encoded). Returns: RefreshVOIEPayrollReportResponse: Response from the API. Accepted Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(customer_id=customer_id, accept=accept, content_type=content_type, body=body) # Prepare query URL _url_path = '/decisioning/v2/customers/{customerId}/voiePayrollProvider' _url_path = APIHelper.append_url_with_template_parameters( _url_path, {'customerId': customer_id}) _query_builder = Configuration.get_base_uri() _query_builder += _url_path _query_parameters = {'callbackUrl': callback_url} _query_builder = APIHelper.append_url_with_query_parameters( _query_builder, _query_parameters, Configuration.array_serialization) _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'Finicity-App-Key': Configuration.finicity_app_key, 'Accept': accept, 'Content-Type': content_type } # Prepare and execute request _request = self.http_client.post( _query_url, headers=_headers, parameters=APIHelper.json_serialize(body)) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) # Endpoint and global error handling using HTTP status codes. if _context.response.status_code == 400: raise Error1ErrorException('Bad Request', _context) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize( _context.response.raw_body, RefreshVOIEPayrollReportResponse.from_dictionary)
def generate_voi_report(self, customer_id, accept, content_type, callback_url=None, body=None): """Does a POST request to /decisioning/v2/customers/{customerId}/voi. Generate a Verification of Income (VOI) report for all checking, savings, and money market accounts for the given customer. This service retrieves up to two years of transaction history for each account and uses this information to generate the VOI report. This is a premium service. The billing rate is the variable rate for Verification of Income under the current subscription plan. The billable event is the successful generation of a VOI report. HTTP status of 202 (Accepted) means the report is being generated. When the report is finished, a notification will be sent to the specified report callback URL, if specified. If no account of type of checking, savings, or money market is found, the service will return HTTP 400 (Bad Request). Args: customer_id (long|int): Finicity ID for the customer accept (string): Replace 'json' with 'xml' if preferred content_type (string): Replace 'json' with 'xml' if preferred callback_url (string, optional): The Report Listener URL to receive notifications (optional, must be URL-encoded). body (RequestConstraints, optional): TODO: type description here. Example: Returns: GenerateVOIReportResponse: Response from the API. Accepted Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(customer_id=customer_id, accept=accept, content_type=content_type) # Prepare query URL _url_path = '/decisioning/v2/customers/{customerId}/voi' _url_path = APIHelper.append_url_with_template_parameters( _url_path, {'customerId': customer_id}) _query_builder = Configuration.get_base_uri() _query_builder += _url_path _query_parameters = {'callbackUrl': callback_url} _query_builder = APIHelper.append_url_with_query_parameters( _query_builder, _query_parameters, Configuration.array_serialization) _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'Finicity-App-Key': Configuration.finicity_app_key, 'Accept': accept, 'Content-Type': content_type } # Prepare and execute request _request = self.http_client.post( _query_url, headers=_headers, parameters=APIHelper.json_serialize(body)) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) # Endpoint and global error handling using HTTP status codes. if _context.response.status_code == 400: raise Error1ErrorException('Bad Request', _context) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize( _context.response.raw_body, GenerateVOIReportResponse.from_dictionary)
def send_v_2_connect_email(self, accept, body): """Does a POST request to /connect/v2/send/email. Rather than adding a Connect URL link into your applications, this API allows you to send a Connect email to the consumer. The `experience` parameter refers to the type of connect experience (per session) you want for the customer such as, the brand color, logo, icon, and which credit decisioning report to generate when the Connect application completes. **Note**: Contact your Sales Account Team to set up the `experience` parameter. **MVS Developers**: Use the `experience` parameter to call (per session) the MVS application modules in the body of the request. When the consumer opens the email, they’ll click a button that opens the Connect application or the MVS application modules. You can prepopulate the consumer’s SSN (only the last 4 digits appear) and DOB to display on the Find employment records page at the beginning of the MVS payroll module. Pass the SSN and DOB values for the consumer in the body of the request call. Args: accept (string): application/json body (GenerateV2ConnectEmailRequest): Expected body to be sent with the request Returns: GenerateV2ConnectEmailResponse: Response from the API. Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(accept=accept, body=body) # Prepare query URL _url_path = '/connect/v2/send/email' _query_builder = Configuration.get_base_uri() _query_builder += _url_path _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'content-type': 'application/json; charset=utf-8', 'Finicity-App-Key': Configuration.finicity_app_key, 'Accept': accept } # Prepare and execute request _request = self.http_client.post(_query_url, headers=_headers, parameters=APIHelper.json_serialize(body)) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body, GenerateV2ConnectEmailResponse.from_dictionary)
def generate_v_2_connect_url(self, accept, body): """Does a POST request to /connect/v2/generate. No matter how you plan on implementing Finicity Connect, you’ll need to generate and retrieve a Finicity Connect Link. Connect provides you with a complete user experience, which requires minimal work in integration. Once you have generated the link it will only last until the authentication token under which it was generated expires. After that you will need to regenerate the Connect link under a new authentication token. We recommend generating a new authentication token when you generate a Connect link, to guarantee a full two hour life-span. Connect features: * Sign in, the user’s credentials and Multi-Factor Authentication (MFA) * Search for the user’s financial institutions * Manage the user’s accounts **MVS Developers** Use the `experience` parameter to call (per session) the Connect and the MVS application modules in the body of the request. You can prepopulate the consumer’s SSN (only the last 4 digits appear) and DOB to display on the Find employment records page at the beginning of the MVS payroll module. Pass the SSN and DOB values for the consumer in the body of the request call. Args: accept (string): application/json, application/xml body (GenerateV2ConnectURLRequest): Expected body to be sent with the request Returns: GenerateConnectURLResponse: Response from the API. Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(accept=accept, body=body) # Prepare query URL _url_path = '/connect/v2/generate' _query_builder = Configuration.get_base_uri() _query_builder += _url_path _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'content-type': 'application/json; charset=utf-8', 'Finicity-App-Key': Configuration.finicity_app_key, 'Accept': accept } # Prepare and execute request _request = self.http_client.post(_query_url, headers=_headers, parameters=APIHelper.json_serialize(body)) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body, GenerateConnectURLResponse.from_dictionary)
def generate_transactions_report(self, accept, callback_url, customer_id, body, from_date, to_date, include_pending): """Does a POST request to /decisioning/v2/customers/{customerId}/transactions. Generate a Transaction Report for specified accounts under the given customer. This service retrieves up to 24 months of transaction history for the given customer. It then uses this information to generate the Transaction Report. The service returns immediately with status HTTP 202 (Accepted). When finished, a notification will be sent to the specified report callback URL, if specified. This is a premium service. A billable event will be created upon the successful generation of the Transactions Report. After making this call, the client app may wait for a notification to be sent to the Report Listener Service, or it may enter a loop, which should wait 20 seconds and then call the service Get Report to see if the report is finished. While the report is being generated, Get Report will return a minimal report including status inProgress. The loop should repeat every 20 seconds until Get Report returns a different status. A Report Consumer must be created for the given Customer (using Create Report Consumer) before calling this service. If no Report Consumer has been created, the service will return HTTP 400 (Bad Request). There cannot be more than 24 months between fromDate and toDate. Args: accept (string): JSON or XML output. callback_url (string): The Report Listener URL to receive notifications (optional, must be URL-encoded) customer_id (long|int): ID of the customer body (GenerateTransactionsReportConstraints): TODO: type description here. Example: from_date (long|int): The `fromDate` param is an Epoch Timestamp (in seconds). It must be 10 digits long and within two years of the present day. Example: ?fromDate=1494449017. If fromDate is not used or it’s longer than 10 digits, the transaction report history defaults to 24 months of data. (Optional) to_date (long|int): The ending timestamp for the date range. The value must be greater than fromDate. See Handling Dates and Times. include_pending (bool): True: Include pending transactions in the report. False: Set by default. Returns: GenerateTransactionsReportResponse: Response from the API. Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(accept=accept, callback_url=callback_url, customer_id=customer_id, body=body, from_date=from_date, to_date=to_date, include_pending=include_pending) # Prepare query URL _url_path = '/decisioning/v2/customers/{customerId}/transactions' _url_path = APIHelper.append_url_with_template_parameters( _url_path, {'customerId': customer_id}) _query_builder = Configuration.get_base_uri() _query_builder += _url_path _query_parameters = { 'callbackUrl': callback_url, 'fromDate': from_date, 'toDate': to_date, 'includePending': include_pending } _query_builder = APIHelper.append_url_with_query_parameters( _query_builder, _query_parameters, Configuration.array_serialization) _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'content-type': 'application/json; charset=utf-8', 'Finicity-App-Key': Configuration.finicity_app_key, 'Accept': accept } # Prepare and execute request _request = self.http_client.post( _query_url, headers=_headers, parameters=APIHelper.json_serialize(body)) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize( _context.response.raw_body, GenerateTransactionsReportResponse.from_dictionary)
def partner_authentication(self, content_type, accept, body): """Does a POST request to /aggregation/v2/partners/authentication. Partner ID and Partner Secret: Sends to the Partner Authentication service to obtain a token for accessing the APIs. •The token is valid for two hours and is required on all calls to the Finicity APIs •As a best practice, use a single token for all calls. Assign a timestamp for each token, and then check the current timestamp before making any calls. If the token is greater than 90 minutes, generate a new one. Finicity-App-Key: Required on all calls to the Finicity APIs to identify your application. After five failed attempts to authenticate, your account is locked. Contact [email protected] to get help resetting your account. Args: content_type (string): application/json accept (string): application/json body (PartnerCredentials): Partner ID and Partner Secret From Developer Portal Returns: AuthenticationResponse: Response from the API. default response Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(content_type=content_type, accept=accept, body=body) # Prepare query URL _url_path = '/aggregation/v2/partners/authentication' _query_builder = Configuration.get_base_uri() _query_builder += _url_path _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'Finicity-App-Key': Configuration.finicity_app_key, 'Content-Type': content_type, 'Accept': accept } # Prepare and execute request _request = self.http_client.post( _query_url, headers=_headers, parameters=APIHelper.json_serialize(body)) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize( _context.response.raw_body, AuthenticationResponse.from_dictionary)
def generate_statement_report(self, accept, customer_id, body, callback_url=None): """Does a POST request to /decisioning/v2/customers/{customerId}/statement. Generate a Statement Report report for specified accounts under the given customer. This report requires a consumer. The service returns immediately with status HTTP 202 (Accepted). When finished, a notification will be sent to the specified report callback URL, if specified. This is a premium service. A billable event will be created upon the successful generation of the Statement Report. After making this call, the client app may wait for a notification to be sent to the Report Listener Service, or it may enter a loop, which should wait 20 seconds and then call the service Get Report to see if the report is finished. While the report is being generated, Get Report will return a minimal report including status inProgress. The loop should repeat every 20 seconds until Get Report returns a different status. A Report Consumer must be created for the given Customer (using Create Report Consumer) before calling this service. If no Report Consumer has been created, the service will return HTTP 400 (Bad Request). Args: accept (string): Replace 'json' with 'xml' if preferred customer_id (long|int): ID of the customer body (GenerateStatementReportConstraints): TODO: type description here. Example: callback_url (string, optional): The Report Listener URL to receive notifications (optional, must be URL-encoded) Returns: GenerateStatementReportResponse: Response from the API. Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(accept=accept, customer_id=customer_id, body=body) # Prepare query URL _url_path = '/decisioning/v2/customers/{customerId}/statement' _url_path = APIHelper.append_url_with_template_parameters( _url_path, {'customerId': customer_id}) _query_builder = Configuration.get_base_uri() _query_builder += _url_path _query_parameters = {'callbackUrl': callback_url} _query_builder = APIHelper.append_url_with_query_parameters( _query_builder, _query_parameters, Configuration.array_serialization) _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'content-type': 'application/json; charset=utf-8', 'Finicity-App-Key': Configuration.finicity_app_key, 'Accept': accept } # Prepare and execute request _request = self.http_client.post( _query_url, headers=_headers, parameters=APIHelper.json_serialize(body)) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize( _context.response.raw_body, GenerateStatementReportResponse.from_dictionary)
def store_customer_pay_statement(self, finicity_app_key, finicity_app_token, customer_id, body): """Does a POST request to /aggregation/v1/customers/{customerId}/payStatements. Services to store a pay statement for a customer. Within the body of the request, the base 64 encoded value of the pay statement must be passed with a label. Args: finicity_app_key (string): Finicity-App-Key from Developer Portal finicity_app_token (string): Token returned from Partner Authentication customer_id (long|int): Finicity's ID of the customer body (StorePayStatementRequest): The label to be associated with the pay statement. These are recommended labels: - lastPayPeriod – The most recent (last) pay statement. This label will allow the paystub to go through primary data extraction. - lastPayPeriodMinusOne – The second most recent pay statement - lastPayPeriodMinusTwo – The third most recent pay statement - previousYearLastPayPeriod – Last pay statement of the previous calendar year - previousYear2LastPayPeriod – Last pay statement of the calendar year 2 years prior - earliestPayPeriod – The earliest pay statement statement - The base 64 encoded value for the pay statement. Returns: StorePayStatementResponse: Response from the API. default response Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(finicity_app_key=finicity_app_key, finicity_app_token=finicity_app_token, customer_id=customer_id, body=body) # Prepare query URL _url_path = '/aggregation/v1/customers/{customerId}/payStatements' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { 'customerId': customer_id }) _query_builder = Configuration.get_base_uri() _query_builder += _url_path _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'accept': 'application/json', 'content-type': 'application/json; charset=utf-8', 'Finicity-App-Key': finicity_app_key, 'Finicity-App-Token': finicity_app_token } # Prepare and execute request _request = self.http_client.post(_query_url, headers=_headers, parameters=APIHelper.json_serialize(body)) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body, StorePayStatementResponse.from_dictionary)
def generate_pay_statement_report(self, customer_id, accept, content_type, body, callback_url=None): """Does a POST request to /decisioning/v2/customers/{customerId}/payStatement. Generate Pay Statement Extraction Report for the given customer. This service accepts asset IDs of the stored pay statements to generate a Pay Statement Extraction Report. This is a premium service. The billing rate is the variable rate for Pay Statement Extraction Report under the current subscription plan. The billable event is the successful generation of a Pay Statement Extraction Report. The service returns immediately with status HTTP 202 (Accepted) if successful. When finished, a notification will be sent to the specified report callback URL, if specified. After making this call, the client app may wait for a notification to be sent to the Report Listener Service, or it may enter a loop, which should wait 20 seconds and then call the service Get Report to see if the report is finished. While the report is being generated, Get Report will return a minimal report including status inProgress. The loop should repeat every 20 seconds until Get Report returns a different status. The service will return HTTP 400 (Bad Request) if the asset ID does not exist within Finicity?s system. Args: customer_id (long|int): Finicity ID of the customer accept (string): Replace 'json' with 'xml' if preferred content_type (string): Replace 'json' with 'xml' if preferred body (PayStatementConstraints): TODO: type description here. Example: callback_url (string, optional): The Report Listener URL to receive notifications (optional, must be URL-encoded). Returns: GeneratePayStatementReportResponse: Response from the API. Accepted Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(customer_id=customer_id, accept=accept, content_type=content_type, body=body) # Prepare query URL _url_path = '/decisioning/v2/customers/{customerId}/payStatement' _url_path = APIHelper.append_url_with_template_parameters( _url_path, {'customerId': customer_id}) _query_builder = Configuration.get_base_uri() _query_builder += _url_path _query_parameters = {'callbackUrl': callback_url} _query_builder = APIHelper.append_url_with_query_parameters( _query_builder, _query_parameters, Configuration.array_serialization) _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'Finicity-App-Key': Configuration.finicity_app_key, 'Accept': accept, 'Content-Type': content_type } # Prepare and execute request _request = self.http_client.post( _query_url, headers=_headers, parameters=APIHelper.json_serialize(body)) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) # Endpoint and global error handling using HTTP status codes. if _context.response.status_code == 400: raise Error1ErrorException('Bad Request', _context) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize( _context.response.raw_body, GeneratePayStatementReportResponse.from_dictionary)
def generate_voa_with_income_report(self, customer_id, accept, content_type, callback_url=None, from_date=None, body=None): """Does a POST request to /decisioning/v2/customers/{customerId}/voaHistory. Generate a Verification of Assets with GSE Income View (VOAHistory) report for all checking, savings, money market, and investment accounts for the given customer. This service retrieves up to 24 months of transaction history for each account and uses this information to generate the VOAHistory report. This is a premium service. The billing rate is the variable rate for Verification of Assets under the current subscription plan. The billable event is the successful generation of a VOAhistory report. A report consumer must be created for the given customer before calling Generate VOAHistory Report (see Report Consumers). After making this call, the client app may wait for a notification to be sent to the Report Listener Service, or it may enter a loop, which should wait 20 seconds and then call the service Get Report to see if the report is finished. While the report is being generated, Get Report will return a minimal report with status inProgress. The loop should repeat every 20 seconds until Get Report returns a different status. If using the listener service, the following format must be followed and the webhook must respond to the Finicity API with a 200 series code: https://api.finicity.com/decisioning/v2/customers/[customerId]/voaHisto ry?callbackUrl=[webhookUrl] HTTP status of 202 (Accepted) means the report is being generated. When the report is finished, a notification will be sent to the specified report callback URL, if specified. If no account of type of checking, savings, money market, or investment is found, the service will return HTTP 400 (Bad Request). Args: customer_id (long|int): Finicity Id of the customer accept (string): Replace 'json' with 'xml' if preferred content_type (string): Replace 'json' with 'xml' if preferred callback_url (string, optional): The Report Listener URL to receive notifications (optional, must be URL-encoded). from_date (long|int, optional): The fromDate parameter is an Epoch Timestamp (in seconds), such as ?1494449017?. Without this parameter, the report defaults to 61 days if available. This will limit the amount of credit and debit transactions included in the report up to the date specified, but will not limit the amount of income stream transactions. The income stream transactions are all included, up to 24 months, to help the lender and GSE's have the full history to validate income. Example: ?fromDate={fromDate}If included, the epoch timestamp should be 10 digits long and be within two years of the present day. Extending the epoch timestamp beyond 10 digits will default back to 2 years of data. This query is optional. body (RequestConstraints, optional): TODO: type description here. Example: Returns: GenerateVOAWithIncomeReportResponse: Response from the API. Accepted Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(customer_id=customer_id, accept=accept, content_type=content_type) # Prepare query URL _url_path = '/decisioning/v2/customers/{customerId}/voaHistory' _url_path = APIHelper.append_url_with_template_parameters( _url_path, {'customerId': customer_id}) _query_builder = Configuration.get_base_uri() _query_builder += _url_path _query_parameters = { 'callbackUrl': callback_url, 'fromDate': from_date } _query_builder = APIHelper.append_url_with_query_parameters( _query_builder, _query_parameters, Configuration.array_serialization) _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'Finicity-App-Key': Configuration.finicity_app_key, 'Accept': accept, 'Content-Type': content_type } # Prepare and execute request _request = self.http_client.post( _query_url, headers=_headers, parameters=APIHelper.json_serialize(body)) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) # Endpoint and global error handling using HTTP status codes. if _context.response.status_code == 400: raise Error1ErrorException('Bad Request', _context) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize( _context.response.raw_body, GenerateVOAWithIncomeReportResponse.from_dictionary)
def enable_institutions_certification_subscription(self, accept, content_type, body): """Does a PUT request to /institution/v2/institutions/subscription. Subscription to a webhook service to return changes in certification status for financial institutions as they happen. Webhook example....... { "name": "FinBank", "id": 101722, "changes": { "voi": true, "voa": false } } Args: accept (string): application/json, application/xml content_type (string): application/json, application/xml body (InstitutionsCertificationSubscriptionRequest): TODO: type description here. Example: Returns: InstitutionsCertificationSubscriptionResponse: Response from the API. Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(accept=accept, content_type=content_type, body=body) # Prepare query URL _url_path = '/institution/v2/institutions/subscription' _query_builder = Configuration.get_base_uri() _query_builder += _url_path _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'Finicity-App-Key': Configuration.finicity_app_key, 'Accept': accept, 'Content-Type': content_type } # Prepare and execute request _request = self.http_client.put( _query_url, headers=_headers, parameters=APIHelper.json_serialize(body)) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize( _context.response.raw_body, InstitutionsCertificationSubscriptionResponse.from_dictionary)
def generate_asset_summary_report(self, customer_id, accept, content_type, callback_url=None, body=None): """Does a POST request to /decisioning/v2/customers/{customerId}/assetSummary. Generate Asset Summary report (assetSummary) for all checking, savings, money market, and investment accounts for the given customer. This service retrieves account and owner information as well as the number of NSFs for any account that is a checking account for the customer. This is a premium service. The billing rate is billed per report for the Asset Summary report. After making this call, the client app may wait for a notification to be sent to the Report Listener Service, or it may enter a loop, which should wait 20 seconds and then call the service Get Report to see if the report is finished. While the report is being generated, Get Report will return a minimal report with status inProgress. The loop should repeat every 20 seconds until Get Report returns a different status. If using the listener service, the following format must be followed and the webhook must respond to the Finicity API with a 200 series code: https://api.finicity.com/decisioning/v2/customers/[customerId]/assetSum mary?callbackUrl=[webhookUrl] HTTP status of 202 (Accepted) means the report is being generated. When the report is finished, a notification will be sent to the specified report callback URL, if specified. If no account type of checking, savings, money market, or investment is found, the service will return HTTP 400 (Bad Request). Args: customer_id (long|int): Finicity's ID of the customer accept (string): Replace 'json' with 'xml' if preferred content_type (string): Replace 'json' with 'xml' if preferred callback_url (string, optional): The Report Listener URL to receive notifications (optional, must be URL-encoded). body (RequestConstraints, optional): TODO: type description here. Example: Returns: GenerateAssetSummaryReportResponse: Response from the API. Accepted Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(customer_id=customer_id, accept=accept, content_type=content_type) # Prepare query URL _url_path = '/decisioning/v2/customers/{customerId}/assetSummary' _url_path = APIHelper.append_url_with_template_parameters( _url_path, {'customerId': customer_id}) _query_builder = Configuration.get_base_uri() _query_builder += _url_path _query_parameters = {'callbackUrl': callback_url} _query_builder = APIHelper.append_url_with_query_parameters( _query_builder, _query_parameters, Configuration.array_serialization) _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'Finicity-App-Key': Configuration.finicity_app_key, 'Accept': accept, 'Content-Type': content_type } # Prepare and execute request _request = self.http_client.post( _query_url, headers=_headers, parameters=APIHelper.json_serialize(body)) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) # Endpoint and global error handling using HTTP status codes. if _context.response.status_code == 400: raise Error1ErrorException('Bad Request', _context) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize( _context.response.raw_body, GenerateAssetSummaryReportResponse.from_dictionary)
def subscribe_to_txpush_notifications(self, content_type, accept, customer_id, account_id, body): """Does a POST request to /aggregation/v1/customers/{customerId}/accounts/{accountId}/txpush. Register a client app’s TxPUSH Listener to receive TxPUSH notifications related to the given account. Each call to this service will return two records, one with class account and one with class transaction. Account events are sent when values change in the account’s fields (such as balance or interestRate). Transaction events are sent whenever a new transaction is posted for the account. For institutions that do not provide TxPUSH services, notifications are sent as soon as Finicity finds a new transaction or new account data through regular aggregation processes. The listener’s URL must be secure (https) for any real-world account. In addition, the client’sTxPUSH Listener will need to be verified. HTTP and HTTPS connections are only allowed on the standard ports 80 (HTTP) and 443 (HTTPS). The use of other ports will result with the call failing. For additional details on this process please see, TxPUSH Listener Service. Args: content_type (string): application/json, application/xml accept (string): application/json, application/xml customer_id (long|int): The Finicity ID of the customer who owns the account account_id (long|int): The Finicity ID of the account whose events will be sent to the TxPUSH Listener body (TxpushSubscriptionRequest): TODO: type description here. Example: Returns: TxpushSubscriptions: Response from the API. default response Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(content_type=content_type, accept=accept, customer_id=customer_id, account_id=account_id, body=body) # Prepare query URL _url_path = '/aggregation/v1/customers/{customerId}/accounts/{accountId}/txpush' _url_path = APIHelper.append_url_with_template_parameters( _url_path, { 'customerId': customer_id, 'accountId': account_id }) _query_builder = Configuration.get_base_uri() _query_builder += _url_path _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'Finicity-App-Key': Configuration.finicity_app_key, 'Content-Type': content_type, 'Accept': accept } # Prepare and execute request _request = self.http_client.post( _query_url, headers=_headers, parameters=APIHelper.json_serialize(body)) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) self.validate_response(_context) # Return appropriate type return APIHelper.json_deserialize(_context.response.raw_body, TxpushSubscriptions.from_dictionary)
def modify_consumer(self, consumer_id, body, accept, content_type): """Does a PUT request to /decisioning/v1/consumers/{consumerId}. Modify the details for an existing consumer. All fields are required for a consumer record, but individual fields for this call are optional because fields that are not specified will be left unchanged. If the service is successful, HTTP 204 (No Content) will be returned. If the consumer does not exist, the service will return HTTP 404. Args: consumer_id (string): Finicity ID of the consumer (UUID with max length 32 characters) body (ModifyConsumerRequest): Consumer details accept (string): Replace 'json' with 'xml' if preferred content_type (string): Replace 'json' with 'xml' if preferred Returns: void: Response from the API. No Content Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. """ # Validate required parameters self.validate_parameters(consumer_id=consumer_id, body=body, accept=accept, content_type=content_type) # Prepare query URL _url_path = '/decisioning/v1/consumers/{consumerId}' _url_path = APIHelper.append_url_with_template_parameters( _url_path, {'consumerId': consumer_id}) _query_builder = Configuration.get_base_uri() _query_builder += _url_path _query_url = APIHelper.clean_url(_query_builder) # Prepare headers _headers = { 'Finicity-App-Key': Configuration.finicity_app_key, 'Accept': accept, 'Content-Type': content_type } # Prepare and execute request _request = self.http_client.put( _query_url, headers=_headers, parameters=APIHelper.json_serialize(body)) CustomHeaderAuth.apply(_request) _context = self.execute_request(_request) # Endpoint and global error handling using HTTP status codes. if _context.response.status_code == 404: raise Error1ErrorException('Bad Request', _context) self.validate_response(_context)