Hi there!

In consultation with a customer I verified that API connectivity with the accounting system freee could be realized.
I will summarize the method to set up that connection below.

* If you use this method, achieving automated output from an expense settlement approval flow to the input of the accounting system will be possible.

 

Table of Contents
1: The Reason I Want to Link freee and Questetra
2: Settings for Linking freee and Questetra
2.1: OAuth Settings in freee
2.2: OAuth Settings in Questetra
2.3: Settings to Call freee API from Questetra
3: Summary

 

1: The Reason I Want to Link freee and Questetra

Customers who have consulted with me are managing their expenses with Questetra, and for expenses, a credit card is commonly used. A record is created by importing the credit card information into freee. Based on the information entered in Questetra, it was manually entered in the application column of freee’s expense records.
During the consultation, I was asked to automate this process to reduce time and effort, and so I performed a verification check.

 

2: Settings for Linking freee and Questetra

If you look at the reference for freee Developers (written in Japanese) you can see that there is a REST API and that OAuth2 can be used for authentication.

Please refer to the following articles for details of OAuth2 settings. Here, I will focus on the specific contents regarding the connection with freee.
* Related article: Settings when calling REST API of Another Service from Questetra (Questetra to be OAuth2 client)

* I thought that I could register for the freee developer account from the following page, but this page was still under construction.
freee Developers Start Guide (written in Japanese)
When I made an inquiry for the company, they said that if you can use Accounting freee’s office (free plan) then you can use the API.
However, you should note that registered content can only be validated for one month from the start date.

 

2.1: OAuth Settings in freee

You can register a new application in freee according to the “Introduction” section of freee’s reference.

  • “Application name”, “Usage purpose”: Enter to identify yourself
  • “Callback URI”: Check and enter on the OAuth setting screen in Questetra as described in the reference article

When you save you can get the “App ID” and “Secret”, so make a note of them.

 

2.2: OAuth Setting in Questetra

You can receive a token based on the information described in the “Specifications” section of freee’s reference.

 

2.3: Settings to Call freee API from Questetra

The API verified this time is as follows.

  • Obtain the GET list of Companies
  • Obtain the Deals’s GET list / POST creation / PUT update

It was easy to call with “Throwing Message Intermediate Event (HTTP)”.
* Related manual page: M225: Auto Sending of HTTP Requests with Business Data Inserted

Getting a GET list of Companies is simple because you only need to specify the call URL.
To get the GET list of Deals, you can simply add the required parameter company_id to the call URL. As for company_id, it’s OK to specify the ID acquired in the GET list of Companies.

Regarding the Deals’s POST creation / PUT update, I found there were other necessary items besides the required items on the reference (because it would cause an error if you sent JSON for only the required items). First, you make the transaction data manually on Accounting freee and check what type of JSON data is returned by getting the Deal GET list. I prepared the data based on that and it worked fine. However, you should note that the JSON data obtained from the GET list cannot be used as it is (the required JSON data format is slightly different).
In addition, for POST creation / PUT update, since the attached JSON data must be prepared, a “Service Task (Data Assignment)” or “Script Task” is required.
* Related manual page: M227: Auto Executing Data Binding, Arithmetic Operations
* Related manual page: M230: Auto Executing Complicated Data Processing (ECMAScript)

Also, as for the target record of Deal, I considered the occurrence date, amount and account as the extraction conditions, but since the amount and account could not be specified in the conditions, I acquired a list based on the occurrence date and needed to find the appropriate one in the list.

 

3: Summary

Deals have a complicated data structure, so it is necessary to consider how to prepare them. But if it is clear what data you want to process, it is relatively easy to automatically enter/update the accounting system.
If you have any questions, please feel free to contact us via the Inquiry .

%d bloggers like this: