6. Accounts

6. Accounts

Introduction:

The accounts is the heart of an accounting software system like Xero. Every creation of invoices we need account code for creating. So we are getting the account codes from xero.

We can set a default account code in the configuration layout by clicking the button “Chart of Accounting”.

Script:

For Accounts we have a scripts for accessing the information from the xero.

  • Pull Accounts from xero:

We are using this script to accessing the accounts information from the xero. We are sending the request API URL using the MBS curl functions with parameters like API key, Method as items. Then we got a response which consists of all accounts information from the Xero in a json formate. By using that information we are creating the records in FM.

Example JSON :

Parameters JSON:
{
“api_key”: “fde07d0f60458ce429aae638bbcb4b496d444115”,
“method”: “accounts”
}
Response JSON:
{
“Accounts”: [{
“AccountID”: “297c2dc5-cc47-4afd-8ec8-74990b8761e9”,
“Code”: “300”,
“Name”: “Purchases”,
“Type”: “DIRECTCOSTS”,
“TaxType”: “INPUT2”,
“Description”: “Goods purchased with the intention of selling these to customers”,
“EnablePaymentsToAccount”: false,
}]
}
  • Create_Accounts_from_xero:

We are using this script to create or update the records in FileMaker by using Base Elements functions and FileMaker functions.