File Creator Extensions

Documentación •
En este artículo

The File Create extensions transforms allow to create Banana file, by importing a data formats (like audit files, bank statements or invoices files) . 

For example of File Creator Extensions, see the Menu Tools > Create file from external data.

Extension Package

The Create extension must be published as sbaa package and contains at least the following two files:

  • manifest.json
    The description of the package
  • createlocate.json
    This file specify to which file the conversion apply, and the resource used for converting and creating a file.
  • createinit.js
    A javascript file that analyse the data and return a Json text, that specify what script is used to convert the data and what document Banana Accounting will create.

Example on


The text file createlocate.json associates a specific file format  to an extension. When opening a text file, whose format is defined in createlocate.json, Banana Accounting will create a new accounting file and import the content of the text file.
In the following example, opening an XML file with namespace 'http:://', Banana Accounting will look for the extension to be executed defined in the createlocate.json file. 

	"description": "Importazione e-fatture ordinarie v1.2 (xml)",
	"docUri": "",
	"fileExtension": "xml",
	"mimeType": "text/xml",
	"script": {
		"function": "exec",
		"uri": ""
	"xml": {
		"namespace": "",
		"rootItem": "FatturaElettronica"
	"type": "text/json",
	"version": "1.0"

Example of XML Data

This example will be imported according to the instructions  contained in the createlocate.js file 

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type='text/xsl' href='fatturaPA_v1.2.1.xsl'?>
<p:FatturaElettronica versione="FPR12" xmlns:p="" xmlns:xsi="">


This is a script file with the attribute @task create.init.
The script returns a json object which defines the type of accounting file to create and the extension to execute for importing data.
The argument of the exec function (inData) is the data to be imported.

// @id = createinit
// @api = 1.0
// @pubdate = 2021-07-28
// @publisher = SA
// @description = Create Init for importing Italy's XML Invoices
// @task = create.init
// @doctype = *

function exec(inData) {

var jsonData = {
	"fileType": {
		"accountingType" : {
			"docGroup" : "100",
			"docApp" : "110",
			"decimals" : "2"
		"template" : "",
	"scriptImport": {
		"function": "exec",
		"uri": ""
	"scriptSetup": {
		"function": "setup",
		"uri": ""
return jsonData;
  • fileType: the ac2 file which will contain the imported data
    • accountingType: if template is empty, a new empty accounting file will be created. You can decide which type to create:

      docGroup 100 double entry accounting
      docGroup 110 simple accounting (income - expenses accounting)
      docGroup 130 cash book accounting

      docApp 100 without VAT
      docApp 110 with V AT
      docApp 120 multicurrency without VAT
      docApp 130 multicurrency with VAT
    • template: url of an ac2 file. You can download ac2 files from our website (resources). If template is empty a new empty file will be created.
  • scriptImport:
    function is the method which will be called when importing data. uri is the name of the file which contains the javascript with this method.
  • scriptSetup:
    function is the method which will be called when setting up the script. uri is the name of the file which contains the javascript with this method.


Tell us how we can help you better
If the information on this page is not what you're looking for, is not clear enough, or is not up-to-date, let us know.

Share this article: Twitter | Facebook | LinkedIn | Email