Impac!™ Finance Bolt

Impac!™ is a reporting engine provided by Maestrano. The Finance Bolt is a calculation unit that computes and returns reports based on accounting data.

The Bolt has its own data-model which is fed by Webhook notifications received from Connec!™.

Each report can be rendered to one or several layouts (chart, table, figure…). A layout will always have the same structure regardless of the requested report.

Querying the bolt

It is highly recommended to use Impac! as a proxy instead of querying the bolt directly. The Bolt API should be restricted to internal communication between components only, as is not designed for external use.

# Valid flow
1. Front-end queries Impac! API, specifying the bolt provider and name:
      https://api-impac.maestrano.com/api/v2/maestrano/finance/widgets

2. Impac! API dispatches the request to the relevant bolt

3. Bolt returns its response to Impac! API

4. Impac! API forwards the response to the front-end application

---

# Wrong flow
1. Front-end queries the Bolt directly:
      https://api-impac-finance-bolt.maestrano.com/api/v1/widgets

2. Bolt returns its reponse to the front-end application

Indeed, Impac! is in charge of authenticating all requests to bolts (using MnoHub API). Once authorized by Impac!, the request will be dispatched to the bolt using a private set of keys only shared between the two components.

Attempting to query the Bolt directly without using these credentials will return a 401 Unauthorized error.

Only the Discovery endpoints Widgets and KPIs, that return the list of available reports, can be requested without authentication.

Using Impac! API as a proxy (Recommended)

To query the Bolt using Impac! as a proxy, please refer to Impac! API Authentication rules.

Internal Bolt API (using Basic Auth)

If, however, you are aware of the private keys shared between Impac! API and the Bolt, and you wish to query the Bolt API directly, all calls must prefixed by the /api keyword, followed by the version number. Eg:

https://api-impac-finance-bolt.maestrano.com/api/v1/widgets

Impac! private keys must be passed using Basic Auth:

+ username: IMPAC_KEY
+ password: IMPAC_SECRET

These private keys can only be retrieved once: when the Bolt is registered on Impac! - See Impac! API Reference for more information:

POST http://api-impac.maestrano.com/api/v2/bolts

Glossary

What’s a widget?

A widget is the result of a calculation based on the data of one or several companies (Profit and Loss, Balance Sheet, etc.).

It will return this information in a format adapted to reporting, using layouts.

What’s a layout?

A layout is a unique data structure that defines how a widget will return the result of its calculation.

It is designed to be directly usable by a reporting front-end or a charting library with minimum transformation.

When discovering available widgets, if a preferred_layout property is returned, this is the layout recommended by the engine to best render the widget.

What’s a KPI?

As a widget, a KPI uses the Bolt’s data model to calculate a given figure (Debtor days, Year to date revenue…).

In addition, a KPI will compare the calculated result with “targets” defined by the user. When a target is reached, the user will be alerted.

What’s a notification?

The notification api is used to interact with the Bolt’s data-model: Impac! uses this endpoint to create or update the Bolt’s data (Invoices, Accounts…).

Layouts

Figure

GET https://api-impac.maestrano.com/api/v2/maestrano/finance/widgets/:endpoint
Requestsexample 1
Headers
Authorization: Basic ZmFkNTRzNmY2YTRzZGY2YWRzZzQ2YWRmNTQ4Z2RmZzpnNTRkZnNn=
Body
{
  "layouts": [
    "figure"
  ],
  "metadata": {
    "currency": "GBP",
    "employee_id": "6486c7a0-4e03-0135-28a0-0b53861a3422"
  }
}
Responses200
Headers
Content-Type: application/json
Body
{
  "{{endpoint}}": {
    "figure": {
      "metrics": [
        {
          "value": "26",
          "label": "Vacation leaves balance"
        },
        {
          "value": "50000",
          "unit": "GBP",
          "label": "Yearly Salary"
        }
      ]
    }
  },
  "params": {
    "layouts": [
      "figure"
    ],
    "metadata": {
      "currency": "GBP",
      "employee_id": "6486c7a0-4e03-0135-28a0-0b53861a3422"
    }
  }
}

Figure
GET/widgets/:endpoint

Returns a Figure Layout, which is a list of computed metrics (ordered by importance if applicable).


Highstocks

GET https://api-impac.maestrano.com/api/v2/maestrano/finance/widgets/:endpoint
Requestsexample 1
Headers
Authorization: Basic ZmFkNTRzNmY2YTRzZGY2YWRzZzQ2YWRmNTQ4Z2RmZzpnNTRkZnNn=
Body
{
  "layouts": [
    "highstocks"
  ],
  "metadata": {
    "currency": "GBP",
    "chart_type": "line"
  }
}
Responses200
Headers
Content-Type: application/json
Body
{
  "{{endpoint}}": {
    "highstocks": {
      "chart": {
        "type": "line",
        "zoomType": "x",
        "spacingTop": 20
      },
      "series": [
        {
          "data": [
            [
              1494028800000,
              100
            ],
            [
              1494028800000,
              200
            ]
          ]
        }
      ],
      "xAxis": {},
      "yAxis": {
        "title": null,
        "startOnTick": true,
        "minPadding": 0
      },
      "plotOptions": {},
      "legend": {
        "enabled": true,
        "layout": "vertical",
        "align": "left",
        "verticalAlign": "middle"
      },
      "tooltip": {
        "shared": false
      },
      "credits": {
        "enabled": false
      }
    }
  },
  "params": {
    "layouts": [
      "highstocks"
    ],
    "metadata": {
      "currency": "GBP",
      "chart_type": "line"
    }
  }
}

Highstocks
GET/widgets/:endpoint

Returns a Highstocks Layout, which is a Highstocks object with computed data series.


Highcharts

GET https://api-impac.maestrano.com/api/v2/maestrano/finance/widgets/:endpoint
Requestsexample 1
Headers
Authorization: Basic ZmFkNTRzNmY2YTRzZGY2YWRzZzQ2YWRmNTQ4Z2RmZzpnNTRkZnNn=
Body
{
  "layouts": [
    "highcharts"
  ],
  "metadata": {
    "currency": "GBP",
    "chart_type": "pie"
  }
}
Responses200
Headers
Content-Type: application/json
Body
{
    "{{endpoint}}": {
      "highcharts": {
        "chart": {
            "type": "pie",
            "zoomType": "x",
            "spacingTop": 20
          },
          "series": [
            {
              "name": "Assets",
              "color": '#000',
              "data": [
                { "name": "Office Equipment", "y": 100.00 },
                { "name": "Business Bank Account", "y": 550.00 }
              ]
            }
          ],
          "xAxis": {},
          "yAxis": {
            "title": null,
            "startOnTick": true,
            "minPadding": 0
          },
          "plotOptions": {},
          "legend": {
            "enabled": true,
            "layout": "vertical",
            "align": "left",
            "verticalAlign": "middle"
          },
          "tooltip": {
            "shared": false
          },
          "credits": {
            "enabled": false
          }
        }
    },
    "params": {
      "layouts": ["highcharts"],
      "metadata": {
        "currency": "GBP",
        "chart_type": "pie"
      }
    }
  }

Highcharts
GET/widgets/:endpoint

Returns a Highcharts Layout, which is a Highcharts object with computed data series.


Table

GET https://api-impac.maestrano.com/api/v2/maestrano/finance/widgets/:endpoint
Requestsexample 1
Headers
Authorization: Basic ZmFkNTRzNmY2YTRzZGY2YWRzZzQ2YWRmNTQ4Z2RmZzpnNTRkZnNn=
Body
{
  "layouts": [
    "table"
  ],
  "metadata": {
    "currency": "GBP"
  }
}
Responses200
Headers
Content-Type: application/json
Body
{
    "{{endpoint}}": {
      "table": {
        "headers": { id: "company_total", cells: ["Company", "Total"] },
        "rows": {
          "grouped": [
            {
              "headers": { id: "comp-xyabc", cells: ["Comp XY-A-B-C", 5500.0] },
              "rows": {
                "grouped": [
                  {
                    "headers": { id: "comp-xy", cells: ["Comp XY", -4500.0] },
                    "rows": {
                      "single": [
                        { id: "comp-x", cells: ["Comp X", -2500.0] },
                        { id: "comp-y", cells: ["Comp Y", -2000.0] },
                      ]
                    }
                  }
                ],
                "single": [
                  { id: "comp-a", cells: ["Comp A", 7000.0] },
                  { id: "comp-b", cells: ["Comp B", 2000.0] },
                  { id: "comp-c", cells: ["Comp C", 1000.0] }
                ]
              }
            }
          ],
          "single": [
            { id: "comp-123", cells: ["Comp 123", 123.0] },
            { id: "comp-456", cells: ["Comp 456", 456.0] }
          ]
        }
      }
    },
    "params": {
      "layouts": ["table"],
      "metadata": {
        "currency": "GBP"
      }
    }
  }

Table
GET/widgets/:endpoint

Returns a Table Layout, which can form “single” rows and “grouped” Tables. Rows and Headers are required to contain an id and a cells property.

Grouped Tables are nested Tables, ideal for recursively rendering drill-down lists (columns + collapsible rows).


Settings

Selectors

GET https://api-impac.maestrano.com/api/v2/maestrano/finance/widgets/:endpoint
Requestsexample 1
Headers
Authorization: Basic ZmFkNTRzNmY2YTRzZGY2YWRzZzQ2YWRmNTQ4Z2RmZzpnNTRkZnNn=
Body
{
  "layouts": [
    "figure"
  ],
  "settings": [
    "selectors"
  ],
  "metadata": {
    "currency": "GBP"
  }
}
Responses200
Headers
Content-Type: application/json
Body
{
    "{{endpoint}}": {
      "figure": {}
    },
    "settings": {
      "selectors": [
        {
          "name": "account",
          "options": [
            {
              "label": "Credit Card - (100.0 GBP)",
              "value": "6ad0859a-9a3d-4cb1-a94f-b866c19f214f",
              "some_data": "data"
            },
          ]
        },
        {
          "name": "colors",
          "options": [
            {
              "label": "Red",
              "value": "red"
            }
          ]
        }
      ]
    },
    "params": {
      "layouts": ["figure"],
      "settings": ["selectors"],
      "metadata": {
        "currency": "GBP"
      }
    }
  }

Selectors
GET/widgets/:endpoint

Returns a Selectors Setting, which is a list of options grouped by a name. Options are required to contain both a label & value property. The value property is considered as the selection identifier. Additional properties may be included as metadata, but this depends on the widget (see individual widget documentation to view for special metadata returned).


Widgets

Index

GET https://api-impac.maestrano.com/api/v2/maestrano/finance/widgets
Responses200
Headers
Content-Type: application/json
Body
{
  "widgets": [
    {
      "endpoint": "cash_balance",
      "name": "Cash Balance",
      "width": 12,
      "layouts": [
        "highcharts",
        "table"
      ]
    },
    {
      "endpoint": "cash_projection",
      "name": "Cash Projection",
      "width": 12,
      "layouts": [
        "highcharts"
      ]
    }
  ]
}

Index
GET/widgets

Returns the list of all available widgets with their supported layouts.


Account Balance

GET https://api-impac.maestrano.com/api/v2/maestrano/finance/widgets/account_balance
Requestsexample 1
Headers
Authorization: Basic ZmFkNTRzNmY2YTRzZGY2YWRzZzQ2YWRmNTQ4Z2RmZzpnNTRkZnNn=
Responses200
Headers
Content-Type: application/json
Body
{
    "account_balance": {
      "figure": {
        "metrics": [
          {
            "value": 5000.85,
            "label": "Business Bank Account",
            "unit": "AUD",
            "id": "ce60e9e0-6f07-0135-3368-245e60d776b1"
          }
        ]
      },
      "highstocks": {
        "chart": {
          "type": "line",
        },
        "series": [
          {
            "type": "area",
            "name": "Business Bank Account",
            "data": [
              [1498780800000, 1000.0],
              [1501459200000, 4000.85],
              [1501545600000, 4000.85]
            ]
          }
        ]
      }
    },
    "settings": {
      "selectors": [
        {
          "name": "accounts",
          "options": [
            {
              "label": "Business Bank Account (5000.85 AUD)",
              "value": "ce60e9e0-6f07-0135-3368-245e60d776b1",
              "group_name": "ASSET"
            },
            {
              "label": "Business Savings Account (14500.0 AUD)",
              "value": "ce689550-6f07-0135-336c-245e60d776b1",
              "group_name": "ASSET"
            },
            {
              "label": "Sales (500.0 AUD)",
              "value": "ce6f85e0-6f07-0135-3370-245e60d776b1",
              "group_name": "REVENUE"
            }
          ]
        }
      ]
    },
    "params": {
      "provider": "maestrano",
      "name": "finance",
      "endpoint": "account_balance",
      "layouts": ["figure", "highcharts"],
      "settings": ["selectors"],
      "metadata": {
        "organization_ids": [
          "org-fbc1"
        ],
        "hist_parameters": {
          "period": "MONTHLY",
          "from": "2017-06-01",
          "to": "2017-08-01"
        },
        "currency": "AUD",
        "account_id": "ce60e9e0-6f07-0135-3368-245e60d776b1"
      }
    }
  }

Account Balance
GET/widgets/account_balance

Accounts current balances, and historical balances throughout the given period.

Supported layouts

  • figure

  • highcharts

Supported settings

  • selectors

Parameters

Name Example Type Optional / Required Description Default value
layouts ['highcharts'] array[string] optional Layouts used to format the widget’s response All supported layouts
settings ['selectors'] array[string] optional Settings used to format the widget’s settings responses All supported settings
metadata[organization_ids] ['org-fbxi'] array[string] required Unique ids of the companies for which the widget will be calculated
metadata[currency] 'AUD' string required Currency in which the result will be displayed
metadata[hist_parameters][from] '2017-01-01' string optional Time period start Beginning of calendar year
metadata[hist_parameters][to] '2017-05-15' string optional Time period end Date at which the widget is requested
metadata[hist_parameters][period] 'MONTHLY' string optional Time period interval 'MONTHLY'
metadata[account_id] 'ce60e9e0-6f07-0135-3368-245e60d776b1' string optional The account to display The first account

Accounts Comparison

GET https://api-impac.maestrano.com/api/v2/maestrano/finance/widgets/accounts_comparison
Requestsexample 1example 2example 3
Headers
Authorization: Basic ZmFkNTRzNmY2YTRzZGY2YWRzZzQ2YWRmNTQ4Z2RmZzpnNTRkZnNn=
Responses200
Headers
Content-Type: application/json
Body
{
    "accounts_comparison": {
      "highcharts": {
        "chart": {
          "type": "column",
        },
        "series": [
          {
            "name": "Business Bank Account",
            "data": [331.5, null]
          },
          {
            "name": "Business Savings Account",
            "data": [null, 14500.0]
          }
        ],
        "xAxis": {
          "categories": [
            "Business Bank Account",
            "Business Savings Account"
          ]
        },
        "plotOptions": {
          "column": {
            "grouping": false
          }
        }
      }
    },
    "settings": {
      "selectors": [
        {
          "name": "accounts",
          "options": [
            {
              "label": "Business Bank Account (331.5 AUD)",
              "value": "ce60e9e0-6f07-0135-3368-245e60d776b1",
              "group_name": "ASSET"
            },
            {
              "label": "Business Savings Account (14500.0 AUD)",
              "value": "ce689550-6f07-0135-336c-245e60d776b1",
              "group_name": "ASSET"
            },
            {
              "label": "Sales (500.0 AUD)",
              "value": "ce6f85e0-6f07-0135-3370-245e60d776b1",
              "group_name": "REVENUE"
            }
          ]
        }
      ]
    },
    "params": {
      "provider": "maestrano",
      "name": "finance",
      "endpoint": "accounts_comparison",
      "layouts": ["highcharts"],
      "settings": ["selectors"],
      "metadata": {
        "organization_ids": [
          "org-fbc1"
        ],
        "currency": "AUD",
        "accounts_list": [
          "ce60e9e0-6f07-0135-3368-245e60d776b1",
          "ce689550-6f07-0135-336c-245e60d776b1"
        ]
      }
    }
  }
Headers
Authorization: Basic ZmFkNTRzNmY2YTRzZGY2YWRzZzQ2YWRmNTQ4Z2RmZzpnNTRkZnNn=
Responses200
Headers
Content-Type: application/json
Body
{
    "accounts_comparison": {
      "highcharts": {
        "chart": {
          "type": "column",
        },
        "series": [
          {
            "name": "Company 1 - Business Bank Account",
            "data": [331.5, null]
          },
          {
            "name": "Company 1 - Business Savings Account",
            "data": [null, 14500.0]
          }
        ],
        "xAxis": {
          "categories": [
            "Business Bank Account",
            "Business Savings Account"
          ]
        },
        "plotOptions": {
          "column": {
            "grouping": false
          }
        }
      }
    },
    "settings": {
      "selectors": [
        {
          "name": "accounts",
          "options": [
            {
              "label": "Company 1 - Business Bank Account (331.5 AUD)",
              "value": "ce60e9e0-6f07-0135-3368-245e60d776b1",
              "group_name": "ASSET"
            },
            {
              "label": "Company 1 - Business Savings Account (14500.0 AUD)",
              "value": "ce689550-6f07-0135-336c-245e60d776b1",
              "group_name": "ASSET"
            },
            {
              "label": "Company 1 - Sales (500.0 AUD)",
              "value": "ce6f85e0-6f07-0135-3370-245e60d776b1",
              "group_name": "REVENUE"
            },
            {
              "label": "Company 2 - Sales (250.0 AUD)",
              "value": "ff5g85e0-6f06-0335-4470-245e60d994b1",
              "group_name": "REVENUE"
            }
          ]
        }
      ]
    },
    "params": {
      "provider": "maestrano",
      "name": "finance",
      "endpoint": "accounts_comparison",
      "layouts": ["highcharts"],
      "settings": ["selectors"],
      "metadata": {
        "organization_ids": [
          "org-fbc1",
          "org-fbbj"
        ],
        "currency": "AUD",
        "accounts_list": [
          "ce60e9e0-6f07-0135-3368-245e60d776b1",
          "ce689550-6f07-0135-336c-245e60d776b1"
        ]
      }
    }
  }
Headers
Authorization: Basic ZmFkNTRzNmY2YTRzZGY2YWRzZzQ2YWRmNTQ4Z2RmZzpnNTRkZnNn=
Responses200
Headers
Content-Type: application/json
Body
{
  "accounts_comparison": {
    "highcharts": {
      "chart": {
        "type": "column"
      },
      "series": [
        {
          "name": "Sales",
          "data": [
            750
          ]
        }
      ],
      "xAxis": {
        "categories": [
          "Sales"
        ]
      },
      "plotOptions": {
        "column": {
          "grouping": false
        }
      }
    }
  },
  "settings": {
    "selectors": [
      {
        "name": "accounts",
        "options": [
          {
            "label": "Sales (750.0 AUD)",
            "value": "ce6f85e0-6f07-0135-3370-245e60d776b1:ff5g85e0-6f06-0335-4470-245e60d994b1",
            "group_name": "REVENUE"
          }
        ]
      }
    ]
  },
  "params": {
    "provider": "maestrano",
    "name": "finance",
    "endpoint": "accounts_comparison",
    "layouts": [
      "highcharts"
    ],
    "settings": [
      "selectors"
    ],
    "metadata": {
      "organization_ids": [
        "org-fbc1",
        "org-fbbj"
      ],
      "currency": "AUD",
      "accounts_list": [
        "ce6f85e0-6f07-0135-3370-245e60d776b1:ff5g85e0-6f06-0335-4470-245e60d994b1"
      ],
      "comparison_mode": true
    }
  }
}

Accounts Comparison
GET/widgets/accounts_comparison

When only one organization is specified (See Request Example 1):

Select accounts to compare total balances side-by-side.

When several organizations are specified (See Request Example 2):

Select accounts to compare total balances side-by-side, with company name included in the account name.

When several organizations are specified and metadata[comparison_mode] is set to true (See Request Example 3):

Comparison mode finds accounts with similar names across companies, and combines them into one ‘combined account’. Then, these combined accounts are selectable to compare total balances side-by-side.

Supported layouts

  • highcharts

Supported settings

  • selectors

Parameters

Name Example Type Optional / Required Description Default value
layouts ['highcharts'] array[string] optional Layouts used to format the widget’s response All supported layouts
settings ['selectors'] array[string] optional Settings used to format the widget’s settings responses All supported settings
metadata[organization_ids] ['org-fbxi'] array[string] required Unique ids of the companies for which the widget will be calculated
metadata[currency] 'AUD' string required Currency in which the result will be displayed
metadata[hist_parameters][from] '2017-01-01' string optional Time period start Beginning of calendar year
metadata[hist_parameters][to] '2017-05-15' string optional Time period end Date at which the widget is requested
metadata[hist_parameters][period] 'MONTHLY' string optional Time period interval 'MONTHLY'
metadata[accounts_list] ['ce87ba70-6f07-0135-3384-245e60d776b1'] array[string] optional Specific accounts to compare First two accounts
metadata[comparison_mode] true boolean optional Find matching accounts by name & build combined account

Assets Summary

GET https://api-impac.maestrano.com/api/v2/maestrano/finance/widgets/assets_summary
Requestsexample 1example 2
Headers
Authorization: Basic ZmFkNTRzNmY2YTRzZGY2YWRzZzQ2YWRmNTQ4Z2RmZzpnNTRkZnNn=
Responses200
Headers
Content-Type: application/json
Body
{
  "assets_summary": {
    "highcharts": {
      "chart": {
        "type": "pie"
      },
      "series": [
        {
          "name": "Asset Accounts",
          "data": [
            {
              "name": "Business Bank Account",
              "y": 500
            },
            {
              "name": "Business Savings Account",
              "y": 200
            },
            {
              "name": "Accounts Receivable",
              "y": 800
            }
          ]
        }
      ]
    }
  },
  "params": {
    "provider": "maestrano",
    "name": "finance",
    "endpoint": "assets_summary",
    "metadata": {
      "organization_ids": [
        "org-fbc1"
      ],
      "hist_parameters": {
        "period": "MONTHLY",
        "from": "2017-06-01",
        "to": "2017-11-10"
      },
      "currency": "AUD"
    }
  }
}
Headers
Authorization: Basic ZmFkNTRzNmY2YTRzZGY2YWRzZzQ2YWRmNTQ4Z2RmZzpnNTRkZnNn=
Responses200
Headers
Content-Type: application/json
Body
{
  "assets_summary": {
    "highcharts": {
      "chart": {
        "type": "pie"
      },
      "series": [
        {
          "name": "Accounting Company Pty Ltd",
          "y": 3450
        },
        {
          "name": "Banking Company Pty Ltd",
          "y": 9000
        }
      ]
    }
  },
  "params": {
    "provider": "maestrano",
    "name": "finance",
    "endpoint": "assets_summary",
    "metadata": {
      "organization_ids": [
        "org-fbc1",
        "org-fcca"
      ],
      "hist_parameters": {
        "period": "MONTHLY",
        "from": "2017-06-01",
        "to": "2017-11-10"
      },
      "currency": "AUD"
    }
  }
}

Assets Summary
GET/widgets/assets_summary

When only one organization is specified (See Request Example 1):

A summary comparing the total balance of accounts for a selected classification.

When several organizations are specified (See Request Example 2):

A summary comparing organizations total balances of all accounts by a selected classification.

Supported classifications

  • ASSET

  • REVENUE

  • EXPENSE

  • LIABILITY

Supported layouts

  • highcharts

Parameters

Name Example Type Optional / Required Description Default value
layouts ['highcharts'] array[string] optional Layouts used to format the widget’s response All supported layouts
metadata[classification] 'REVENUE' string optional Only accounts belonging to this classification will be calculated in the summary 'ASSET'
metadata[organization_ids] ['org-fbxi'] array[string] required Unique ids of the companies for which the widget will be calculated
metadata[currency] 'AUD' string required Currency in which the result will be displayed
metadata[hist_parameters][from] '2017-01-01' string optional Time period start Beginning of calendar year
metadata[hist_parameters][to] '2017-05-15' string optional Time period end Date at which the widget is requested
metadata[hist_parameters][period] 'MONTHLY' string optional Time period interval 'MONTHLY'

Balance Sheet

GET https://api-impac.maestrano.com/api/v2/maestrano/finance/widgets/balance_sheet
Requestsexample 1
Headers
Authorization: Basic ZmFkNTRzNmY2YTRzZGY2YWRzZzQ2YWRmNTQ4Z2RmZzpnNTRkZnNn=
Responses200
Headers
Content-Type: application/json
Body
{
    "balance_sheet": {
      "table": {
        "headers": {
          "id": "balance_sheet",
          "cells": ["Accounts", "Balance at 2017-12-07", "Balance at 2017-07-01"]
        },
        "rows": {
          "grouped": [
            {
              "headers": {
                "id": "asset",
                "cells": ["Assets", 28753.0, 25753.0],
              },
              "rows": {
                "single": [
                  { "id": "1", "cells": ["Business Bank Account", 28753.0, 25753.0] },
                ]
              }
            },
            {
              "headers": {
                "id": "liability",
                "cells": ["Liabilities", 16917.7, 18917.7]
              },
              "rows": {
                "single": [
                  { "id": "2", "cells": ["Accounts Payable", 16917.7, 18917.7] },
                ]
              }
            },
            {
              "headers": {
                "id": "equity",
                "cells": ["Equities", 3850.0, 2100.0]
              },
              "rows": {
                "single": [
                  { "id": "3", "cells": ["Owner A Funds Introduced", 2500.0, 1000.0] },
                  { "id": "4", "cells": ["Retained Earnings", 400.0, 150.0] },
                  { "id": "5", "cells": ["Current Year Earnings", 950.0, 950.0] }
                ]
              }
            }
          ]
        }
      }
    },
    "params": {
        "provider": "maestrano",
        "name": "finance",
        "endpoint": "balance_sheet",
        "metadata": {
          "organization_ids": [
            "org-fbc1"
          ],
          "dates": [
            "2017-12-07",
            "2017-07-01"
          ]
          "currency": "AUD"
        }
    }
}

Balance Sheet
GET/widgets/balance_sheet

Compares the current balance of all your accounts, Current Year & Retained Earnings, with their balances at a previous period(s).

Supported layouts

  • table

Parameters

Name Example Type Optional / Required Description Default value
layouts ['table'] array[string] optional Layouts used to format the widget’s response All supported layouts
metadata[organization_ids] ['org-fbxi'] array[string] required Unique ids of the companies for which the widget will be calculat
metadata[currency] 'AUD' string required Currency in which the result will be displayed
metadata[dates] ['2017-12-07', '2017-11-07'] array[string] optional balance sheet dates Today compared to Current Financial Year start e.g ['2017-12-07', '2017-07-01']

Cash Balance

GET https://api-impac.maestrano.com/api/v2/maestrano/finance/widgets/cash_balance
Requestsexample 1
Headers
Authorization: Basic ZmFkNTRzNmY2YTRzZGY2YWRzZzQ2YWRmNTQ4Z2RmZzpnNTRkZnNn=
Responses200
Headers
Content-Type: application/json
Body
{
  "cash_balance": {
    "chart": {
      "series": [
        {
          "id": "091cc570-8c58-0135-7c33-699ae39be372",
          "bias": "positive",
          "marker": {
            "symbol": "circle"
          },
          "name": "Business Bank Account",
          "color": null,
          "data": [
            [
              1510617600000,
              -9081.58
            ],
            [
              1510704000000,
              -9081.58
            ],
            [
              1510790400000,
              -9081.58
            ],
            [
              1510876800000,
              -9081.58
            ],
            [
              1510963200000,
              null
            ]
          ]
        },
        {
          "id": "0933d1f0-8c58-0135-7c37-699ae39be372",
          "bias": "positive",
          "marker": {
            "symbol": "circle"
          },
          "name": "Business Savings Account",
          "color": null,
          "data": [
            [
              1510617600000,
              6878.28
            ],
            [
              1510704000000,
              6878.28
            ],
            [
              1510790400000,
              6878.28
            ],
            [
              1510876800000,
              6878.28
            ],
            [
              1510963200000,
              null
            ]
          ]
        },
        {
          "id": "projected",
          "marker": {
            "enabled": false
          },
          "zoneAxis": "x",
          "zones": [
            {
              "value": 1510876800000,
              "fillColor": "rgba(168, 208, 218, 0.5)"
            },
            {
              "dashStyle": "ShortDot",
              "fillColor": "rgba(168, 208, 218, 0.2)"
            }
          ],
          "type": "area",
          "name": "Projected cash",
          "color": "rgb(168, 208, 218)",
          "data": [
            [
              1510617600000,
              -2203.3
            ],
            [
              1510704000000,
              -2203.3
            ],
            [
              1510790400000,
              -2203.3
            ],
            [
              1510876800000,
              -4254.54
            ],
            [
              1510963200000,
              -2754.54
            ]
          ]
        }
      ]
    },
    "grouped_table": {
      "headers": [
        "Cash on Hand",
        "Combined"
      ],
      "groups": [
        [
          {
            "id": "091cc570-8c58-0135-7c33-699ae39be372",
            "name": "Business Bank Account",
            "company_name": "Demo Company (AU)"
          },
          {
            "id": "0933d1f0-8c58-0135-7c37-699ae39be372",
            "name": "Business Savings Account",
            "company_name": "Demo Company (AU)"
          }
        ],
        [
          {
            "id": "projected",
            "name": "Projected cash"
          }
        ]
      ]
    }
  },
  "params": {
    "provider": "maestrano",
    "name": "finance",
    "endpoint": "cash_balance",
    "metadata": {
      "organization_ids": [
        "org-fky7"
      ],
      "currency": "AUD",
      "hist_parameters": {
        "from": "2017-11-14",
        "to": "2017-11-18"
      }
    }
  }
}

Cash Balance
GET/widgets/cash_balance

Calculates your past and projected cash over a given time period.

Returns each Bank account with its balance evolution.

current cash = [total of all the journals emitted on BANK and CREDITCARD accounts]
projected cash = [current cash] + [receivables at date] - [payables at date]

Supported layouts

  • chart

  • grouped_table

Parameters

Name Example Type Optional / Required Description Default value
layouts ['chart'] array[string] optional Layouts used to format the widget’s response All supported layouts
metadata[organization_ids] ['org-fbxi'] array[string] required Unique ids of the companies for which the widget will be calculated
metadata[currency] 'AUD' string required Currency in which the result will be displayed
metadata[hist_parameters][from] '2017-01-01' string optional Time period start Beginning of calendar year
metadata[hist_parameters][to] '2017-05-15' string optional Time period end Date at which the widget is requested
metadata[hist_parameters][period] 'DAILY' string optional Time period interval 'DAILY'

Cash Projection

GET https://api-impac.maestrano.com/api/v2/maestrano/finance/widgets/cash_projection
Requestsexample 1
Headers
Authorization: Basic ZmFkNTRzNmY2YTRzZGY2YWRzZzQ2YWRmNTQ4Z2RmZzpnNTRkZnNn=
Responses200
Headers
Content-Type: application/json
Body
{
  "cash_projection": {
    "chart": {
      "series": [
        {
          "marker": {
            "enabled": false
          },
          "zoneAxis": "x",
          "zones": [
            {
              "value": 1510876800000,
              "fillColor": "rgba(168, 208, 218, 0.5)"
            },
            {
              "dashStyle": "ShortDot",
              "fillColor": "rgba(168, 208, 218, 0.2)"
            }
          ],
          "type": "area",
          "name": "Projected cash",
          "color": "rgb(168, 208, 218)",
          "data": [
            [
              1510617600000,
              -2203.3
            ],
            [
              1510704000000,
              -2203.3
            ],
            [
              1510790400000,
              -2203.3
            ],
            [
              1510876800000,
              -4254.54
            ],
            [
              1510963200000,
              -2754.54
            ]
          ]
        },
        {
          "type": "column",
          "name": "Cash flow",
          "color": null,
          "data": [
            [
              1510617600000,
              -2203.3
            ],
            [
              1510704000000,
              0
            ],
            [
              1510790400000,
              0
            ],
            [
              1510876800000,
              0
            ],
            [
              1510963200000,
              0
            ]
          ]
        },
        {
          "cursor": "pointer",
          "linkedTo": "Payables",
          "stack": "Payables",
          "stacking": "normal",
          "type": "column",
          "name": "more than 2 days",
          "color": "#e19aa8",
          "data": [
            [
              1510617600000,
              0
            ],
            [
              1510704000000,
              0
            ],
            [
              1510790400000,
              0
            ],
            [
              1510876800000,
              5825.79
            ],
            [
              1510963200000,
              0
            ]
          ]
        },
        {
          "cursor": "pointer",
          "linkedTo": "Payables",
          "stack": "Payables",
          "stacking": "normal",
          "type": "column",
          "name": "less than 2 days",
          "color": "#d97f90",
          "data": [
            [
              1510617600000,
              0
            ],
            [
              1510704000000,
              0
            ],
            [
              1510790400000,
              0
            ],
            [
              1510876800000,
              0
            ],
            [
              1510963200000,
              0
            ]
          ]
        },
        {
          "cursor": "pointer",
          "stack": "Payables",
          "stacking": "normal",
          "type": "column",
          "name": "Payables",
          "color": "#d16378",
          "data": [
            [
              1510617600000,
              0
            ],
            [
              1510704000000,
              0
            ],
            [
              1510790400000,
              0
            ],
            [
              1510876800000,
              0
            ],
            [
              1510963200000,
              0
            ]
          ]
        },
        {
          "cursor": "pointer",
          "linkedTo": "Receivables",
          "stack": "Receivables",
          "stacking": "normal",
          "type": "column",
          "name": "more than 2 days",
          "color": "#afc4a2",
          "data": [
            [
              1510617600000,
              0
            ],
            [
              1510704000000,
              0
            ],
            [
              1510790400000,
              0
            ],
            [
              1510876800000,
              3774.55
            ],
            [
              1510963200000,
              0
            ]
          ]
        },
        {
          "cursor": "pointer",
          "linkedTo": "Receivables",
          "stack": "Receivables",
          "stacking": "normal",
          "type": "column",
          "name": "less than 2 days",
          "color": "#9cb68c",
          "data": [
            [
              1510617600000,
              0
            ],
            [
              1510704000000,
              0
            ],
            [
              1510790400000,
              0
            ],
            [
              1510876800000,
              0
            ],
            [
              1510963200000,
              0
            ]
          ]
        },
        {
          "cursor": "pointer",
          "stack": "Receivables",
          "stacking": "normal",
          "type": "column",
          "name": "Receivables",
          "color": "#89a876",
          "data": [
            [
              1510617600000,
              0
            ],
            [
              1510704000000,
              0
            ],
            [
              1510790400000,
              0
            ],
            [
              1510876800000,
              0
            ],
            [
              1510963200000,
              1500
            ]
          ]
        }
      ]
    }
  },
  "params": {
    "provider": "maestrano",
    "name": "finance",
    "endpoint": "cash_projection",
    "metadata": {
      "organization_ids": [
        "org-fky7"
      ],
      "currency": "AUD",
      "hist_parameters": {
        "from": "2017-11-14",
        "to": "2017-11-18"
      },
      "ranges": [
        "-2d"
      ]
    }
  }
}

Cash Projection
GET/widgets/cash_projection

Calculates your past and projected cash over a given time period.

Returns the total cash, payables and receivables.

current cash = [total of all the journals emitted on BANK and CREDITCARD accounts]
projected cash = [current cash] + [receivables at date] - [payables at date]

It is also possible to offset the calculation of the projected cash:

  • By offseting the current cash

  • By offseting each future interval

# Offsets the current cash by $150.0
metadata[:offset][:current] = [100.0, 50.0]
# Offsets the current cash and each future interval by -$200.0
metadata[:offset][:per_interval] = [-200.0]

By specifying ranges, the overdue invoices and bills will be split in separate chart series corresponding to their age.

Eg: metadata[:ranges] = ['-60d', '-30d'] will split the payables and receivables in 4 series each:

  • “more than 60 days” => all the invoices / bills overdue by more than 60 days

  • “30 do 60 days” => invoices / bills overdue by 30 to 60 days

  • “less than 30 days” => invoices / bills overdue by less than 30 days

  • “Payables” / “Receivables” => invoices / bills that are not overdue (simply “due”)

Note: only negative time spans will be supported (eg: ‘30d’ will be ignored)

Supported layouts

  • chart

Parameters

Name Example Type Optional / Required Description Default value
layouts ['chart'] array[string] optional Layouts used to format the widget’s response All supported layouts
metadata[organization_ids] ['org-fbxi'] array[string] required Unique ids of the companies for which the widget will be calculated
metadata[currency] 'AUD' string required Currency in which the result will be displayed
metadata[hist_parameters][from] '2017-01-01' string optional Time period start Beginning of calendar year
metadata[hist_parameters][to] '2017-05-15' string optional Time period end Date at which the widget is requested
metadata[hist_parameters][period] 'DAILY' string optional Time period interval 'DAILY'
metadata[offset][current] [100.0, 50.0] array[float] optional Offsets the cash at current interval []
metadata[offset][per_interval] [-200.0] array[float] optional Offsets the cash at current interval and each future intervals []
metadata[ranges] ['-60d', '-30d'] array[string] optional Splits the overdue invoices and bills into separate stacks of receivables and payables []

Classifications Summary

GET https://api-impac.maestrano.com/api/v2/maestrano/finance/widgets/classifications_summary
Requestsexample 1
Headers
Authorization: Basic ZmFkNTRzNmY2YTRzZGY2YWRzZzQ2YWRmNTQ4Z2RmZzpnNTRkZnNn=
Responses200
Headers
Content-Type: application/json
Body
{
  "classifications_summary": {
    "highcharts": {
      "chart": {
        "type": "column"
      },
      "series": [
        {
          "name": "Asset",
          "color": null,
          "data": [
            100,
            null,
            null,
            null,
            null
          ]
        },
        {
          "name": "Revenue",
          "color": null,
          "data": [
            null,
            50,
            null,
            null,
            null
          ]
        },
        {
          "name": "Expense",
          "color": null,
          "data": [
            null,
            null,
            300,
            null,
            null
          ]
        },
        {
          "name": "Liability",
          "color": null,
          "data": [
            null,
            null,
            null,
            500,
            null
          ]
        },
        {
          "name": "Equity",
          "color": null,
          "data": [
            null,
            null,
            null,
            null,
            250
          ]
        }
      ],
      "plotOptions": {
        "column": {
          "grouping": false
        }
      },
      "xAxis": {
        "categories": [
          "Asset",
          "Revenue",
          "Expense",
          "Liability",
          "Equity"
        ]
      }
    }
  },
  "params": {
    "provider": "maestrano",
    "name": "finance",
    "endpoint": "classifications_summary",
    "metadata": {
      "organization_ids": [
        "org-fbc1"
      ],
      "hist_parameters": {
        "period": "MONTHLY",
        "from": "2017-06-01",
        "to": "2017-08-01"
      },
      "currency": "AUD"
    }
  }
}

Classifications Summary
GET/widgets/classifications_summary

A summary comparing account classifications by total accounts balance.

Supported classifications

  • ASSET

  • REVENUE

  • EXPENSE

  • LIABILITY

  • EQUITY

Supported layouts

  • highcharts

Parameters

Name Example Type Optional / Required Description Default value
layouts ['highcharts'] array[string] optional Layouts used to format the widget’s response All supported layouts
metadata[classification] 'REVENUE' string optional Only accounts belonging to this classification will be calculated in the summary
metadata[organization_ids] ['org-fbxi'] array[string] required Unique ids of the companies for which the widget will be calculated
metadata[currency] 'AUD' string required Currency in which the result will be displayed
metadata[hist_parameters][from] '2017-01-01' string optional Time period start Beginning of calendar year
metadata[hist_parameters][to] '2017-05-15' string optional Time period end Date at which the widget is requested
metadata[hist_parameters][period] 'MONTHLY' string optional Time period interval 'MONTHLY'

Current Ratio

GET https://api-impac.maestrano.com/api/v2/maestrano/finance/widgets/current_ratio
Requestsexample 1
Headers
Authorization: Basic ZmFkNTRzNmY2YTRzZGY2YWRzZzQ2YWRmNTQ4Z2RmZzpnNTRkZnNn=
Responses200
Headers
Content-Type: application/json
Body
{
    "current_ratio": {
      "figure": {
        "metrics": [
          {
            "value": 1035,
            "label": "Total Assets",
            "unit": "AUD",
            "id": "numerator"
          },
          {
            "value": 500,
            "label": "Total Liabilities",
            "unit": "AUD",
            "id": "denominator"
          },
          {
            "value": 2.07,
            "label": "Current Ratio",
            "unit": "ratio",
            "id": "current_ratio"
          }
        ]
      },
      "highstocks": {
        "chart": {
          "type": "column"
        },
        "series": [
          {
            "name": "Current Ratio",
            "data": [
              [1498780800000, 1.3],
              [1501459200000, 2.07],
              [1501545600000, 2.07]
            ]
          }
        ],
      }
    },
    "params": {
      "provider": "maestrano",
      "name": "finance",
      "endpoint": "current_ratio",
      "metadata": {
        "organization_ids": [
          "org-fbc1"
        ],
        "hist_parameters": {
          "period": "MONTHLY",
          "from": "2017-06-01",
          "to": "2017-08-01"
        },
        "currency": "AUD",
        "offset": {
          "numerator": [10, 25]
        }
      }
    }
  }

Current Ratio
GET/widgets/current_ratio

Calculates the Current Ratio (= Total Assets over Total Liabilities). It is possible to specify a list of offset for each member of the ratio: (numerator, denominator, or ratio (=result). The sum of all offsets is going to be applied to the list of all members.

Supported layouts

  • figure

  • highstocks

Parameters

Name Example Type Optional / Required Description Default value
layouts ['highstocks'] array[string] optional Layouts used to format the widget’s response All supported layouts
metadata[organization_ids] ['org-fbxi'] array[string] required Unique ids of the companies for which the widget will be calculat
metadata[currency] 'AUD' string required Currency in which the result will be displayed
metadata[hist_parameters][from] '2017-01-01' string optional Time period start Beginning of calendar year
metadata[hist_parameters][to] '2017-05-15' string optional Time period end Date at which the widget is requested
metadata[hist_parameters][period] 'MONTHLY' string optional Time period interval 'MONTHLY'
metadata[offset][numerator] '[10, 5.5]' array optional Offset assets by summed total on all intervals
metadata[offset][denominator] '[1500]' array optional Offset liabilities by summed total on all intervals
metadata[offset][ratio] '[0.1, -0.33]' array optional Offset current ratios by summed total on all intervals

Debt Service Ratio

GET https://api-impac.maestrano.com/api/v2/maestrano/finance/widgets/debt_service_ratio
Requestsexample 1
Headers
Authorization: Basic ZmFkNTRzNmY2YTRzZGY2YWRzZzQ2YWRmNTQ4Z2RmZzpnNTRkZnNn=
Responses200
Headers
Content-Type: application/json
Body
{
    "debt_service_ratio": {
      "figure": {
        "metrics": [
          {
            "value": 55111.39,
            "label": "Total Operating Income (Revenue - Expense excl. Interests and Taxes)",
            "unit": "AUD",
            "id": "numerator"
          },
          {
            "value": 400.0,
            "label": "Total Debt Service (Interests + Loan Payables)",
            "unit": "AUD",
            "id": "denominator"
          },
          {
            "value": 137.78,
            "label": "Debt Service Ratio",
            "unit": "ratio",
            "id": "debt_service_ratio"
          }
        ]
      },
      "highstocks": {
        "chart": {
          "type": "column"
        },
        "series": [
          {
            "name": "Debt Service Ratio",
            "data": [
              [1498780800000, 199.0],
              [1501459200000, 137.78],
              [1501545600000, 137.78]
            ]
          }
        ],
      }
    },
    "params": {
      "provider": "maestrano",
      "name": "finance",
      "endpoint": "debt_service_ratio",
      "metadata": {
        "organization_ids": [
          "org-fbc1"
        ],
        "hist_parameters": {
          "period": "MONTHLY",
          "from": "2017-06-01",
          "to": "2017-08-01"
        },
        "currency": "AUD",
        "offset": {
          "numerator": [10, 25]
        }
      }
    }
  }

Debt Service Ratio
GET/widgets/debt_service_ratio

Calculates the Debt Service Ratio (= Total Operating Income (income excluding taxes and interests) over Debt Service (Loan Payable and Interests Paid)). It is possible to specify a list of offset for each member of the ratio: (numerator, denominator, or ratio (=result). The sum of all offsets is going to be applied to the list of all members.

Supported layouts

  • figure

  • highstocks

Parameters

Name Example Type Optional / Required Description Default value
layouts ['highstocks'] array[string] optional Layouts used to format the widget’s response All supported layouts
metadata[organization_ids] ['org-fbxi'] array[string] required Unique ids of the companies for which the widget will be calculat
metadata[currency] 'AUD' string required Currency in which the result will be displayed
metadata[hist_parameters][from] '2017-01-01' string optional Time period start Beginning of calendar year
metadata[hist_parameters][to] '2017-05-15' string optional Time period end Date at which the widget is requested
metadata[hist_parameters][period] 'MONTHLY' string optional Time period interval 'MONTHLY'
metadata[offset][numerator] '[10, 5.5]' array optional Offset assets by summed total on all intervals
metadata[offset][denominator] '[1500]' array optional Offset liabilities by summed total on all intervals
metadata[offset][ratio] '[0.1, -0.33]' array optional Offset current ratios by summed total on all intervals

Detailed Classifications

GET https://api-impac.maestrano.com/api/v2/maestrano/finance/widgets/detailed_classifications
Requestsexample 1
Headers
Authorization: Basic ZmFkNTRzNmY2YTRzZGY2YWRzZzQ2YWRmNTQ4Z2RmZzpnNTRkZnNn=
Responses200
Headers
Content-Type: application/json
Body
{
    "detailed_classifications": {
      "table": {
        "headers": {
          "id": "detailed_classifications",
          "cells": ["Account Classifications", "Amounts"]
        },
        "rows": {
          "grouped": [
            {
              "headers": {
                "id": "asset",
                "cells": ["Asset", 15924.99]
              },
              "rows": {
                "single": [
                  { "id": "1", "cells": ["Business Bank Account", 2469.99] },
                  { "id": "2", "cells": ["Business Savings Account", 13455.0] }
                ]
              },
            },
            {
              "headers": {
                "id": "revenue",
                "cells": ["Revenue", 15442.89]
              },
              "rows": {
                "single": [
                  { "id": "3", "cells": ["Sales", 15442.89] }
                ]
              }
            }
          ]
        }
      }
    },
    "params": {
      "provider": "maestrano",
      "name": "finance",
      "endpoint": "detailed_classifications",
      "metadata": {
        "organization_ids": [
          "org-fbc1"
        ],
        "hist_parameters": {
          "period": "MONTHLY",
          "from": "2017-06-01",
          "to": "2017-08-01"
        },
        "currency": "AUD"
      }
    }
}

Detailed Classifications
GET/widgets/detailed_classifications

A summary of accounts with their current balances, grouped by classifications.

Supported layouts

  • table

Parameters

Name Example Type Optional / Required Description Default value
layouts ['table'] array[string] optional Layouts used to format the widget’s response All supported layouts
metadata[organization_ids] ['org-fbxi'] array[string] required Unique ids of the companies for which the widget will be calculated
metadata[currency] 'AUD' string required Currency in which the result will be displayed
metadata[hist_parameters][from] '2017-01-01' string optional Time period start Beginning of calendar year
metadata[hist_parameters][to] '2017-05-15' string optional Time period end Date at which the widget is requested
metadata[hist_parameters][period] 'MONTHLY' string optional Time period interval 'MONTHLY'

Ebitda

GET https://api-impac.maestrano.com/api/v2/maestrano/finance/widgets/ebitda
Requestsexample 1
Headers
Authorization: Basic ZmFkNTRzNmY2YTRzZGY2YWRzZzQ2YWRmNTQ4Z2RmZzpnNTRkZnNn=
Responses200
Headers
Content-Type: application/json
Body
{
    "ebitda": {
      "figure": {
        "metrics": [
          {
            "value": 55111.39,
            "label": "Revenue - Expenses (excluding Taxes, Interests, Depreciation and Amortization)",
            "unit": "AUD"
          }
        ]
      },
      "highstocks": {
        "chart": {
          "type": "column",
        },
        "series": [
          {
            "name": "EBITDA",
            "data": [
              [1498780800000, 39800.0],
              [1501459200000, 15311.39],
              [1501545600000, 0.0]
            ]
          }
        ],
      }
    },
    "params": {
      "provider": "maestrano",
      "name": "finance",
      "endpoint": "ebitda",
      "metadata": {
        "organization_ids": [
          "org-fbc1"
        ],
        "hist_parameters": {
          "period": "MONTHLY",
          "from": "2017-06-01",
          "to": "2017-08-01"
        },
        "currency": "AUD"
      }
    }
  }

Ebitda
GET/widgets/ebitda

Returns the EBITDA (Revenue - Expenses excluding Interest, Taxes, Depreciation and Amortization) throughout a given period of time.

Supported layouts

  • figure

  • highstocks

Parameters

Name Example Type Optional / Required Description Default value
layouts ['highstocks'] array[string] optional Layouts used to format the widget’s response All supported layouts
metadata[organization_ids] ['org-fbxi'] array[string] required Unique ids of the companies for which the widget will be calculat
metadata[currency] 'AUD' string required Currency in which the result will be displayed
metadata[hist_parameters][from] '2017-01-01' string optional Time period start Beginning of calendar year
metadata[hist_parameters][to] '2017-05-15' string optional Time period end Date at which the widget is requested
metadata[hist_parameters][period] 'MONTHLY' string optional Time period interval 'MONTHLY'

Expenses Revenue

GET https://api-impac.maestrano.com/api/v2/maestrano/finance/widgets/expenses_revenue
Requestsexample 1example 2
Headers
Authorization: Basic ZmFkNTRzNmY2YTRzZGY2YWRzZzQ2YWRmNTQ4Z2RmZzpnNTRkZnNn=
Responses200
Headers
Content-Type: application/json
Body
{
    "expenses_revenue": {
      "highstocks": {
        "chart": {
          "type": "column",
        },
        "series": [
          {
            "name": "Expenses",
            "data": [
              [1501459200000, 100],
              [1504137600000, 100]
            ]
          },
          {
            "name": "Revenue",
            "data": [
              [1501459200000, 50],
              [1504137600000, 50],
            ]
          }
        ]
      },
      "highcharts": {
        "chart": {
          "type": "pie",
        },
        "series": [
          {
            "name": "Expenses / Revenue",
            "data": [
              { "name": "Expenses", "y": 200 },
              { "name": "Revenue", "y": 100 }
            ]
          }
        ],
        "tooltip": {
          "headerFormat": "{series.name}<br>",
          "pointFormat": "{point.name}: <b>{point.y}%</b>"
        }
      }
    },
    "params": {
      "provider": "maestrano",
      "name": "finance",
      "endpoint": "expenses_revenue",
      "metadata": {
        "organization_ids": [
          "org-fbc1"
        ],
        "hist_parameters": {
          "period": "MONTHLY",
          "from": "2017-07-01",
          "to": "2017-08-31"
        },
        "currency": "AUD"
      }
    }
}
Headers
Authorization: Basic ZmFkNTRzNmY2YTRzZGY2YWRzZzQ2YWRmNTQ4Z2RmZzpnNTRkZnNn=
Responses200
Headers
Content-Type: application/json
Body
{
    "expenses_revenue": {
      "highstocks": {
        "chart": {
          "type": "column",
        },
        "series": [
          {
            "name": "Net Profit",
            "data": [
              [1501459200000, 50],
              [1504137600000, 50],
            ]
          }
        ]
      },
      "highcharts": {
        "chart": {
          "type": "pie",
        },
        "series": [
          {
            "name": "Expenses / Revenue",
            "data": [
              { "name": "Expenses", "y": 200 },
              { "name": "Revenue", "y": 100 }
            ]
          }
        ],
        "tooltip": {
          "headerFormat": "{series.name}<br>",
          "pointFormat": "{point.name}: <b>{point.y}%</b>"
        }
      },
    },
    "params": {
      "provider": "maestrano",
      "name": "finance",
      "endpoint": "expenses_revenue",
      "metadata": {
        "organization_ids": [
          "org-fbc1"
        ],
        "hist_parameters": {
          "period": "MONTHLY",
          "from": "2017-07-01",
          "to": "2017-08-31"
        },
        "currency": "AUD",
        "display_net_profit": true
      }
    }
  }

Expenses Revenue
GET/widgets/expenses_revenue

When metadata[display_net_profit] is set to false (See Request Example 1):

Renders the total balances sum for EXPENSE and REVENUE accounts, and, renders the balances for EXPENSE and REVENUE accounts.

When metadata[display_net_profit] is set to true (See Request Example 2):

Renders the total balances sum for EXPENSE and REVENUE accounts, and, renders the balances of a net profit calculation (expenses - revenue).

Supported layouts

  • highcharts

  • highstocks

Parameters

Name Example Type Optional / Required Description Default value
layouts ['highstocks'] array[string] optional Layouts used to format the widget’s response All supported layouts
metadata[organization_ids] ['org-fbxi'] array[string] required Unique ids of the companies for which the widget will be calculat
metadata[currency] 'AUD' string required Currency in which the result will be displayed
metadata[hist_parameters][from] '2017-01-01' string optional Time period start Beginning of calendar year
metadata[hist_parameters][to] '2017-05-15' string optional Time period end Date at which the widget is requested
metadata[hist_parameters][period] 'MONTHLY' string optional Time period interval 'MONTHLY'
metadata[display_net_profit] true boolean optional Whether to render the Net Profit for the highstocks chart instead of expenses / revenue false

Expense Weight

GET https://api-impac.maestrano.com/api/v2/maestrano/finance/widgets/expense_weight
Requestsexample 1
Headers
Authorization: Basic ZmFkNTRzNmY2YTRzZGY2YWRzZzQ2YWRmNTQ4Z2RmZzpnNTRkZnNn=
Responses200
Headers
Content-Type: application/json
Body
{
    "expense_weight": {
        "figure": {
            "metrics": [
                {
                    "value": 331.5,
                    "label": "Purchases",
                    "unit": "AUD",
                    "id": "ce7f5850-6f07-0135-337c-245e60d776b1"
                }
            ]
        },
        "highcharts": {
            "chart": {
                "type": "column"
            },
            "xAxis": {
                "categories": ["Purchases to Total Expenses"]
            }
            "series": [
                {
                    "name": "Purchases to Total Expenses",
                    "data": [
                        100.0
                    ]
                }
            ]
        },
        "highstocks": {
            "chart": {
                "type": "column"
            },
            "series": [
                {
                    "name": "Purchases to Total Expenses",
                    "data": [
                        [
                            1501459200000,
                            100.0
                        ],
                        [
                            1504137600000,
                            100.0
                        ]
                    ]
                }
            ]
        }
    },
    "params": {
        "provider": "maestrano",
        "name": "finance",
        "endpoint": "expense_weight",
        "metadata": {
            "organization_ids": [
                "org-fbc1"
            ],
            "hist_parameters": {
                "period": "MONTHLY",
                "from": "2017-07-01",
                "to": "2017-08-31"
            },
            "currency": "AUD",
            "account_id": "ce7f5850-6f07-0135-337c-245e60d776b1",
            "comparator": "expenses"
        }
    }
}

Expense Weight
GET/widgets/expense_weight

Returns the weight of an expense account in comparison to a given comparator (ratio between its current balance and another comparison value). By default, the selected account’s balance will be compared to the sum of all the expenses accounts’ current balances. The comparator to use can be specified as either ‘expenses’ or ‘turnover’. When ‘turnover’ is selected, accounts are compared againsts income accounts (class ‘REVENUE’, sub-type ‘INCOME’).

Supported layouts

  • figure

  • highcharts

  • highstocks

Parameters

Name Example Type Optional / Required Description Default value
layouts ['highstocks'] array[string] optional Layouts used to format the widget’s response All supported layouts
metadata[organization_ids] ['org-fbxi'] array[string] required Unique ids of the companies for which the widget will be calculat
metadata[currency] 'AUD' string required Currency in which the result will be displayed
metadata[hist_parameters][from] '2017-01-01' string optional Time period start Beginning of calendar year
metadata[hist_parameters][to] '2017-05-15' string optional Time period end Date at which the widget is requested
metadata[hist_parameters][period] 'MONTHLY' string optional Time period interval 'MONTHLY'
metadata[comparator] 'turnover' boolean optional The type of comparison to be made to the selected account 'expenses'
metadata[account_id] 'cea422f0-6f07-0135-3398-245e60d776b1' string optional The account to compare The first expense account

Overall Turnover

GET https://api-impac.maestrano.com/api/v2/maestrano/finance/widgets/overall_turnover
Requestsexample 1
Headers
Authorization: Basic ZmFkNTRzNmY2YTRzZGY2YWRzZzQ2YWRmNTQ4Z2RmZzpnNTRkZnNn=
Responses200
Headers
Content-Type: application/json
Body
{
    "overall_turnover": {
      "figure": {
        "metrics": [
          {
            "value": 3.45,
            "label": "Revenue / Asset",
            "unit": "ratio"
          }
        ]
      },
      "highstocks": {
        "chart": {
          "type": "column",
        },
        "series": [
          {
            "name": "Overall Turnover",
            "data": [
              [1498780800000, 2.67],
              [1501459200000, 16.7],
              [1501545600000, 0.0]
            ]
          }
        ]
      }
    },
    "params": {
      "provider": "maestrano",
      "name": "finance",
      "endpoint": "overall_turnover",
      "metadata": {
        "organization_ids": [
          "org-fbc1"
        ],
        "hist_parameters": {
          "period": "MONTHLY",
          "from": "2017-06-01",
          "to": "2017-08-01"
        },
        "currency": "AUD"
      }
    }
  }

Overall Turnover
GET/widgets/overall_turnover

Returns the turnover (US calculation) = Revenue / Assets throughout a given period of time.

Supported layouts

  • figure

  • highstocks

Parameters

Name Example Type Optional / Required Description Default value
layouts ['highstocks'] array[string] optional Layouts used to format the widget’s response All supported layouts
metadata[organization_ids] ['org-fbxi'] array[string] required Unique ids of the companies for which the widget will be calculat
metadata[currency] 'AUD' string required Currency in which the result will be displayed
metadata[hist_parameters][from] '2017-01-01' string optional Time period start Beginning of calendar year
metadata[hist_parameters][to] '2017-05-15' string optional Time period end Date at which the widget is requested
metadata[hist_parameters][period] 'MONTHLY' string optional Time period interval 'MONTHLY'

Payable Receivable

GET https://api-impac.maestrano.com/api/v2/maestrano/finance/widgets/payable_receivable
Requestsexample 1
Headers
Authorization: Basic ZmFkNTRzNmY2YTRzZGY2YWRzZzQ2YWRmNTQ4Z2RmZzpnNTRkZnNn=
Responses200
Headers
Content-Type: application/json
Body
{
    "payable_receivable": {
        "figure": {
            "metrics": [
                {
                    "value": 20554.0,
                    "label": "Accounts Receivable",
                    "unit": "AUD"
                },
                {
                    "value": 85567.89,
                    "label": "Accounts Payable",
                    "unit": "AUD"
                }
            ]
        },
        "highstocks": {
            "chart": {
                "type": "line",
            },
            "series": [
                {
                    "name": "Accounts Receivable",
                    "data": [
                        [1501459200000, 12558.0],
                        [1504137600000, 6659.0],
                        [1504224000000, 20554.0]
                    ]
                },
                {
                    "name": "Accounts Payables",
                    "data": [
                        [1501459200000, 55661.0],
                        [1504137600000, 109596.89],
                        [1504224000000, 85567.89]
                    ]
                }
            ]
        }
    },
    "params": {
        "provider": "maestrano",
        "name": "finance",
        "endpoint": "payable_receivable",
        "metadata": {
            "organization_ids": [
                "org-fbc1"
            ],
            "hist_parameters": {
                "period": "MONTHLY",
                "from": "2017-07-01",
                "to": "2017-09-01"
            },
            "currency": "AUD"
        }
    }
}

Payable Receivable
GET/widgets/payable_receivable

Returns the sums of the accounts of type or sub_type PAYABLE and the sum of those of type or sub_type RECEIVABLE throughout a given period of time.

Supported layouts

  • figure

  • highstocks

Parameters

Name Example Type Optional / Required Description Default value
layouts ['highstocks'] array[string] optional Layouts used to format the widget’s response All supported layouts
metadata[organization_ids] ['org-fbxi'] array[string] required Unique ids of the companies for which the widget will be calculat
metadata[currency] 'AUD' string required Currency in which the result will be displayed
metadata[hist_parameters][from] '2017-01-01' string optional Time period start Beginning of calendar year
metadata[hist_parameters][to] '2017-05-15' string optional Time period end Date at which the widget is requested
metadata[hist_parameters][period] 'MONTHLY' string optional Time period interval 'MONTHLY'

Profit and Loss

GET https://api-impac.maestrano.com/api/v2/maestrano/finance/widgets/profit_and_loss
Requestsexample 1
Headers
Authorization: Basic ZmFkNTRzNmY2YTRzZGY2YWRzZzQ2YWRmNTQ4Z2RmZzpnNTRkZnNn=
Responses200
Headers
Content-Type: application/json
Body
{
    "profit_and_loss": {
      "table": {
        "headers": {
          "id": "profit_and_loss",
          "cells": ["Accounts", "Profit/Loss"]
        },
        "rows": {
          "grouped": [
            {
              "headers": {
                "id": "income",
                "cells": ["Income", 200.0]
              },
              "rows": {
                "single": [
                  { "id": "6d08adf0-ff94-0135-57b4-245e60d776b1", "cells": ["Sales", 150.0] },
                  { "id": "6d0e9f70-ff94-0135-57b8-245e60d776b1", "cells": ["Other Revenue", 50.0] }
                ]
              },
            },
            {
              "headers": {
                "id": "operating_expenses",
                "cells": ["Operating Expenses", 100.0]
              },
              "rows": {
                "single": [
                  { "id": "6d137b10-ff94-0135-57bc-245e60d776b1", "cells": ["Bank Fees", 100.0] }
                ]
              }
            }
          ],
          "single": [
            { "id": "gross_profit", "cells": ["Gross Profit", 200] },
            { "id": "net_profit", "cells": ["Net Profit", 300] }
          ]
        }
      },
      "highstocks": {
        "chart": {
          "type": "line"
        },
        "series": [
          {
            "name": "Sales",
            "data": [
              [1498780800000, 0],
              [1501459200000, 75],
              [1501545600000, 75]
            ]
          },
          {
            "name": "Net Profit",
            "data": [
              [1498780800000, 100],
              [1501459200000, 100],
              [1501545600000, 100]
            ]
          }
        ]
      }
    },
    "params": {
      "provider": "maestrano",
      "name": "finance",
      "endpoint": "profit_and_loss",
      "metadata": {
        "organization_ids": [
          "org-fbc1"
        ],
        "hist_parameters": {
          "period": "MONTHLY",
          "from": "2017-06-01",
          "to": "2017-08-31"
        },
        "currency": "AUD",
        "selected_elements": [
          "net_profit",
          "6d08adf0-ff94-0135-57b4-245e60d776b1"
        ]
      }
    }
  }

Profit and Loss
GET/widgets/profit_and_loss

A standard PnL report, calculating the accounts balances evolution within a given time range, ordered by account type.

Supported layouts

  • highstocks

  • table

Parameters

Name Example Type Optional / Required Description Default value
layouts ['highstocks'] array[string] optional Layouts used to format the widget’s response All supported layouts
metadata[organization_ids] ['org-fbxi'] array[string] required Unique ids of the companies for which the widget will be calculat
metadata[currency] 'AUD' string required Currency in which the result will be displayed
metadata[hist_parameters][from] '2017-01-01' string optional Time period start Beginning of calendar year
metadata[hist_parameters][to] '2017-05-15' string optional Time period end Date at which the widget is requested
metadata[hist_parameters][period] 'MONTHLY' string optional Time period interval 'MONTHLY'
metadata[selected_elements] ['net_profit', '6d08adf0-ff94-0135-57b4-245e60d776b1'] array optional The categories or accounts to include in the highstocks chart series [‘net_profit’]

KPIs

Index

GET https://api-impac.maestrano.com/api/v2/maestrano/finance/kpis
Responses200
Headers
Content-Type: application/json
Body
{
  "kpis": [
    {
      "name": "CashProjection",
      "endpoint": "kpis/cash_projection",
      "watchables": [
        "threshold"
      ],
      "attachables": [
        "cash_projection"
      ]
    }
  ]
}

Index
GET/kpis

Returns the list of all available KPIs.

The watchables correspond to the list of metrics that can be targeted to determine whether the KPI is triggered or not.

The attachables correspond to the list of widgets each KPI can be attached to.


Notifications Webhook

Create

POST https://api-impac.maestrano.com/api/v2/maestrano/finance/notifications
Requestsexample 1
Headers
Content-Type: application/json
Authorization: Basic ZmFkNTRzNmY2YTRzZGY2YWRzZzQ2YWRmNTQ4Z2RmZzpnNTRkZnNn=
Body
{
    // Company unique id as saved in Connec!
    "channel_id": "org-abcd",
    // New or modified entities
    "entities": {
      "invoices": [
        {
          "id": "0g5e9655-3245-0134-e575-05d5581ffb37",
          "balance": 1500.0
        }
      ],
      "journals": [
        {
          "id": "0e8e7480-5237-0134-e575-05d7781eeb37",
          "transaction_reference_id": "0g5e9655-3245-0134-e575-05d5581ffb37"
        }
      ]
    }
  }
Responses200
Headers
Content-Type: application/json
Body
{
    // Returns the entities saved in the Bolt's data-model
    "entities": {
      "invoices": [
        {
          "id": "0g5e9655-3245-0134-e575-05d5581ffb37",
          "balance": 1500.0
        }
      ],
      "totals_per_account": [
        {
          "account_id": "328a104c-eb10-40a6-83d1-0d991164d90f",
          "total": 1500.0
        },
        {
          "account_id": "3a2e6cb8-7127-474d-a7ab-62a4203b47f2",
          "total": -1500.0
        }
      ]
    }
  }

Create
POST/notifications

The Bolt exposes a Webhook to be notified of data changes in real-time. The standard integration receives updates from Applications integrated with Impac! and Connec!.

Integration with any data source can be done by sending data to this endpoint

Upon receiving data on this endpoint, the Bolt aggregates financial transactions and journals entries to generate up to date reports.

We call “entity” each data type stored in Connec! which relates to a company. Eg: an invoice or an employee are entities. See http://maestrano.github.io/connec/ for more information about entities.

The list of entities that the Finance Bolt processes are

  • company

  • accounts

  • invoices: will create invoices when type = 'CUSTOMER' and bills when type = 'SUPPLIER'

  • journals: won’t directly create a Journal, but generate an aggregate instead


Generated by aglio on 30 Apr 2018