Money Forward Expense Connector for CData Sync

Build 23.0.8839
  • Money Forward Expense
    • Establishing a Connection
      • Creating a Custom OAuth Application
    • Advanced Features
      • SSL Configuration
      • Firewall and Proxy
    • Data Model
      • Tables
        • Departments
        • MyTransactions
        • OfficeMembers
        • OfficeMemberSettings
        • OfficeMemberWorkflows
        • Positions
        • Projects
      • Views
        • ApprovingReports
        • Excises
        • InvoiceReports
        • Items
        • MyApprovingReports
        • MyInvoiceReports
        • MyReports
        • Offices
        • Reports
        • ReportUnits
        • Transactions
    • Connection String Options
      • Authentication
        • OfficeId
      • OAuth
        • OAuthClientId
        • OAuthClientSecret
      • SSL
        • SSLServerCert
      • Firewall
        • FirewallType
        • FirewallServer
        • FirewallPort
        • FirewallUser
        • FirewallPassword
      • Proxy
        • ProxyAutoDetect
        • ProxyServer
        • ProxyPort
        • ProxyAuthScheme
        • ProxyUser
        • ProxyPassword
        • ProxySSLType
        • ProxyExceptions
      • Logging
        • LogModules
      • Schema
        • Location
        • BrowsableSchemas
        • Tables
        • Views
      • Miscellaneous
        • MaxRows
        • Other
        • PseudoColumns
        • Timeout
        • UserDefinedViews

Money Forward Expense Connector for CData Sync

Overview

The CData Sync App provides a straightforward way to continuously pipeline your Money Forward Expense data to any database, data lake, or data warehouse, making it easily available for Analytics, Reporting, AI, and Machine Learning.

The Money Forward Expense connector can be used from the CData Sync application to pull data from Money Forward Expense and move it to any of the supported destinations.

Money Forward Expense Version Support

The Sync App models entities in version 1.x of the Money Forward Expense REST API as relational tables.

Money Forward Expense Connector for CData Sync

Establishing a Connection

Adding a Connection to Money Forward Expense

To add a connection to Money Forward Expense:

  1. In the application console, navigate to the Connections page.
  2. At the Add Connections panel, select the icon for the connection you want to add.
  3. If the Money Forward Expense icon is not available, click the Add More icon to download and install the Money Forward Expense connector from the CData site.

For required properties, see the Settings tab.

For connection properties that are not typically required, see the Advanced tab.

Connecting to Money Forward Expense

Money Forward Expense supports OAuth authentication only. To enable this authentication from all OAuth flows, you must create a custom OAuth application, and you must set AuthScheme to OAuth.

The following subsections describe how to authenticate to Money Forward Expense from the three most common authentication flows. For information about how to create a custom OAuth application, see Creating a Custom OAuth Application. For a complete list of connection string properties available in Money Forward Expense, see Connection.

Note: In addition to the connection properties listed below, most Money Forward Expense tables also require the user to set OfficeId.

Automatic refresh of the OAuth access token:

To have the Sync App automatically refresh the OAuth access token:

  1. Before connecting to data for the first time, set these connection parameters:
    • InitiateOAuth: REFRESH.
    • OAuthClientId: The client Id in your application settings.
    • OAuthClientSecret: The client secret in your application settings.
    • OAuthAccessToken: The access token returned by GetOAuthAccessToken.
    • OAuthSettingsLocation: The path where you want the Sync App to save the OAuth values, which persist across connections.
  2. On subsequent data connections, set:
    • InitiateOAuth
    • OAuthSettingsLocation

Manual refresh of the OAuth access token:

The only value needed to manually refresh the OAuth access token is the OAuth refresh token.

  1. To manually refresh the OAuthAccessToken after the ExpiresIn period (returned by GetOAuthAccessToken) has elapsed, call the RefreshOAuthAccessToken stored procedure.
  2. Set these connection properties:

    • OAuthClientId: The Client Id in your application settings.
    • OAuthClientSecret: The Client Secret in your application settings.

  3. Call RefreshOAuthAccessToken with OAuthRefreshToken set to the OAuth refresh token returned by GetOAuthAccessToken.
  4. After the new tokens have been retrieved, set the OAuthAccessToken property to the value returned by RefreshOAuthAccessToken. This opens a new connection.

Store the OAuth refresh token so that you can use it to manually refresh the OAuth access token after it has expired.

Money Forward Expense Connector for CData Sync

Creating a Custom OAuth Application

Creating a Custom OAuth Application

The following procedure obtains the OAuth client credentials, the OAuthClientId, OAuthClientSecret, and CallbackURL.

  1. Log into your Money Forward Expense account and click API Linkage under the For Developers section.
  2. Click Create Application.
  3. If you are making a desktop application, set the Redirect URI to https://oauth.cdata.com/oauth/, the default CallbackURL value.
    Note: Money Forward Expense requires an HTTPS redirect URI.

    If you are making a Web application, set the Redirect URI to a page on your Web app where you would like the user to return after authorizing your application.

  4. Set Scopes to office_setting:write user_setting:write transaction:write report:write account:write public_resource:read.
  5. Save your changes. The console displays the settings for the application you just created.

Note the client Id, client secret, and callback URL for future use.

Money Forward Expense Connector for CData Sync

Advanced Features

This section details a selection of advanced features of the Money Forward Expense Sync App.

User Defined Views

The Sync App allows you to define virtual tables, called user defined views, whose contents are decided by a pre-configured query. These views are useful when you cannot directly control queries being issued to the drivers. See User Defined Views for an overview of creating and configuring custom views.

SSL Configuration

Use SSL Configuration to adjust how Sync App handles TLS/SSL certificate negotiations. You can choose from various certificate formats; see the SSLServerCert property under "Connection String Options" for more information.

Firewall and Proxy

Configure the Sync App for compliance with Firewall and Proxy, including Windows proxies and HTTP proxies. You can also set up tunnel connections.

Query Processing

The Sync App offloads as much of the SELECT statement processing as possible to Money Forward Expense and then processes the rest of the query in memory (client-side).

See Query Processing for more information.

Logging

See Logging for an overview of configuration settings that can be used to refine CData logging. For basic logging, you only need to set two connection properties, but there are numerous features that support more refined logging, where you can select subsets of information to be logged using the LogModules connection property.

Money Forward Expense Connector for CData Sync

SSL Configuration

Customizing the SSL Configuration

By default, the Sync App attempts to negotiate SSL/TLS by checking the server's certificate against the system's trusted certificate store.

To specify another certificate, see the SSLServerCert property for the available formats to do so.

Money Forward Expense Connector for CData Sync

Firewall and Proxy

Connecting Through a Firewall or Proxy

HTTP Proxies

To connect through the Windows system proxy, you do not need to set any additional connection properties. To connect to other proxies, set ProxyAutoDetect to false.

In addition, to authenticate to an HTTP proxy, set ProxyAuthScheme, ProxyUser, and ProxyPassword, in addition to ProxyServer and ProxyPort.

Other Proxies

Set the following properties:

  • To use a proxy-based firewall, set FirewallType, FirewallServer, and FirewallPort.
  • To tunnel the connection, set FirewallType to TUNNEL.
  • To authenticate, specify FirewallUser and FirewallPassword.
  • To authenticate to a SOCKS proxy, additionally set FirewallType to SOCKS5.

Money Forward Expense Connector for CData Sync

Data Model

The CData Sync App models entities in the Money Forward Expense API as tables, views, and stored procedures. These are defined in schema files, which are text-based, extensible configuration files.

Tables and Views

The following sections provide information on executing SQL to the available API Tables and Views. The Sync App offloads as much of the SELECT statement processing as possible to Money Forward Expense and then processes the rest of the query in memory; API limitations and requirements are documented in this section.

Stored Procedures

Stored Procedures are function-like interfaces to the data source. They can be used to search, update, and modify information in the data source.

Money Forward Expense Connector for CData Sync

Tables

The Sync App models the data in Money Forward Expense as a list of tables in a relational database that can be queried using standard SQL statements.

Money Forward Expense Connector for CData Sync Tables

Name Description
Departments Create, update, delete, and query all the report units for an office.
MyTransactions Create, update, delete, and query your own transactions.
OfficeMembers Query and delete the report units for an office.
OfficeMemberSettings Create, update, and query the settings for an office.
OfficeMemberWorkflows Create, update, delete, and query the workflows for the members of the specified office.
Positions Create, update, delete, and query all the positions for an office.
Projects Create, update, delete, and query projects for an office.

Money Forward Expense Connector for CData Sync

Departments

Create, update, delete, and query all the report units for an office.

Table Specific Information

SELECT

To get a list of all the departments of an office, the OfficeId column or the OfficeId connection string parameter is required. If not specified, the OfficeId of the first office from the Offices table will be used.

The Sync App uses the Money Forward Expense APIs to process search criteria that refer to OfficeId and processes other filters client-side within the Sync App. For example, following query is processed server side:

SELECT * FROM Departments

Insert

To insert a department the following columns are required: OfficeId and Name.

INSERT INTO Departments (OfficeId, Name, Code, Memo) VALUES ('OfficeId123', 'OfficeName123', 'DepCode123', 'Memo123')

Update

To update a department the following columns are required: OfficeId and Id.

UPDATE Departments SET Name = 'NewDepName', Code = 'NewDepCode', Memo = 'NewDepMemo' WHERE OfficeId = '1234' AND Id = '12345'

Delete

To delete a department, the following columns are required: OfficeId and Id.

DELETE FROM Departments WHERE OfficeId = '12345' AND Id = '123456'

Columns

Name Type ReadOnly Description
Id [KEY] String True

The department Id.

OfficeId [KEY] String False

The office Id.

Name String False

The department name.

Code String False

The department code.

Memo String False

The RootId of the department.

ParentId String False

The ParentId of the department.

RootId String True

The RootId of the project.

Money Forward Expense Connector for CData Sync

MyTransactions

Create, update, delete, and query your own transactions.

Columns

Name Type ReadOnly Description
Id [KEY] String False

The position Id.

OfficeId [KEY] String False

The transaction Id.

Remark String False

The transaction contents.

Value Double False

The transaction value.

ItemId String False

The Expense item Id.

RecognizedAt Date False

The date of payment.

Number Integer True

The transaction number.

Memo String False

The transaction notes.

JpyRate Double False

The exchange rate.

Currency String False

The transaction currency.

UseCustomJypRate Boolean False

Indicates if the exchange rate is manually set.

AutomaticStatus String True

The transaction status.

ErrorMessage String True

The error message.

WarningMessage String True

The warning message.

WaitingMessage String True

The waiting message.

OfficeMemberId String True

The office member Id.

CreditItemId String False

The credit account item Id.

CreditSubItemId String False

The credit account subitem Id.

ExciseId String False

The tax division Id.

DepartmentId String False

The department Id.

ProjectId String False

The project Id.

CreatedAt Datetime True

The date when the transaction was craeted.

UpdatedAt Datetime True

The date when the transaction was last updated.

Money Forward Expense Connector for CData Sync

OfficeMembers

Query and delete the report units for an office.

Table Specific Information

SELECT

To get a list of all the members of an office, the OfficeId column or the OfficeId connection string parameter is required. If not specified, the OfficeId of the first office from the Offices table will be used. The Sync App uses the Money Forward Expense APIs to process search criteria that refer to OfficeId and processes other filters client-side within the Sync App. For example, following query is processed server side:

SELECT * FROM OfficeMembers

The column PermissionRoleID may take the value of 0 if the member has been created from the UI, and it hasn't been given any permissions.

Insert

To insert an OfficeMember, the following columns are required: OfficeId, Email and PermissionRoleID.
PermissionRoleID can take only these values: 201: general user, 202: recognizer, 203: manager.
-if PermissionRoleID = 201 IsExUser will be set to true
-if PermissionRoleID = 202 IsExUser, IsExAuthorizer will be set to true
-if PermissionRoleID = 203 IsExUser, IsExAuthorizer, IsExAdministrator will be set to true
Departments is a aggregate field, so the value for inserting and updating would be a json string containing an array of objects with its only attribute Department Id

INSERT INTO OfficeMembers (OfficeId, Email, PermissionRoleID) VALUES ('12345', '[email protected]', '201')

INSERT INTO OfficeMembers (OfficeId, Email, PermissionRoleID, PositionID, Departments) VALUES ('23457', '[email protected]', '202', '2457', '[{"id": "7457"},{"id": "24577"}]')

Update

To update an OfficeMember you will need the OfficeMember ID and OfficeID specified:

UPDATE OfficeMembers SET Name = 'hello world', Number = '1245', PermissionRoleID = 203 WHERE ID = '345' AND OfficeID = '123'

UPDATE OfficeMembers SET  Name = 'hey world', Number = '346', PermissionRoleID = 201, PositionID = '2457754', Departments = '[{\"id\": \"457\"},{\"id\": \"346\"}]' WHERE ID = '345' AND OfficeID = '346'

Delete

To delete an OfficeMember, the following columns are required: OfficeId, Id.

DELETE FROM OfficeMembers WHERE OfficeId = '12345' AND Id = '123456'

Columns

Name Type ReadOnly Description
Id [KEY] String False

The report unit Id.

OfficeId [KEY] String True

The report unit Id.

IdentificationCode String True

The office id.

Name String False

The report unit title.

Number Integer False

The report unit title.

CreatedAt Datetime True

The date when the report unit was created.

UpdatedAt Datetime True

The date when the report unit was last updated.

IsExUser Boolean True

The report unit number.

IsExAuthorizer Boolean True

The report unit number.

IsExAdministrator Boolean True

The report unit number.

PositionId String True

The report unit title.

PositionName String True

The report unit title.

PositionPriority Integer True

The report unit title.

PermissionRoleID String False

Permission role ID (Required on insert - 201: general user, 202: recognizer, 203: manager)

Departments String False

Aggregate field representing departments of an office member.

Money Forward Expense Connector for CData Sync

OfficeMemberSettings

Create, update, and query the settings for an office.

Table Specific Information

SELECT

To get the settings of an office member, the OfficeId and OfficeMemberId columns are required in the WHERE clause. If not specified, the settings of all the office members will be returned.

The Sync App uses the Money Forward Expense APIs to process search criteria that refer to OfficeId and OfficeMemberId. The Sync App processes other filters client-side within the Sync App. For example, the following query is processed server side:

SELECT * FROM OfficeMemberSettings WHERE OfficeId = '1234' AND OfficeMemberId = '12345'

INSERT

INSERTs are not supported for this table.

UPDATE

To update the settings of an office member, the following columns required: OfficeId and OfficeMemberId.

UPDATE OfficeMemberSettings SET UseAgent = false, ApprovingPriority = 1234, ProjectId = '1234', CreditItemId = '1234', CreditSubItemId = '1234', TransportationItemId = '1234', DrivingItemId = '1234' WHERE OfficeMemberId = '1234' AND OfficeId = '123456'

Delete

Deletes are not supported for this table.

Columns

Name Type ReadOnly Description
Id [KEY] String False

The setting Id.

OfficeId [KEY] String False

The office Id.

OfficeMemberId [KEY] String False

The office member Id.

UseAgent Boolean False

Indicates the use agent status.

ApprovingPriority Integer False

The approving priority.

ProjectId String False

The project Id.

ProjectName String True

The project name.

ProjectCode String True

The project code.

CreditItemId String False

The credit item Id.

CreditItemExciseId String True

The credit item excise Id.

CreditItemName String True

The credit item name.

CreditItemCode String True

The credit item code.

CreditSubItemId String False

The credit subitem Id.

CreditSubItemItemId String True

The credit subitem item Id.

CreditSubItemExciseId String True

The credit subitem excise Id.

CreditSubItemName String True

The credit subitem name.

CreditSubItemCode String True

The credit subitem code.

TransportationItemId String False

The transportation item Id.

TransportationItemName String True

The transportation item name.

DrivingItemId String False

The driving item Id.

DrivingItemName String True

The driving item name.

Money Forward Expense Connector for CData Sync

OfficeMemberWorkflows

Create, update, delete, and query the workflows for the members of the specified office.

Table Specific Information

SELECT

To get a list of the workflows of an office member, the OfficeId and OfficeMemberId columns are required. If not specified, the workflows of all the office members will be returned by the Money Forward Expense server.

The Sync App uses the Money Forward Expense APIs to process search criteria that refer to OfficeId and OfficeMemberId. Other filters the Sync App processes client-side within the Sync App. For example, the following query is processed server side:

SELECT * FROM OfficeMemberWorkflows WHERE OfficeId = '1234' AND OfficeMemberId = '12345'

INSERT

To insert a workflow for an office member, the following columns are required: OfficeId, OfficeMemberId, WorkFlowId, and ReportTypeId

INSERT INTO OfficeMemberWorkflows (OfficeId, OfficeMemberId, WorkFlowId, ReportTypeId) VALUES ('123', '12345', '123456', '1234567')

UPDATE

To update a workflow for an office member, the following columns are required: Id, OfficeId, OfficeMemberId, WorkFlowId, AND ReportTypeId.

UPDATE OfficeMemberWorkflows SET WorkFlowId = '123', ReportTypeId = '1234' WHERE OfficeId = '12345' AND OfficeMemberId = '123456' AND Id = '1234567'

DELETE

Deletes are not supported for this table.

Columns

Name Type ReadOnly Description
Id [KEY] String False

The workflow Id.

OfficeId [KEY] String False

The office Id.

OfficeMemberId [KEY] String False

The workflow name.

WorkflowId String False

The workflow priority.

ReportTypeId String False

The workflow priority.

ReportTypeName String True

The workflow priority.

ReportTypeUseTransactionReserves Boolean True

The workflow priority.

ReportTypeUseTransactionActionAfterApproval String True

The workflow priority.

ReportTypeIsActive Boolean True

The workflow priority.

Money Forward Expense Connector for CData Sync

Positions

Create, update, delete, and query all the positions for an office.

Table Specific Information

SELECT

To get a list of all the positions of an office, the OfficeId column or the OfficeId connection string parameter is required. If not specified, the OfficeId of the first office from the Offices table will be used.

The Sync App uses the Money Forward Expense APIs to process search criteria that refer to OfficeId and processes other filters client-side within the Sync App. For example, the following query is processed by the Money Forward Expense APIs:

SELECT * FROM Positions

Insert

To insert a position the following columns are required: OfficeId and Name.

INSERT INTO Positions (OfficeId, Name, IsAuthorizer, Priority) VALUES ('OfficeId1234', 'PositionName123', false, 150)

Update

To update a position the following columns are required: OfficeId and Id.

UPDATE Positions SET Name = 'UpdatedPositionName', IsAuthorizer = true, Priority = 170 WHERE OfficeId = '12345' AND Id = '123456'

Delete

To delete a position, the following columns are required: OfficeId and Id.

DELETE FROM Positions WHERE OfficeId = '12345' AND Id = '123456'

Columns

Name Type ReadOnly Description
Id [KEY] String False

The position Id.

OfficeId [KEY] String False

The office Id.

Name String False

The position name.

IsAuthorizer Boolean False

Indicates if the position is an authorizer.

Priority Integer False

The position's priority on the list.

Money Forward Expense Connector for CData Sync

Projects

Create, update, delete, and query projects for an office.

Table Specific Information

SELECT

To get a list of all the projects of an office, the OfficeId column or the OfficeId connection string parameter is required. If not specified, the OfficeId of the first office from the Offices table will be used. The Sync App uses the Money Forward Expense APIs to process search criteria that refer to OfficeId and processes other filters client-side within the Sync App. For example, the following query is processed server side:

SELECT * FROM Projects

Insert

To insert a project the following columns are required: OfficeId, Name, Code.

INSERT INTO Projects (OfficeId, Name, Code) VALUES ('OfficeId123', 'ProjectName123', 'ProjectCode123')

Update

To update a project the following columns are required: OfficeId, Id.

UPDATE Projects SET Name = 'NewProjectName', Code = 'NewProjectCode' WHERE OfficeId = '12345' AND Id = '123456'

Delete

To delete a project, the following columns are required: OfficeId, Id.

DELETE FROM Projects WHERE OfficeId = '12345' AND Id = '123456'

Columns

Name Type ReadOnly Description
Id [KEY] String False

The project Id.

OfficeId [KEY] String False

The office Id.

Name String False

The project name.

Code String False

The project code.

ParentId String True

The ParentId of the project.

RootId String True

The RootId of the project.

Money Forward Expense Connector for CData Sync

Views

Views are similar to tables in the way that data is represented; however, views are read-only.

Queries can be executed against a view as if it were a normal table.

Money Forward Expense Connector for CData Sync Views

Name Description
ApprovingReports Query the approving reports for an office.
Excises Lists the Excises for an office.
InvoiceReports null
Items Lists the items for an office.
MyApprovingReports Query your own approving reports.
MyInvoiceReports null
MyReports Query your own Reports.
Offices Lists all the offices you belong to.
Reports Lists the reports for an office.
ReportUnits Lists the report units for an office.
Transactions Query the transactions for an office.

Money Forward Expense Connector for CData Sync

ApprovingReports

Query the approving reports for an office.

Columns

Name Type Description
Id [KEY] String The report Id.
OfficeId String The office Id.
ReportTypeId String The report type Id.
OfficeMemberId String The office member Id.
Number Integer The report number.
Title String The report title.
Status String The report status.
SubmittedAt Datetime The date when the report was subbmited.
ApprovedAt Datetime The date when the report was approved.
CreatedAt Datetime The date when the report was created.
UpdatedAt Datetime The date when the report was last updated.

Money Forward Expense Connector for CData Sync

Excises

Lists the Excises for an office.

Columns

Name Type Description
Id [KEY] String The Excise Id.
OfficeId [KEY] String The office Id.
Rate String The Excise Rate.
Code String The Excise Code.
LongName String The Excise LongName.

Money Forward Expense Connector for CData Sync

InvoiceReports

null

Columns

Name Type Description
Id [KEY] String id
CreatedAt Datetime
OfficeId [KEY] String The office id
ApprovedAt Datetime
Number String
SubmittedAt Datetime
Status String
UpdatedAt Datetime
Title String
OfficeMemberId String
NumberWithoutPrefix String number_without_prefix
ReportApprovals String Report Approvals

Money Forward Expense Connector for CData Sync

Items

Lists the items for an office.

Columns

Name Type Description
Id [KEY] String The project Id.
OfficeId [KEY] String The office Id.
Name String The item name.
SubItemId String The sub item id.

Money Forward Expense Connector for CData Sync

MyApprovingReports

Query your own approving reports.

Columns

Name Type Description
Id [KEY] String The report Id.
OfficeId String The office Id.
ReportTypeId String The report type Id.
OfficeMemberId String The office member Id.
Number Integer The report number.
Title String The report title.
Status String The report status.
SubmittedAt Datetime The date when the report was subbmited.
ApprovedAt Datetime The date when the report was approved.
CreatedAt Datetime The date when the report was created.
UpdatedAt Datetime The date when the report was last updated.

Money Forward Expense Connector for CData Sync

MyInvoiceReports

null

Columns

Name Type Description
Id [KEY] String id
CreatedAt Datetime
OfficeId [KEY] String The office id
ApprovedAt Datetime
Number String
SubmittedAt Datetime
Status String
UpdatedAt Datetime
Title String
OfficeMemberId String OfficeMemberId
NumberWithoutPrefix String number_without_prefix
ReportApprovals String Report Approvals

Money Forward Expense Connector for CData Sync

MyReports

Query your own Reports.

Columns

Name Type Description
Id [KEY] String The report Id.
OfficeId String The office Id.
ReportTypeId String The report type Id.
OfficeMemberId String The office member Id.
Number Integer The report number.
Title String The report title.
Status String The report status.
SubmittedAt Datetime The date when the report was subbmited.
ApprovedAt Datetime The date when the report was approved.
CreatedAt Datetime The date when the report was created.
UpdatedAt Datetime The date when the report was last updated.

Money Forward Expense Connector for CData Sync

Offices

Lists all the offices you belong to.

Table Specific Information

SELECT

The Sync App processes all filters on this table client-side within the Sync App. For example, the following query is the only query processed by the Money Forward Expense APIs and returns a list of all the offices you belong to.

SELECT * FROM Offices

Columns

Name Type Description
Id [KEY] String The office Id.
IdentificationCode String The identification code for the office.
Name String The office name.
OfficeTypeId String The office type Id.

Money Forward Expense Connector for CData Sync

Reports

Lists the reports for an office.

Table Specific Information

SELECT

To get a list of all the reports of an office, the OfficeId column or the OfficeId connection string parameter is required. If not specified, the OfficeId of the first office from the Offices table will be used. The Sync App uses the Money Forward Expense APIs to process search criteria that refer to OfficeId and processes other filters client-side within the Sync App. For example, the following query is processed server side:


SELECT * FROM Reports

Columns

Name Type Description
Id [KEY] String The report Id.
OfficeId String The office Id.
ReportTypeId String The report type Id.
OfficeMemberId String The office member Id.
Number Integer The report number.
Title String The report title.
Status String The report status.
SubmittedAt Datetime The date when the report was subbmited.
ApprovedAt Datetime The date when the report was approved.
CreatedAt Datetime The date when the report was created.
UpdatedAt Datetime The date when the report was last updated.

Money Forward Expense Connector for CData Sync

ReportUnits

Lists the report units for an office.

Table Specific Information

SELECT

To get a list of all the report units of an office, the OfficeId column or the OfficeId connection string parameter is required. If not specified, the OfficeId of the first office from the Offices table will be used.

The Sync App uses the Money Forward Expense APIs to process search criteria that refer to OfficeId and processes other filters client-side within the Sync App. For example, the following query is processed server side:

SELECT * FROM ReportUnits

Columns

Name Type Description
Id [KEY] String The report unit Id.
OfficeId String The office id.
Title String The report unit title.
CreatedAt Datetime The date when the report unit was created.
UpdatedAt Datetime The date when the report unit was last updated.
Number String The report unit number.

Money Forward Expense Connector for CData Sync

Transactions

Query the transactions for an office.

Table Specific Information

SELECT

To get a list of all the transactions of an office, the OfficeId column or the OfficeId connection string parameter and a range of RecognizedAt column is required. If OfficeId is not specified, the OfficeId of the first office from the Offices table will be used.

The Sync App uses the Money Forward Expense APIs to process search criteria that refer to OfficeId and processes other filters client-side within the Sync App. For example, the following query is processed server side:

SELECT * FROM Transactions WHERE RecognizedAt <= '2020-04-30' AND RecognizedAt >= '2020-04-01' 

Insert

To insert a transaction the following columns are required: OfficeId, Remark, ItemId, Value, RecognizedAt.

INSERT INTO Transactions (OfficeId, Remark, ItemId, Value, RecognizedAt, Memo, JpyRate, Currency, UseCustomJpyRate, CreditItemId, CreditSubItemId, ExciseId, DepartmentId, ProjectId) VALUES ('OfficeId123', 'RemarkValue', 'ItemId1234', 100.11, '01-01-2017', 'MemoValue', 100.123, 'JPY', false, 'CreditItemId213', 'CreditSubItemId213', 'ExciseId123', 'DepartmentId123', 'ProjectId123')

Update

To update a transaction the following columns are required: OfficeId, Id. You can update the transactions that belong the authenticated user, but not those that belong to the other office members.

UPDATE Transactions SET Remark = 'NewRemark', ItemId = 'NewItemId', Value = 123.123, Memo = 'NewMemo', UseCustomJypRate = false, RecognizedAt = '01-02-2018', Currency = 'USD', ExciseId = 'NewExciseId', CreditItemId = 'NewCreditItemId', CreditSubItemId = 'NewCreditSubItemId', DepartmentId = 'NewDepartmentId', ProjectId = 'NewProjectId' WHERE OfficeId = '12345' AND Id = '123456'

Delete

To delete a transaction, the following columns are required: OfficeId, Id. You can delete the transactions that belong the authenticated user, but not those that belong to the other office members.

DELETE FROM Transactions WHERE OfficeId = '12345' AND Id = '123456'

Columns

Name Type Description
Id [KEY] String The position Id.
OfficeId [KEY] String The transaction Id.
Remark String The transaction contents.
Value Double The transaction value.
ItemId String The Expense item Id.
RecognizedAt Date The date of payment.
Number Integer The transaction number.
Memo String The transaction notes.
JpyRate Double The exchange rate.
Currency String The transaction currency.
UseCustomJypRate Boolean Indicates if the exchange rate is manually set.
AutomaticStatus String The transaction status.
ErrorMessage String The error message.
WarningMessage String The warning message.
WaitingMessage String The waiting message.
OfficeMemberId String The office member Id.
CreditItemId String The credit account item Id.
CreditSubItemId String The credit account subitem Id.
ExciseId String The tax division Id.
DepartmentId String The department Id.
ProjectId String The project Id.
CreatedAt Datetime The date when the transaction was craeted.
UpdatedAt Datetime The date when the transaction was last updated.

Money Forward Expense Connector for CData Sync

Connection String Options

The connection string properties are the various options that can be used to establish a connection. This section provides a complete list of the options you can configure in the connection string for this provider. Click the links for further details.

For more information on establishing a connection, see Establishing a Connection.

Authentication


PropertyDescription
OfficeIdId of the office. Required for most queries.

OAuth


PropertyDescription
OAuthClientIdThe client Id assigned when you register your application with an OAuth authorization server.
OAuthClientSecretThe client secret assigned when you register your application with an OAuth authorization server.

SSL


PropertyDescription
SSLServerCertThe certificate to be accepted from the server when connecting using TLS/SSL.

Firewall


PropertyDescription
FirewallTypeThe protocol used by a proxy-based firewall.
FirewallServerThe name or IP address of a proxy-based firewall.
FirewallPortThe TCP port for a proxy-based firewall.
FirewallUserThe user name to use to authenticate with a proxy-based firewall.
FirewallPasswordA password used to authenticate to a proxy-based firewall.

Proxy


PropertyDescription
ProxyAutoDetectThis indicates whether to use the system proxy settings or not.
ProxyServerThe hostname or IP address of a proxy to route HTTP traffic through.
ProxyPortThe TCP port the ProxyServer proxy is running on.
ProxyAuthSchemeThe authentication type to use to authenticate to the ProxyServer proxy.
ProxyUserA user name to be used to authenticate to the ProxyServer proxy.
ProxyPasswordA password to be used to authenticate to the ProxyServer proxy.
ProxySSLTypeThe SSL type to use when connecting to the ProxyServer proxy.
ProxyExceptionsA semicolon separated list of destination hostnames or IPs that are exempt from connecting through the ProxyServer .

Logging


PropertyDescription
LogModulesCore modules to be included in the log file.

Schema


PropertyDescription
LocationA path to the directory that contains the schema files defining tables, views, and stored procedures.
BrowsableSchemasThis property restricts the schemas reported to a subset of the available schemas. For example, BrowsableSchemas=SchemaA,SchemaB,SchemaC.
TablesThis property restricts the tables reported to a subset of the available tables. For example, Tables=TableA,TableB,TableC.
ViewsRestricts the views reported to a subset of the available tables. For example, Views=ViewA,ViewB,ViewC.

Miscellaneous


PropertyDescription
MaxRowsLimits the number of rows returned when no aggregation or GROUP BY is used in the query. This takes precedence over LIMIT clauses.
OtherThese hidden properties are used only in specific use cases.
PseudoColumnsThis property indicates whether or not to include pseudo columns as columns to the table.
TimeoutThe value in seconds until the timeout error is thrown, canceling the operation.
UserDefinedViewsA filepath pointing to the JSON configuration file containing your custom views.
Money Forward Expense Connector for CData Sync

Authentication

This section provides a complete list of the Authentication properties you can configure in the connection string for this provider.


PropertyDescription
OfficeIdId of the office. Required for most queries.
Money Forward Expense Connector for CData Sync

OfficeId

Id of the office. Required for most queries.

Remarks

Id of the office. Required for most queries. This value restricts query results to the specified office. If you do not have direct access to the SQL query, you can set this connection property instead.

If you do have access to the query, you can override the connection property value for a specific query by setting the OfficeId pseudo column.

Money Forward Expense Connector for CData Sync

OAuth

This section provides a complete list of the OAuth properties you can configure in the connection string for this provider.


PropertyDescription
OAuthClientIdThe client Id assigned when you register your application with an OAuth authorization server.
OAuthClientSecretThe client secret assigned when you register your application with an OAuth authorization server.
Money Forward Expense Connector for CData Sync

OAuthClientId

The client Id assigned when you register your application with an OAuth authorization server.

Remarks

As part of registering an OAuth application, you will receive the OAuthClientId value, sometimes also called a consumer key, and a client secret, the OAuthClientSecret.

Money Forward Expense Connector for CData Sync

OAuthClientSecret

The client secret assigned when you register your application with an OAuth authorization server.

Remarks

As part of registering an OAuth application, you will receive the OAuthClientId, also called a consumer key. You will also receive a client secret, also called a consumer secret. Set the client secret in the OAuthClientSecret property.

Money Forward Expense Connector for CData Sync

SSL

This section provides a complete list of the SSL properties you can configure in the connection string for this provider.


PropertyDescription
SSLServerCertThe certificate to be accepted from the server when connecting using TLS/SSL.
Money Forward Expense Connector for CData Sync

SSLServerCert

The certificate to be accepted from the server when connecting using TLS/SSL.

Remarks

If using a TLS/SSL connection, this property can be used to specify the TLS/SSL certificate to be accepted from the server. Any other certificate that is not trusted by the machine is rejected.

This property can take the following forms:

Description Example
A full PEM Certificate (example shortened for brevity) -----BEGIN CERTIFICATE----- MIIChTCCAe4CAQAwDQYJKoZIhv......Qw== -----END CERTIFICATE-----
A path to a local file containing the certificate C:\cert.cer
The public key (example shortened for brevity) -----BEGIN RSA PUBLIC KEY----- MIGfMA0GCSq......AQAB -----END RSA PUBLIC KEY-----
The MD5 Thumbprint (hex values can also be either space or colon separated) ecadbdda5a1529c58a1e9e09828d70e4
The SHA1 Thumbprint (hex values can also be either space or colon separated) 34a929226ae0819f2ec14b4a3d904f801cbb150d

If not specified, any certificate trusted by the machine is accepted.

Use '*' to signify to accept all certificates. Note that this is not recommended due to security concerns.

Money Forward Expense Connector for CData Sync

Firewall

This section provides a complete list of the Firewall properties you can configure in the connection string for this provider.


PropertyDescription
FirewallTypeThe protocol used by a proxy-based firewall.
FirewallServerThe name or IP address of a proxy-based firewall.
FirewallPortThe TCP port for a proxy-based firewall.
FirewallUserThe user name to use to authenticate with a proxy-based firewall.
FirewallPasswordA password used to authenticate to a proxy-based firewall.
Money Forward Expense Connector for CData Sync

FirewallType

The protocol used by a proxy-based firewall.

Remarks

This property specifies the protocol that the Sync App will use to tunnel traffic through the FirewallServer proxy. Note that by default, the Sync App connects to the system proxy; to disable this behavior and connect to one of the following proxy types, set ProxyAutoDetect to false.

Type Default Port Description
TUNNEL 80 When this is set, the Sync App opens a connection to Money Forward Expense and traffic flows back and forth through the proxy.
SOCKS4 1080 When this is set, the Sync App sends data through the SOCKS 4 proxy specified by FirewallServer and FirewallPort and passes the FirewallUser value to the proxy, which determines if the connection request should be granted.
SOCKS5 1080 When this is set, the Sync App sends data through the SOCKS 5 proxy specified by FirewallServer and FirewallPort. If your proxy requires authentication, set FirewallUser and FirewallPassword to credentials the proxy recognizes.

To connect to HTTP proxies, use ProxyServer and ProxyPort. To authenticate to HTTP proxies, use ProxyAuthScheme, ProxyUser, and ProxyPassword.

Money Forward Expense Connector for CData Sync

FirewallServer

The name or IP address of a proxy-based firewall.

Remarks

This property specifies the IP address, DNS name, or host name of a proxy allowing traversal of a firewall. The protocol is specified by FirewallType: Use FirewallServer with this property to connect through SOCKS or do tunneling. Use ProxyServer to connect to an HTTP proxy.

Note that the Sync App uses the system proxy by default. To use a different proxy, set ProxyAutoDetect to false.

Money Forward Expense Connector for CData Sync

FirewallPort

The TCP port for a proxy-based firewall.

Remarks

This specifies the TCP port for a proxy allowing traversal of a firewall. Use FirewallServer to specify the name or IP address. Specify the protocol with FirewallType.

Money Forward Expense Connector for CData Sync

FirewallUser

The user name to use to authenticate with a proxy-based firewall.

Remarks

The FirewallUser and FirewallPassword properties are used to authenticate against the proxy specified in FirewallServer and FirewallPort, following the authentication method specified in FirewallType.

Money Forward Expense Connector for CData Sync

FirewallPassword

A password used to authenticate to a proxy-based firewall.

Remarks

This property is passed to the proxy specified by FirewallServer and FirewallPort, following the authentication method specified by FirewallType.

Money Forward Expense Connector for CData Sync

Proxy

This section provides a complete list of the Proxy properties you can configure in the connection string for this provider.


PropertyDescription
ProxyAutoDetectThis indicates whether to use the system proxy settings or not.
ProxyServerThe hostname or IP address of a proxy to route HTTP traffic through.
ProxyPortThe TCP port the ProxyServer proxy is running on.
ProxyAuthSchemeThe authentication type to use to authenticate to the ProxyServer proxy.
ProxyUserA user name to be used to authenticate to the ProxyServer proxy.
ProxyPasswordA password to be used to authenticate to the ProxyServer proxy.
ProxySSLTypeThe SSL type to use when connecting to the ProxyServer proxy.
ProxyExceptionsA semicolon separated list of destination hostnames or IPs that are exempt from connecting through the ProxyServer .
Money Forward Expense Connector for CData Sync

ProxyAutoDetect

This indicates whether to use the system proxy settings or not.

Remarks

This takes precedence over other proxy settings, so you'll need to set ProxyAutoDetect to FALSE in order use custom proxy settings.

To connect to an HTTP proxy, see ProxyServer. For other proxies, such as SOCKS or tunneling, see FirewallType.

Money Forward Expense Connector for CData Sync

ProxyServer

The hostname or IP address of a proxy to route HTTP traffic through.

Remarks

The hostname or IP address of a proxy to route HTTP traffic through. The Sync App can use the HTTP, Windows (NTLM), or Kerberos authentication types to authenticate to an HTTP proxy.

If you need to connect through a SOCKS proxy or tunnel the connection, see FirewallType.

By default, the Sync App uses the system proxy. If you need to use another proxy, set ProxyAutoDetect to false.

Money Forward Expense Connector for CData Sync

ProxyPort

The TCP port the ProxyServer proxy is running on.

Remarks

The port the HTTP proxy is running on that you want to redirect HTTP traffic through. Specify the HTTP proxy in ProxyServer. For other proxy types, see FirewallType.

Money Forward Expense Connector for CData Sync

ProxyAuthScheme

The authentication type to use to authenticate to the ProxyServer proxy.

Remarks

This value specifies the authentication type to use to authenticate to the HTTP proxy specified by ProxyServer and ProxyPort.

Note that the Sync App will use the system proxy settings by default, without further configuration needed; if you want to connect to another proxy, you will need to set ProxyAutoDetect to false, in addition to ProxyServer and ProxyPort. To authenticate, set ProxyAuthScheme and set ProxyUser and ProxyPassword, if needed.

The authentication type can be one of the following:

  • BASIC: The Sync App performs HTTP BASIC authentication.
  • DIGEST: The Sync App performs HTTP DIGEST authentication.
  • NEGOTIATE: The Sync App retrieves an NTLM or Kerberos token based on the applicable protocol for authentication.
  • PROPRIETARY: The Sync App does not generate an NTLM or Kerberos token. You must supply this token in the Authorization header of the HTTP request.

If you need to use another authentication type, such as SOCKS 5 authentication, see FirewallType.

Money Forward Expense Connector for CData Sync

ProxyUser

A user name to be used to authenticate to the ProxyServer proxy.

Remarks

The ProxyUser and ProxyPassword options are used to connect and authenticate against the HTTP proxy specified in ProxyServer.

You can select one of the available authentication types in ProxyAuthScheme. If you are using HTTP authentication, set this to the user name of a user recognized by the HTTP proxy. If you are using Windows or Kerberos authentication, set this property to a user name in one of the following formats:

user@domain
domain\user

Money Forward Expense Connector for CData Sync

ProxyPassword

A password to be used to authenticate to the ProxyServer proxy.

Remarks

This property is used to authenticate to an HTTP proxy server that supports NTLM (Windows), Kerberos, or HTTP authentication. To specify the HTTP proxy, you can set ProxyServer and ProxyPort. To specify the authentication type, set ProxyAuthScheme.

If you are using HTTP authentication, additionally set ProxyUser and ProxyPassword to HTTP proxy.

If you are using NTLM authentication, set ProxyUser and ProxyPassword to your Windows password. You may also need these to complete Kerberos authentication.

For SOCKS 5 authentication or tunneling, see FirewallType.

By default, the Sync App uses the system proxy. If you want to connect to another proxy, set ProxyAutoDetect to false.

Money Forward Expense Connector for CData Sync

ProxySSLType

The SSL type to use when connecting to the ProxyServer proxy.

Remarks

This property determines when to use SSL for the connection to an HTTP proxy specified by ProxyServer. This value can be AUTO, ALWAYS, NEVER, or TUNNEL. The applicable values are the following:

AUTODefault setting. If the URL is an HTTPS URL, the Sync App will use the TUNNEL option. If the URL is an HTTP URL, the component will use the NEVER option.
ALWAYSThe connection is always SSL enabled.
NEVERThe connection is not SSL enabled.
TUNNELThe connection is through a tunneling proxy. The proxy server opens a connection to the remote host and traffic flows back and forth through the proxy.

Money Forward Expense Connector for CData Sync

ProxyExceptions

A semicolon separated list of destination hostnames or IPs that are exempt from connecting through the ProxyServer .

Remarks

The ProxyServer is used for all addresses, except for addresses defined in this property. Use semicolons to separate entries.

Note that the Sync App uses the system proxy settings by default, without further configuration needed; if you want to explicitly configure proxy exceptions for this connection, you need to set ProxyAutoDetect = false, and configure ProxyServer and ProxyPort. To authenticate, set ProxyAuthScheme and set ProxyUser and ProxyPassword, if needed.

Money Forward Expense Connector for CData Sync

Logging

This section provides a complete list of the Logging properties you can configure in the connection string for this provider.


PropertyDescription
LogModulesCore modules to be included in the log file.
Money Forward Expense Connector for CData Sync

LogModules

Core modules to be included in the log file.

Remarks

Only the modules specified (separated by ';') will be included in the log file. By default all modules are included.

See the Logging page for an overview.

Money Forward Expense Connector for CData Sync

Schema

This section provides a complete list of the Schema properties you can configure in the connection string for this provider.


PropertyDescription
LocationA path to the directory that contains the schema files defining tables, views, and stored procedures.
BrowsableSchemasThis property restricts the schemas reported to a subset of the available schemas. For example, BrowsableSchemas=SchemaA,SchemaB,SchemaC.
TablesThis property restricts the tables reported to a subset of the available tables. For example, Tables=TableA,TableB,TableC.
ViewsRestricts the views reported to a subset of the available tables. For example, Views=ViewA,ViewB,ViewC.
Money Forward Expense Connector for CData Sync

Location

A path to the directory that contains the schema files defining tables, views, and stored procedures.

Remarks

The path to a directory which contains the schema files for the Sync App (.rsd files for tables and views, .rsb files for stored procedures). The folder location can be a relative path from the location of the executable. The Location property is only needed if you want to customize definitions (for example, change a column name, ignore a column, and so on) or extend the data model with new tables, views, or stored procedures.

If left unspecified, the default location is "%APPDATA%\\CData\\MFExpense Data Provider\\Schema" with %APPDATA% being set to the user's configuration directory:

Platform %APPDATA%
Windows The value of the APPDATA environment variable
Linux ~/.config

Money Forward Expense Connector for CData Sync

BrowsableSchemas

This property restricts the schemas reported to a subset of the available schemas. For example, BrowsableSchemas=SchemaA,SchemaB,SchemaC.

Remarks

Listing the schemas from databases can be expensive. Providing a list of schemas in the connection string improves the performance.

Money Forward Expense Connector for CData Sync

Tables

This property restricts the tables reported to a subset of the available tables. For example, Tables=TableA,TableB,TableC.

Remarks

Listing the tables from some databases can be expensive. Providing a list of tables in the connection string improves the performance of the Sync App.

This property can also be used as an alternative to automatically listing views if you already know which ones you want to work with and there would otherwise be too many to work with.

Specify the tables you want in a comma-separated list. Each table should be a valid SQL identifier with any special characters escaped using square brackets, double-quotes or backticks. For example, Tables=TableA,[TableB/WithSlash],WithCatalog.WithSchema.`TableC With Space`.

Note that when connecting to a data source with multiple schemas or catalogs, you will need to provide the fully qualified name of the table in this property, as in the last example here, to avoid ambiguity between tables that exist in multiple catalogs or schemas.

Money Forward Expense Connector for CData Sync

Views

Restricts the views reported to a subset of the available tables. For example, Views=ViewA,ViewB,ViewC.

Remarks

Listing the views from some databases can be expensive. Providing a list of views in the connection string improves the performance of the Sync App.

This property can also be used as an alternative to automatically listing views if you already know which ones you want to work with and there would otherwise be too many to work with.

Specify the views you want in a comma-separated list. Each view should be a valid SQL identifier with any special characters escaped using square brackets, double-quotes or backticks. For example, Views=ViewA,[ViewB/WithSlash],WithCatalog.WithSchema.`ViewC With Space`.

Note that when connecting to a data source with multiple schemas or catalogs, you will need to provide the fully qualified name of the table in this property, as in the last example here, to avoid ambiguity between tables that exist in multiple catalogs or schemas.

Money Forward Expense Connector for CData Sync

Miscellaneous

This section provides a complete list of the Miscellaneous properties you can configure in the connection string for this provider.


PropertyDescription
MaxRowsLimits the number of rows returned when no aggregation or GROUP BY is used in the query. This takes precedence over LIMIT clauses.
OtherThese hidden properties are used only in specific use cases.
PseudoColumnsThis property indicates whether or not to include pseudo columns as columns to the table.
TimeoutThe value in seconds until the timeout error is thrown, canceling the operation.
UserDefinedViewsA filepath pointing to the JSON configuration file containing your custom views.
Money Forward Expense Connector for CData Sync

MaxRows

Limits the number of rows returned when no aggregation or GROUP BY is used in the query. This takes precedence over LIMIT clauses.

Remarks

Limits the number of rows returned when no aggregation or GROUP BY is used in the query. This takes precedence over LIMIT clauses.

Money Forward Expense Connector for CData Sync

Other

These hidden properties are used only in specific use cases.

Remarks

The properties listed below are available for specific use cases. Normal driver use cases and functionality should not require these properties.

Specify multiple properties in a semicolon-separated list.

Integration and Formatting

DefaultColumnSizeSets the default length of string fields when the data source does not provide column length in the metadata. The default value is 2000.
ConvertDateTimeToGMTDetermines whether to convert date-time values to GMT, instead of the local time of the machine.
RecordToFile=filenameRecords the underlying socket data transfer to the specified file.

Money Forward Expense Connector for CData Sync

PseudoColumns

This property indicates whether or not to include pseudo columns as columns to the table.

Remarks

This setting is particularly helpful in Entity Framework, which does not allow you to set a value for a pseudo column unless it is a table column. The value of this connection setting is of the format "Table1=Column1, Table1=Column2, Table2=Column3". You can use the "*" character to include all tables and all columns; for example, "*=*".

Money Forward Expense Connector for CData Sync

Timeout

The value in seconds until the timeout error is thrown, canceling the operation.

Remarks

If Timeout = 0, operations do not time out. The operations run until they complete successfully or until they encounter an error condition.

If Timeout expires and the operation is not yet complete, the Sync App throws an exception.

Money Forward Expense Connector for CData Sync

UserDefinedViews

A filepath pointing to the JSON configuration file containing your custom views.

Remarks

User Defined Views are defined in a JSON-formatted configuration file called UserDefinedViews.json. The Sync App automatically detects the views specified in this file.

You can also have multiple view definitions and control them using the UserDefinedViews connection property. When you use this property, only the specified views are seen by the Sync App.

This User Defined View configuration file is formatted as follows:

  • Each root element defines the name of a view.
  • Each root element contains a child element, called query, which contains the custom SQL query for the view.

For example:

{
	"MyView": {
		"query": "SELECT * FROM Offices WHERE MyColumn = 'value'"
	},
	"MyView2": {
		"query": "SELECT * FROM MyTable WHERE Id IN (1,2,3)"
	}
}
Use the UserDefinedViews connection property to specify the location of your JSON configuration file. For example:
"UserDefinedViews", C:\Users\yourusername\Desktop\tmp\UserDefinedViews.json
Note that the specified path is not embedded in quotation marks.

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 23.0.8839