Impac!™ API v1 (legacy)

For information regarding authentication and APIs versioning, please refer to the main Impac!™ documentation

Dynamic Segments

Widgets and KPIs engines can be called by using URL dynamic segments. Eg:

GET api/v1/widgets/:endpoint - to request a widget engine
GET api/v1/kpis/:endpoint/:watchable - to request a KPI engine

:endpoint corresponds to the name of the widget/KPI engine requested. Eg:

GET api/v1/widgets/accounts/balance - will request the Accounts Balance widget engine
GET api/v1/kpis/accounting/revenue/:watchable - will request the Accounting Revenue KPI engine

:watchable (applicable to the KPIs engines only) determines what type of calculation is to be applied. Eg:

GET api/v1/kpis/accounting/revenue/total - requests the Accounting Revenue KPI engine, and will watch the "total" revenue evolution

Some parameters specified in the metadata[] hash parameter will allow the KPI or widget engines to adopt a given behavior. For instance, metadata[currency] = "EUR" will indicate to the engine, that it has to convert all the source amounts to Euros before performing any calculation.

Some “metadata parameters” are common across the widget & KPI engines, some are only common to the widgets engines, and some other are only common to the KPI engines. Eg: metadata[hist_parameters][] or metadata[organization_ids][] will be passed to both KPIs & Widgets.

The behavior of the metadata parameters that are shared between different widgets & KPIs will be described in this section. The behavior of the specific metadata parameters will be described in each widget engine & KPI engine section.

All the KPIs described below are only available with GET requests.

Parameters

Widgets Parameters

GET https://api-impac.maestrano.com/api/v1/widgets

Common to all widgets
GET/widgets

endpoint (required)

Key identifier for each widget or KPI.

Note: endpoint is not a metadata parameter, and has to be passed directly as part of the URL.

Example:

GET api/v1/widgets/invoices/list

organization_ids (required)

Unique identifiers of the organizations to be used as data sources.

Example:

GET api/v1/widgets/invoices/list?metadata[organization_ids][]=org-fbba&metadata[organization_ids][]=org-fbbb
# => params[:metadata][:organization_ids] = ['org-fbba', 'org-fbbb']

sso_session (optional)

See: Authentication

If the user is logged on Maestrano or any Tenant application, he should have a sso_session token associated to his session. This token can be used to authenticate the user trying to retrieve data from an organization.

Notes:

  • sso_session is not a metadata parameter, and has to be passed directly to the GET request

  • This token can also be passed via Basic Authentication, using the Authorization header. In this case, just set the username attribute of your Basic Auth as the sso_session token (no password attribute required).

Example:

GET api/v1/widgets/invoices/list?sso_session=adff653a03185ea6e5a0746afa4cd943400c743d
# => params[:sso_session] = adff653a03185ea6e5a0746afa4cd943400c743d

currency (optional)

ISO code representing the currency you want your financial data to be converted to. Eg: If you have two invoices, one in USD, one in AUD, and you would like to retrieve your invoices list in EUR, both invoices will be converted to EUR, at the rate of the respective invoices dates.

If the engine is returning a calculation based on several amounts in different currencies, these amounts will be converted to the indicated currency prior to the calculation, so that all the amounts retrieved, including the calculation results, will be in only one currency.

If no currency is specified, the default currency will be USD.

Example:

GET api/v1/widgets/invoices/list?metadata[currency]=EUR
# => params[:metadata][:currency] = "EUR"

hist_parameters (optional)

Used to determine the time period for which the data has to be retrieved. Two ways can be used to determine this time period:

Passing a start date and an end date.

Example:

GET api/v1/widgets/invoices/list?metadata[hist_parameters][period]=MONTHLY&metadata[hist_parameters][from]=2016-01-01&metadata[hist_parameters][to]=2016-03-15
# => params[:metadata][:hist_parameters] = { period: "MONTHLY", from: "2016-01-01", to: "2016-03-15" }

Will retrieve data from the 1st of Jan 2016 to the 15th of March 2016.

Passing an end date and a time range.

Example:

GET api/v1/widgets/invoices/list?metadata[hist_parameters][period]=MONTHLY&metadata[hist_parameters][time_range]=-2m&metadata[hist_parameters][to]=2016-03-15
# => params[:metadata][:hist_parameters] = { period: "MONTHLY", time_range: "-2m", to: "2016-03-15" }

Will retrieve data for the current month and the two previous months, so this is another way to retrieve data from the 1st of Jan 2016 to the 15th of March 2016.

The period key is used to determine the structure of the summary to be returned by the engine. if period: "MONTHLY" is specified, the summary will return one statement by month, each statement ending at the end of the month except the last statement that will end at the specified “to” date.

from and to must be dates at format: YYYY-MM-DD. Default from will be 1st Jan of the current year and default to, today’s date in most cases.

time_range accepts any negative number with letters: h for hours, d for days, w for weeks, m for months, q for quarters, y for years.

period accepts values: HOURLY DAILY WEEKLY MONTHLY QUARTERLY YEARLY RANGE. Default is MONTHLY, RANGE means that only one statement is to be returned, including all the data for the specified period.


GET https://api-impac.maestrano.com/api/v1/widgets

Common to several widgets
GET/widgets

account_uid (optional)

Unique identifier of a selected account for which to retrieve the data.

Example:

GET api/v1/widgets/accounts/balance?metadata[account_uid]=gfg-dfgsad44as4df546dsf-fad54s546fas
# => params[:metadata][:account_uid] = "gfg-dfgsad44as4df546dsf-fad54s546fas"

Used in widgets:

account_list (optional)

Array of selected accounts unique identifiers and names for which to retrieve the data.

Example:

GET api/v1/widgets/accounts/balance?metadata[account_list][0][uid]=gfg-dfgsad44as4df546dsf-fad54s546fas&metadata[account_list][0][name]=Account1
# => params[:metadata][:account_list] = [
#   {
#     uid: "gfg-dfgsad44as4df546dsf-fad54s546fas",
#     name: 'Account 1'
#   }
# ]

Note: account_list will be modified in a next version to be simply an array of uids.

Used in widgets:

period (optional)

Overrides metadata[hist_parameters][period] Some widgets don’t need to define the hist_parameters as they may need only a summary containing only one or two statements.

Example:

GET api/v1/widgets/accounts/balance?metadata[period]=DAILY
# => params[:metadata][:period] = "DAILY"

Can be used in any widget. However, the use of standard metadata[hist_parameters][period] is recommended

chart_filters (optional)

Especially used in case of a widget engine that should be displayed as a pie chart. It will determine how many entries have to be represented on the chart, or what percentage of the pie chart will be detailed (and not merged into “Others”).

It is formed of two elements:

  • metadata[chart_filters][criteria] can take the values number or percentage

  • metadata[chart_filters][value] has to be an integer

Examples:

GET api/v1/widgets/invoices/summary?metadata[chart_filters][criteria]=number&metadata[chart_filters][value]=3
# => metadata[chart_filters] = { criteria: "number", value: 3 }

Will return the top 3 entries and merge the rest into a 4th “Others” entry

GET api/v1/widgets/invoices/summary?metadata[chart_filters][criteria]=percentage&metadata[chart_filters][value]=75
# => metadata[chart_filters] = { criteria: "percentage", value: 75 }

Will return entries corresponding to the top 75% of the total amount retrieved, and merge the rest in another “Others” entry.

Used in widgets:

entity (optional)

Determines which entity type has to be retrieved (example: customers, suppliers).

Example:

GET api/v1/widgets/invoices/summary?metadata[entity]=suppliers
# => params[:metadata][:entity] = "suppliers"

Used in widgets:

order_by (optional)

Determines how the summary returned has to be sorted.

Example:

GET api/v1/widgets/invoices/summary?metadata[order_by]=total_paid
# => params[:metadata][:order_by] = "total_paid"

Used in widgets:


GET https://api-impac.maestrano.com/api/v1/widgets

Specific to some widgets
GET/widgets

Following metadata parameters are specific to some widgets and their use is going to be described in each relevant widget section.

  • metadata[classification]

  • metadata[criteria]

  • metadata[filter]

  • metadata[threshold]

  • metadata[unit]

  • metadata[threshold_sec]

  • metadata[keep_blanks]

  • metadata[debug]

  • metadata[product]

  • metadata[comparator]

URI Parameters
HideShow
sso_session
String (required) Example: "adff653a03185ea6e5a0746afa4cd943400c743d"
metadata.organization_ids
Enum[String] (required) Example: ["org-fbba","org-fcjn"]
metadata.currency
String (optional) Example: "EUR"
metadata.hist_parameters
Hash (optional) Example: {period: 'MONTHLY', from: '2016-01-01', to: '2016-03-15'}

KPIs Parameters

GET https://api-impac.maestrano.com/api/v1/kpis

Common to all KPIs
GET/kpis

endpoint (required)

The endpoint is used to select which KPI engine to run.

A KPI endpoint parameter is given using Dynamic Segment routing, so the parameter is added directly to the URL.

Example:

GET api/v1/kpis/accounting/revenue/:watchable

For endpoint naming & examples, see the individual KPI engine sections.

watchable (required)

A KPI watchable is a metric that the KPI will be watching at, for instance, a maximum, an average, a total.

A watchable parameter is indeed common (and required) for all KPIs, although the watchable metric itself can differ kpi engine to kpi engine.

The KPI watchable is also given by using Dynamic Segment routing.

Example:

GET api/v1/kpis/accounting/revenue/total

See individual KPI engine sections for available watchables.

targets(:watchable) (required)

KPI targets are set by watchable, when the KPI calculations are made, the response will include data on which targets have been “triggered”.

The target is either above or below the target value depending on the mode.

If a valid watchable for the KPI you’re querying is ‘ratio’, then an example would be:

GET api/v1/kpis/accounting/revenue/ratio?targets[ratio][0][max]=20
# => params[:targets][:ratio] = [ { max: 20 } ]

The example above would be considered triggered if the ratio of the KPI engine you’ve queried was above 20 %.

Targets can be set with multiple watchables, so another example could be:

GET api/v1/kpis/accounting/revenue/ratio?targets[ratio][0][max]=20&targets[balance][0][min]=3000
# => params[:targets] =
#  {
#    ratio: [ { max: 20 } ],
#    balance: [ { min: 3000 } ]
#  }

For a list of valid watchables, see the specific KPIs section.

organization_ids (required)

Unique identifiers of the organizations to be used as data sources.

Example:

GET api/v1/kpis/accounting/revenue/total?metadata[organization_ids][]=org-fbba&metadata[organization_ids][]=org-fbbb
# => params[:metadata][:organization_ids] = ['org-fbba', 'org-fbbb']

sso_session (optional)

If the user is logged on Maestrano or any Tenant application, he should have a sso_session token associated to his session. This token can be used to authenticate the user trying to retrieve data from an organization.

Notes:

  • sso_session is not a metadata parameter, and has to be passed directly to the GET request

  • This token can also be passed via Basic Authentication, using the Authorization header. In this case, just set the username attribute of your Basic Auth as the sso_session token (no password attribute required).

Example:

GET api/v1/accounting/revenue/total?sso_session=adff653a03185ea6e5a0746afa4cd943400c743d
# => params[:sso_session] = adff653a03185ea6e5a0746afa4cd943400c743d

currency (optional)

ISO code representing the currency you want your financial data to be converted to. Eg: If you have two invoices, one in USD, one in AUD, and you would like to retrieve your invoices list in EUR, both invoices will be converted to EUR, at the rate of the respective invoices dates.

If the engine is returning a calculation based on several amounts in different currencies, these amounts will be converted to the indicated currency prior to the calculation, so that all the amounts retrieved, including the calculation results, will be in only one currency.

If no currency is specified, the default currency will be USD.

Example:

GET api/v1/kpis/accounting/revenue/total?metadata[currency]=EUR
# => params[:metadata][:currency] = "EUR"

hist_parameters (optional)

Used to determine the time period for which the data has to be retrieved. Two ways can be used to determine this time period:

Passing a start date and an end date.

Example:

GET api/v1/kpis/accounting/revenue/total?metadata[hist_parameters][period]=MONTHLY&metadata[hist_parameters][from]=2016-01-01&metadata[hist_parameters][to]=2016-03-15
# => params[:metadata][:hist_parameters] = { period: "MONTHLY", from: "2016-01-01", to: "2016-03-15" }

Will retrieve data from the 1st of Jan 2016 to the 15th of March 2016.

Passing an end date and a time range.

Example:

GET api/v1/kpis/accounting/revenue/total?metadata[hist_parameters][period]=MONTHLY&metadata[hist_parameters][time_range]=-2m&metadata[hist_parameters][to]=2016-03-15
# => params[:metadata][:hist_parameters] = { period: "MONTHLY", time_range: "-2m", to: "2016-03-15" }

Will retrieve data for the current month and the two previous months, so this is another way to retrieve data from the 1st of Jan 2016 to the 15th of March 2016.

The period key is used to determine the structure of the summary to be returned by the engine. if period: "MONTHLY" is specified, the summary will return one statement by month, each statement ending at the end of the month except the last statement that will end at the specified “to” date.

from and to must be dates at format: YYYY-MM-DD. Default from will be 1st Jan of the current year and default to, today’s date in most cases.

time_range accepts any negative number with letters: h for hours, d for days, w for weeks, m for months, q for quarters, y for years.

period accepts values: HOURLY DAILY WEEKLY MONTHLY QUARTERLY YEARLY RANGE. Default is MONTHLY, RANGE means that only one statement is to be returned, including all the data for the specified period.

opts - financial_year_end_month (optional)

Set which month is the financial year end month (6 being July). opts are given directly to Connec!.

Example:

GET api/v1/kpis/accounting/revenue/total?opts[financial_year_end_month]=6
# => params[:opts][:financial_year_end_month] = 6

GET https://api-impac.maestrano.com/api/v1/kpis

Specific to some KPIs
GET/kpis

extra_params - account (optional)

Unique identifier of a selected account for which to calculate from.

Example:

GET api/v1/kpis/accounting/asset_overweight/balance?extra_param[account]=gfg-dfgsad44as4df546dsf-fad54s546fas
# => params[:extra_param] = { account: "gfg-dfgsad44as4df546dsf-fad54s546fas" }

Used in KPIs:

URI Parameters
HideShow
sso_session
String (required) Example: "adff653a03185ea6e5a0746afa4cd943400c743d"
metadata.organization_ids
Enum[String] (required) Example: ["org-fbba","org-fcjn"]
metadata.targets
Hash (required) Example: { ratio: [ { max: 20 } ] }
metadata.currency
String (optional) Example: "EUR"
metadata.hist_parameters
Hash (optional) Example: {period: 'MONTHLY', from: '2016-01-01', to: '2016-03-15'}

KPIs

Index

GET https://api-impac.maestrano.com/api/v1/kpis
Responses200
Body
{
  "kpis": [
    {
      "name": "Creditor Due Days",
      "endpoint": "invoicing/due_days/creditor",
      "watchables": [
        "max",
        "average"
      ],
      "attachables": null,
      "target_placeholders": {
        "max": {
          "mode": "max",
          "value": 90,
          "unit": "days"
        },
        "average": {
          "mode": "max",
          "value": 30,
          "unit": "days"
        }
      }
    },
    {
      "name": "Debtor Due Days",
      "endpoint": "invoicing/due_days/debtor",
      "watchables": [
        "max",
        "average"
      ],
      "attachables": null,
      "target_placeholders": {
        "max": {
          "mode": "max",
          "value": 90,
          "unit": "days"
        },
        "average": {
          "mode": "max",
          "value": 30,
          "unit": "days"
        }
      }
    },
    {
      "name": "Revenue",
      "endpoint": "accounting/revenue",
      "watchables": [
        "total",
        "evolution"
      ],
      "attachables": null,
      "target_placeholders": {
        "total": {
          "mode": "min",
          "value": 50000,
          "unit": "currency"
        },
        "evolution": {
          "mode": "min",
          "value": 5,
          "unit": "%"
        }
      }
    },
    {
      "name": "Overweighted Assets",
      "endpoint": "accounting/asset_overweight",
      "watchables": [
        "ratio",
        "balance"
      ],
      "attachables": null,
      "target_placeholders": {
        "ratio": {
          "mode": "max",
          "value": 20,
          "unit": "%"
        },
        "balance": {
          "mode": "max",
          "value": 50000,
          "unit": "currency"
        }
      },
      "extra_params": {
        "account": [
          {
            "id": "5edbcf50-f315-0133-43d4-6382fe1b7437",
            "label": "Accounts Receivable"
          },
          {
            "id": "5d6ada20-f315-0133-4334-6382fe1b7437",
            "label": "Business Bank Account"
          },
          {
            "id": "5d7bca21-f315-0133-4338-6382fe1b7437",
            "label": "Business Savings Account"
          },
          {
            "id": "5f09bd21-f315-0133-43ee-6382fe1b7437",
            "label": "Computer Equipment"
          },
          {
            "id": "5eec2301-f315-0133-43df-6382fe1b7437",
            "label": "Inventory"
          },
          {
            "id": "5f126fb1-f315-0133-43f4-6382fe1b7437",
            "label": "Less Accumulated Depreciation on Computer Equipment"
          },
          {
            "id": "5efff920-f315-0133-43ea-6382fe1b7437",
            "label": "Less Accumulated Depreciation on Office Equipment"
          },
          {
            "id": "5ef46050-f315-0133-43e5-6382fe1b7437",
            "label": "Office Equipment"
          },
          {
            "id": "5ee45ad0-f315-0133-43d9-6382fe1b7437",
            "label": "Prepayments"
          }
        ]
      }
    },
    {
      "name": "Account Balance",
      "endpoint": "accounting/balance",
      "watchables": [
        "balance"
      ],
      "attachables": [
        "accounts/balance"
      ],
      "target_placeholders": {
        "balance": {
          "mode": "min",
          "value": 15000,
          "unit": "currency"
        }
      }
    }
  ]
}

Index
GET/kpis

Retrieves all available KPI templates.

Note: You need to authenticate in order to be allowed to retrieve the KPIs templates list (see “Authentication” in the “Overview” section in the beginning of this documentation).


Accounting

GET https://api-impac.maestrano.com/api/v1/kpis/accounting/revenue/total
Responses200
Body
{
  "kpi": {
    // results calculated by the kpi engine for each watchable.
    "calculation": {
      "total": {
        "value": 45248.1,
        "unit": "AUD",
        // Represents the triggered or not triggered targets for this watchable.
        "triggers": [
          true
        ]
      }
    },
    // Configurations are where important parameters should be kept. For example, when asking
    // impac to calculate a kpis data and determine whether targets have been met, we thought
    // it would be appropriate to include the targets in the impac API #show response.
    "configuration": {
      "targets": {
        "total": [
          {
            "min": "50000"
          }
        ]
      }
    },
    // Layout configurations are used to dynamically configure the appearance and phrasing
    // of kpis.
    "layout": {
      "icon": {
        "type": "font-awesome",
        "value": "fa-calculator"
      },
      "text": {
        "caption": "Revenue from 2015-04-13",
        "emphasis": "below 50000 AUD",
        "alert": "alert me if I've earned below"
      },
      // Recommended target values, most commonly used as input placeholders.
      "target_placeholder": {
        "total": {
          "mode": "min",
          "value": 50000,
          "unit": "currency"
        }
      },
      // A triggered state, determine by whether any targets by watchable have been triggered.
      "triggered": true
    }
  }
}

Revenue
GET/kpis/accounting/revenue/{watchable}

Set targets on revenue earned over given periods by total or evolution.

Available KPI watchables for this endpoint:

  • total: A total currency value representing the total revenue across a given period.

  • evolution: A percentage representing the decline of your revenue compared to last financial year.

URI Parameters
HideShow
watchable
string (required) Example: total

Type of calculation to apply (which depends on the KPI to whether it is available).

targets
Object (required) 

Set targets on KPIs by watchable, to receive determine “ok” or “triggered” states for the KPI calculation.

metadata
Object (optional) 

Metadata relavent to the specific KPI.

extra_params
Object (optional) 

Extra parameters used for certain KPI calculations to determines values based off certain parameters (e.g accounts).

opts
Object (optional) 

Options sent directly to Connec!.


GET https://api-impac.maestrano.com/api/v1/kpis/accounting/asset_overweight/balance
Responses200
Body
{
  "kpi": {
    // results calculated by the kpi engine for each watchable.
    "calculation": {
      "balance": {
        "value": 16006.55,
        "unit": "AUD",
        // Represents the triggered or not triggered targets for this watchable.
        "triggers": [
          false
        ]
      }
    },
    // Configurations are where important parameters should be kept. For example, when asking
    // impac to calculate a kpis data and determine whether targets have been met, we thought
    // it would be appropriate to include the targets in the impac API #show response.
    "configuration": {
      "targets": {
        "balance": [
          {
            "max": "50000"
          }
        ]
      },
      "extra_params": {
        "account": "5edbcf50-f315-0133-43d4-6382fe1b7437"
      }
    },
    // Layout configurations are used to dynamically configure the appearance and phrasing
    // of kpis.
    "layout": {
      "icon": {
        "type": "font-awesome",
        "value": "fa-pie-chart"
      },
      "text": {
        "caption": "Overweighted Assets (balance)",
        "emphasis": "ok",
        "alert": "alert me when the account weights over"
      },
      // Recommended target values, most commonly used as input placeholders.
      "target_placeholder": {
        "balance": {
          "mode": "max",
          "value": 50000,
          "unit": "currency"
        }
      },
      // A triggered state, determine by whether any targets by watchable have been triggered.
      "triggered": false
    }
  }
}

Asset Overweight
GET/kpis/accounting/asset_overweight/{watchable}

Set targets to determine whether an accounts balance or ratio becomes overweight.

Available KPI watchables for this endpoint:

  • balance: The balance of the selected account.

  • ratio: A percentage representing the ratio of the selected account compared to the sum of all accounts.

Available extra_paramsfor this endpoint:

  • account
URI Parameters
HideShow
watchable
string (required) Example: balance

Type of calculation to apply (which depends on the KPI to whether it is available).

targets
Object (required) 

Set targets on KPIs by watchable, to receive determine “ok” or “triggered” states for the KPI calculation.

metadata
Object (optional) 

Metadata relavent to the specific KPI.

extra_params
Object (optional) 

Extra parameters used for certain KPI calculations to determines values based off certain parameters (e.g accounts).

opts
Object (optional) 

Options sent directly to Connec!.


GET https://api-impac.maestrano.com/api/v1/kpis/accounting/ratios/current/ratio
Responses200
Body
{
  "kpi": {
    // results calculated by the kpi engine for each watchable.
    "calculation": {
      "total": {
        "value": 0.65,
        "unit": "",
        // Represents the triggered or not triggered targets for this watchable.
        "triggers": [
          true
        ]
      }
    },
    // Configurations are where important parameters should be kept. For example, when asking
    // impac to calculate a kpis data and determine whether targets have been met, we thought
    // it would be appropriate to include the targets in the impac API #show response.
    "configuration": {
      "targets": {}
    },
    // Layout configurations are used to dynamically configure the appearance and phrasing
    // of kpis.
    "layout": {
      "icon": {
        "type": "font-awesome",
        "value": "fa-calculator"
      },
      "text": {
        "caption": "Current Ratio (ratio)",
        "emphasis": "ok",
        "alert": "alert me"
      },
      // Recommended target values, most commonly used as input placeholders.
      "target_placeholder": {
        "ratio": {
          "mode": "min",
          "value": 1,
          "unit": ""
        }
      },
      // A triggered state, determine by whether any targets by watchable have been triggered.
      "triggered": false
    }
  }
}

Current Ratio
GET/kpis/accounting/ratios/current/{watchable}

Set targets on Current Ratio (= Total Assets over Total Liabilities)

Available KPI watchables for this endpoint:

  • ratio: total assets / total liabilities
URI Parameters
HideShow
watchable
string (required) Example: ratio

Type of calculation to apply (which depends on the KPI to whether it is available).

targets
Object (required) 

Set targets on KPIs by watchable, to receive determine “ok” or “triggered” states for the KPI calculation.

metadata
Object (optional) 

Metadata relevant to the specific KPI.

extra_params
Object (optional) 

Extra parameters used for certain KPI calculations to determines values based off certain parameters (e.g accounts).

opts
Object (optional) 

Options sent directly to Connec!.


GET https://api-impac.maestrano.com/api/v1/kpis/accounting/ratios/debt_service/ratio
Responses200
Body
{
  "kpi": {
    // results calculated by the kpi engine for each watchable.
    "calculation": {
      "total": {
        "value": -3.14,
        "unit": "",
        // Represents the triggered or not triggered targets for this watchable.
        "triggers": [
          true
        ]
      }
    },
    // Configurations are where important parameters should be kept. For example, when asking
    // impac to calculate a kpis data and determine whether targets have been met, we thought
    // it would be appropriate to include the targets in the impac API #show response.
    "configuration": {
      "targets": {}
    },
    // Layout configurations are used to dynamically configure the appearance and phrasing
    // of kpis.
    "layout": {
      "icon": {
        "type": "font-awesome",
        "value": "fa-calculator"
      },
      "text": {
        "caption": "Debt Service Ratio (ratio)",
        "emphasis": "ok",
        "alert": "alert me"
      },
      // Recommended target values, most commonly used as input placeholders.
      "target_placeholder": {
        "ratio": {
          "mode": "min",
          "value": 1.0,
          "unit": ""
        }
      },
      // A triggered state, determine by whether any targets by watchable have been triggered.
      "triggered": false
    }
  }
}

Debt Service Ratio
GET/kpis/accounting/ratios/debt_service/{watchable}

Set targets on Debt Service Ratio (= Total Operating Income over Total Debt Service)

Available KPI watchables for this endpoint:

  • ratio: operating income / debt service
URI Parameters
HideShow
watchable
string (required) Example: ratio

Type of calculation to apply (which depends on the KPI to whether it is available).

targets
Object (required) 

Set targets on KPIs by watchable, to receive determine “ok” or “triggered” states for the KPI calculation.

metadata
Object (optional) 

Metadata relevant to the specific KPI.

extra_params
Object (optional) 

Extra parameters used for certain KPI calculations to determines values based off certain parameters (e.g accounts).

opts
Object (optional) 

Options sent directly to Connec!.


Invoicing

GET https://api-impac.maestrano.com/api/v1/kpis/invoicing/due_days/creditor/max
Responses200
Body
{
  "kpi": {
    // results calculated by the kpi engine for each watchable.
    "calculation": {
      "max": {
        "value": 610,
        "unit": "days",
        // Represents the triggered or not triggered targets for this watchable.
        "triggers": [
          true
        ]
      }
    },
    // Configurations are where important parameters should be kept. For example, when asking
    // impac to calculate a kpis data and determine whether targets have been met, we thought
    // it would be appropriate to include the targets in the impac API #show response.
    "configuration": {
      "targets": {
        "max": [
          {
            "max": "90"
          }
        ]
      }
    },
    // Layout configurations are used to dynamically configure the appearance and phrasing
    // of kpis.
    "layout": {
      "icon": {
        "type": "font-awesome",
        "value": "fa-credit-card"
      },
      "text": {
        "caption": "Creditor Due Days (max)",
        "emphasis": "over 90 days",
        "alert": "alert me when I owe over"
      },
      // Recommended target values, most commonly used as input placeholders.
      "target_placeholder": {
        "max": {
          "mode": "max",
          "value": 90,
          "unit": "days"
        }
      },
      // A triggered state, determine by whether any targets by watchable have been triggered.
      "triggered": true
    }
  }
}

Creditor days
GET/kpis/invoicing/due_days/creditor/{watchable}

Set targets to determine whether total customer due invoices are above or below an amount of days.

Available KPI watchables for this endpoint:

  • max: The raw value of invoices due days.

  • average: The average value of invoices due days.

URI Parameters
HideShow
watchable
string (required) Example: max

Type of calculation to apply (which depends on the KPI to whether it is available).

targets
Object (required) 

Set targets on KPIs by watchable, to receive determine “ok” or “triggered” states for the KPI calculation.

metadata
Object (optional) 

Metadata relavent to the specific KPI.

extra_params
Object (optional) 

Extra parameters used for certain KPI calculations to determines values based off certain parameters (e.g accounts).

opts
Object (optional) 

Options sent directly to Connec!.


GET https://api-impac.maestrano.com/api/v1/kpis/invoicing/due_days/debtor/average
Responses200
Body
{
  "kpi": {
    // results calculated by the kpi engine for each watchable.
    "calculation": {
      "average": {
        "value": 127,
        "unit": "days",
        "triggers": [
          true
        ]
      }
    },
    // Configurations are where important parameters should be kept. For example, when asking
    // impac to calculate a kpis data and determine whether targets have been met, we thought
    // it would be appropriate to include the targets in the impac API #show response.
    "configuration": {
      "targets": {
        "average": [
          {
            "max": "30"
          }
        ]
      }
    },
    // Layout configurations are used to dynamically configure the appearance and phrasing
    // of kpis.
    "layout": {
      "icon": {
        "type": "font-awesome",
        "value": "fa-tag"
      },
      "text": {
        "caption": "Debtor Due Days (average)",
        "emphasis": "over 30 days",
        "alert": "alert me when I'm owed over"
      },
      // Recommended target values, most commonly used as input placeholders.
      "target_placeholder": {
        "average": {
          "mode": "max",
          "value": 30,
          "unit": "days"
        }
      },
      // A triggered state, determine by whether any targets by watchable have been triggered.
      "triggered": true
    }
  }
}

Debtor days
GET/kpis/invoicing/due_days/debtor/{watchable}

Set targets to determine whether total supplier due invoices are above or below an amount of days.

Available KPI watchables for this endpoint:

  • max: The raw value of invoices due days.

  • average: The average value of invoices due days.

URI Parameters
HideShow
watchable
string (required) Example: average

Type of calculation to apply (which depends on the KPI to whether it is available).

targets
Object (required) 

Set targets on KPIs by watchable, to receive determine “ok” or “triggered” states for the KPI calculation.

metadata
Object (optional) 

Metadata relavent to the specific KPI.

extra_params
Object (optional) 

Extra parameters used for certain KPI calculations to determines values based off certain parameters (e.g accounts).

opts
Object (optional) 

Options sent directly to Connec!.


Notifications

Create

POST https://api-impac.maestrano.com/api/v1/notifications
Requestsexample 1
Headers
Content-Type: application/json
Body
{
    "batch": {
      "notifications": [
        {
          // New or modified resources (entities)
          "entities": {
            "journals": [
              { "id": "0e8e7480-5237-0134-e575-05d7781eeb37" }
            ],
            "contacts": [
              { "id": "0g5e9655-3245-0134-e575-05d5581ffb37" }
            ]
          }
          "channel_id": "org-abcd",
        }
      ]
    },
    "metadata": {
      "organization_ids": ["org-abcd"]
    }
  }
Responses

Create
POST/notifications

Allows to send a batch of Webhook notifications to Impac! in order to re-calculate the KPIs.

If the threshold is reached for a KPI, the user may be alerted depending on its preferences.


Widgets

Index

GET https://api-impac.maestrano.com/api/v1/widgets
Responses200
Body
{
  "widgets": [
    {
        "endpoint": "accounts/accounting_values/ebitda",
        "name": "EBITDA",
        "metadata": {
            "hist_parameters": {
                "from": "2017-07-01",
                "to": "2018-04-11",
                "period": "MONTHLY",
                "keep_today": true
            }
        },
        "desc": "Display the EBITDA of your company or set of companies",
        "icon": "calculator",
        "width": 3
    },
    {
        "endpoint": "accounts/accounting_values/turnover",
        "name": "Overall turnover",
        "metadata": {
            "hist_parameters": {
                "from": "2017-07-01",
                "to": "2018-04-11",
                "period": "MONTHLY",
                "keep_today": true
            }
        },
        "desc": "Display the overall turnover of your company or set of companies",
        "icon": "calculator",
        "width": 3
    },
    {
        "endpoint": "accounts/assets_summary",
        "name": "Assets summary",
        "metadata": {
            "hist_parameters": {
                "from": "2017-07-01",
                "to": "2018-04-11",
                "period": "MONTHLY",
                "keep_today": true
            }
        },
        "desc": "Pie chart representing your different 'asset' accounts values",
        "icon": "pie-chart",
        "width": 3
    },
    {
        "endpoint": "accounts/assets_summary",
        "name": "Liabilities summary",
        "metadata": {
            "classification": "liability",
            "hist_parameters": {
                "from": "2017-07-01",
                "to": "2018-04-11",
                "period": "MONTHLY",
                "keep_today": true
            }
        },
        "desc": "Pie chart representing your different 'liability' accounts values",
        "icon": "pie-chart",
        "width": 3
    },
    ...
  ]
}

Index
GET/widgets

Discovery endpoint that returns all the widget endpoints fetchable from the API.

This is a public endpoint - you don’t need to be authenticated to access the widgets list.

Field returned Description
endpoint Widget endpoint, to be added after api/v1/widgets
name Default name of the widget. After they are added to the dashboard, widgets can be renamed via the MnoHub API
metadata Default values for the “metadata parameters”. Can be overriden when accessing the widget
desc Short description of the widget
icon Font awesome icon representing the widget
width Number of bootstrap columns used on Impac! Angular to represent the widget by default. Some widgets can be resized

Accounting

GET https://api-impac.maestrano.com/api/v1/widgets/accounts/accounting_values/ebitda
Responses200
Body
{
  "organizations": [
    "org-abcd",
    "org-qwer"
  ],
  "accounting": {
    "currency": "EUR",
    "dates": [
      "2015-01-01",
      "2015-02-01",
      "2015-02-14"
    ],
    "legend": "Revenue - Expenses (excluding Taxes, Interests, Depreciation and Amortization)",
    "type": "EBITDA",
    "values": [
      1254.5,
      1245.3,
      1124.15
    ]
  },
  "hist_parameters": {
    "from": "2015-01-01",
    "to": "2015-02-14",
    "period": "MONTHLY"
  }
}

EBITDA
GET/widgets/accounts/accounting_values/ebitda

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


GET https://api-impac.maestrano.com/api/v1/widgets/accounts/accounting_values/turnover
Responses200
Body
{
  "organizations": [
    "org-abcd",
    "org-qwer"
  ],
  "accounting": {
    "currency": "(ratio)",
    "dates": [
      "2015-01-01",
      "2015-02-01",
      "2015-02-14"
    ],
    "legend": "Revenue / Asset",
    "type": "Overall Turnover",
    "values": [
      1.8,
      1.78,
      1.25
    ]
  },
  "hist_parameters": {
    "from": "2015-01-01",
    "to": "2015-02-14",
    "period": "MONTHLY"
  }
}

Turnover
GET/widgets/accounts/accounting_values/turnover

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


GET https://api-impac.maestrano.com/api/v1/widgets/accounts/ratios/current
Responses200
Body
{
  "content": {
    "calculation": {
      "numerator": {
        "values": [
          26406.94,
          23148.24,
          25228.59
        ],
        "offset": 0,
        "totals": [
          26406.94,
          23148.24,
          25228.59
        ]
      },
      "denominator": {
        "values": [
          38103.12,
          38859.96,
          39044.56
        ],
        "offset": 1500,
        "totals": [
          39603.12,
          40359.96,
          40544.56
        ]
      },
      "ratio": {
        "values": [
          0.67,
          0.57,
          0.62
        ],
        "offset": -0.23,
        "totals": [
          0.44,
          0.34,
          0.39
        ],
        "average": 0.39
      }
    },
    "layout": {
      "currency": "AUD",
      "numerator": "Total Assets",
      "denominator": "Total Liabilities",
      "ratio": "Current Ratio",
      "dates": [
        "2016-07-31",
        "2016-08-31",
        "2016-09-30"
      ],
      "accounting_behaviour": "bls"
    }
  }
}

Current Ratio
GET/widgets/accounts/ratios/current

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.

In “calculation”, the widget engine returns three outputs per member:

  • values: the initial value of the ratio for each interval, based on data retrieved from the accounts summary

  • offset: the sum of the offsets passed for the member in the metadata

  • totals: the combination between the values and the offset, for each interval

In “layout”, the widget engine returns useful display information: currency, labels, dates, and accounting behaviour

Optional:

  • metadata[:offset][:numerator] = nil

  • metadata[:offset][:denominator] = [1500]

  • metadata[:offset][:ratio] = [0.1, -0.33]


GET https://api-impac.maestrano.com/api/v1/widgets/accounts/ratios/debt_service
Responses200
Body
{
  "content": {
    "calculation": {
      "numerator": {
        "values": [
          1133,
          -4112.59,
          1895.75
        ],
        "offset": 0,
        "totals": [
          1133,
          -4112.59,
          1895.75
        ]
      },
      "denominator": {
        "values": [
          0,
          0,
          0
        ],
        "offset": 1500,
        "totals": [
          1500,
          1500,
          1500
        ]
      },
      "ratio": {
        "values": [
          0.76,
          -2.74,
          1.26
        ],
        "offset": -0.23,
        "totals": [
          0.53,
          -2.97,
          1.03
        ],
        "average": -0.47
      }
    },
    "layout": {
      "currency": "AUD",
      "numerator": "Total Operating Income (Revenue - Expense excl. Interests and Taxes)",
      "denominator": "Total Debt Service (Interests + Loan Payables)",
      "ratio": "Debt Service Ratio",
      "dates": [
        "2016-07-31",
        "2016-08-31",
        "2016-09-30"
      ],
      "accounting_behaviour": "pnl"
    }
  }
}

Debt Service Ratio
GET/widgets/accounts/ratios/debt_service

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.

In “calculation”, the widget engine returns three outputs per member:

  • values: the initial value of the ratio for each interval, based on data retrieved from the accounts summary

  • offset: the sum of the offsets passed for the member in the metadata

  • totals: the combination between the values and the offset, for each interval

In “layout”, the widget engine returns useful display information: currency, labels, dates, and accounting behaviour

Optional:

  • metadata[:offset][:numerator] = nil

  • metadata[:offset][:denominator] = [1500]

  • metadata[:offset][:ratio] = [0.1, -0.33]


GET https://api-impac.maestrano.com/api/v1/widgets/accounts/assets_summary
Responses200200
Body
{
  "organizations": [
    "org-abcd"
  ],
  "currency": "EUR",
  "summary": [
    {
      "label": "Asset Account 1",
      "total": 12547.23
    },
    {
      "label": "Asset Account 2",
      "total": 6057.87
    },
    {
      "label": "Asset Account 3",
      "total": 8954.45
    }
  ]
}
Body
{
  "organizations": [
    "org-abcd",
    "org-qwer"
  ],
  "currency": "EUR",
  "summary": [
    {
      "label": "Asset Account 1",
      "total": 12547.23
    },
    {
      "label": "Asset Account 2",
      "total": 6057.87
    },
    {
      "label": "Asset Account 3",
      "total": 8954.45
    }
  ],
  "repartition": [
    {
      "label": "Company A",
      "total": 5000,
      "currency": "EUR"
    },
    {
      "label": "Company B",
      "total": 22559.55,
      "currency": "EUR"
    }
  ]
}

Assets Summary
GET/widgets/accounts/assets_summary

When only one organization is specified:

By default, it returns an array of all your accounts of category “Assets” with their current balances. If a classification is specified, it will return the corresponding accounts.

When several organizations are specified:

By default, it also returns an array with one element by organization, containing the sum of current balances of all the “Assets” accounts of the corresponding organization. The classification to be used for the calculation can be specified.

Specific metadata parameters

  • metadata[:classification] Only accounts belonging to this classification will be returned in the summary - ASSET | REVENUE | EXPENSE | LIABILITY - Default = ASSET

GET https://api-impac.maestrano.com/api/v1/widgets/accounts/balance
Responses200
Body
{
  "organizations": [
    "org-abcd",
    "org-qwer"
  ],
  "dates": [
    "2015-01-01",
    "2015-02-01",
    "2015-02-14"
  ],
  "account_uid": "uid-1544das16a4ffdsasf-d54f54sfa",
  "account_list": [
    {
      "uid": "dsa-465asd654a6-s54da6as4d5sa",
      "name": "Account 1",
      "current_balance": 4577.45,
      "balances": [
        4022.56,
        4298.12,
        4577.45
      ],
      "currency": "EUR"
    },
    {
      "uid": "uid-1544das16a4ffdsasf-d54f54sfa",
      "name": "Account 2",
      "current_balance": 12333.77,
      "balances": [
        13584.98,
        11478.24,
        12333.77
      ],
      "currency": "EUR"
    }
  ],
  "hist_parameters": {
    "from": "2015-01-01",
    "to": "2015-02-14",
    "period": "MONTHLY"
  }
}

Balance
GET/widgets/accounts/balance

Returns an array of all your accounts, and their balances throughout a given period of time.

Specific metadata parameters

  • metadata[account_uid]

GET https://api-impac.maestrano.com/api/v1/widgets/accounts/balance_sheet
Responses200
Body
{
  "organizations": [
    "org-fbba"
  ],
  "period": "MONTHLY",
  "dates": [
    "2015-10-31",
    "2015-11-12"
  ],
  "summary": {
    "LIABILITY": {
      "totals": [
        -149369.48,
        -149369.48
      ],
      "currency": "EUR",
      "accounts": [
        {
          "id": "86f56c21-5ea1-0133-7dd6-6c3be58b7a6a",
          "name": "Company A - Accounts Payable",
          "totals": [
            -149369.47999999998,
            -149369.47999999998
          ],
          "currency": "EUR"
        }
      ]
    },
    "ASSET": {
      "totals": [
        253606.24,
        253606.24
      ],
      "currency": "EUR",
      "accounts": [
        {
          "id": "841c3460-5ea1-0133-7d9c-6c3be58b7a6a",
          "name": "Company A - Accounts Receivable",
          "totals": [
            204351.94999999998,
            204351.94999999998
          ],
          "currency": "EUR"
        },
        {
          "id": "8123b4f1-5ea1-0133-7d6c-6c3be58b7a6a",
          "name": "Company A - Cash on Hand",
          "totals": [
            49254.29,
            49254.29
          ],
          "currency": "EUR"
        }
      ]
    }
  }
}

Balance Sheet
GET/widgets/accounts/balance_sheet

Compares the current balance of all your accounts with their balances at a previous period (by default, previous month).

Specific metadata parameters

  • metadata[period] - MONTHLY | YEARLY | QUARTERLY | WEEKLY | DAILY

GET https://api-impac.maestrano.com/api/v1/widgets/accounts/cash_summary
Responses200
Body
{
  "organizations": [
    "org-fbba"
  ],
  "dates": [
    "2015-09-30",
    "2015-10-31",
    "2015-11-12"
  ],
  "summary": [
    {
      "name": "revenue",
      "currency": "EUR",
      "cash_flows": [
        17068.19,
        12807.97,
        0
      ],
      "accounts": [
        {
          "id": "6267af51-5f53-0133-2ac5-6c3be58b7a6a",
          "name": "Interest Income",
          "cash_flows": [
            0,
            97.05,
            0
          ],
          "currency": "EUR",
          "variances": [
            null,
            null,
            -100
          ]
        },
        {}
      ]
    },
    {
      "name": "operating_expenses",
      "currency": "EUR",
      "cash_flows": [
        15806.61,
        13910.9,
        0
      ],
      "accounts": [
        {
          "id": "62e40b41-5f53-0133-2ae0-6c3be58b7a6a",
          "name": "Consulting & Accounting",
          "cash_flows": [
            49,
            49,
            0
          ],
          "currency": "EUR",
          "variances": [
            null,
            0,
            -100
          ]
        },
        {}
      ]
    },
    {}
  ]
}

Cash Summary
GET/widgets/accounts/cash_summary

Returns the history of the (cash-in - cash-out) for all the accounts of an organization within a given time range.


GET https://api-impac.maestrano.com/api/v1/widgets/accounts/classifications_summary
Responses200
Body
{
  "organizations": [
    "org-fbba",
    "org-fbbi"
  ],
  "currency": "AUD",
  "companies": [
    "Company A",
    "Company B"
  ],
  "summary": [
    {
      "classification": "ASSET",
      "totals": [
        1561,
        6545
      ]
    },
    {
      "classification": "LIABILITY",
      "totals": [
        548,
        988
      ]
    }
  ]
}

Classifications Summary
GET/widgets/accounts/classifications_summary

For each specified organization, it returns the sum of all the accounts’ current balances, ordered by classification. Each element in a totals array corresponds to the sum of all the accounts of the classification for the company at the same index in the companies array.


GET https://api-impac.maestrano.com/api/v1/widgets/accounts/comparison
Responses200
Body
{
  "organizations": [
    "org-abcd",
    "org-qwer"
  ],
  "saved_list": [
    {
      "uid": "dsa-465asd654a6-s54da6as4d5sa",
      "name": "Account 1",
      "current_balance": 4577.45,
      "currency": "EUR"
    }
  ],
  "complete_list": [
    {
      "uid": "dsa-465asd654a6-s54da6as4d5sa",
      "name": "Account 1",
      "current_balance": 4577.45,
      "currency": "EUR"
    },
    {
      "uid": "uid-1544das16a4ffdsasf-d54f54sfa",
      "name": "Account 2",
      "current_balance": 12333.77,
      "currency": "EUR"
    }
  ]
}

Comparison
GET/widgets/accounts/comparison

Returns an array of all the available accounts with their balances, and an array of selected accounts uids.

Specific metadata parameters

  • metadata[account_list][]

GET https://api-impac.maestrano.com/api/v1/widgets/accounts/custom_calculation
Responses200
Body
{
  "organizations": [
    "org-abcd",
    "org-qwer"
  ],
  "formula": "{1} + {2}",
  "saved_list": [
    {
      "uid": "dsa-465asd654a6-s54da6as4d5sa",
      "name": "Account 1",
      "current_balance": 4577.45,
      "currency": "EUR"
    }
  ],
  "complete_list": [
    {
      "uid": "dsa-465asd654a6-s54da6as4d5sa",
      "name": "Account 1",
      "current_balance": 4577.45,
      "currency": "EUR"
    },
    {
      "uid": "uid-1544das16a4ffdsasf-d54f54sfa",
      "name": "Account 2",
      "current_balance": 12333.77,
      "currency": "EUR"
    }
  ]
}

Custom Calculation
GET/widgets/accounts/custom_calculation

DEPRECATED: The behaviour of this widget is very close to Accounts Comparison's one, and both are going to be factorized in a next version.

Specific metadata parameters

  • metadata[account_list][]

  • metadata[formula] - DEPRECATED


GET https://api-impac.maestrano.com/api/v1/widgets/accounts/detailed_classifications
Responses200
Body
{
  "organizations": [
    "org-fbba"
  ],
  "companies": [
    {
      "name": "Company A",
      "classifications": [
        {
          "name": "ASSET",
          "total": 260087.4,
          "currency": "EUR",
          "accounts": [
            {
              "name": "Business Bank Account",
              "balance": -2162.08,
              "currency": "AUD"
            },
            {}
          ]
        },
        {
          "name": "EXPENSE",
          "total": 61561.23,
          "currency": "EUR",
          "accounts": [
            {
              "name": "Purchases",
              "balance": 763.64,
              "currency": "EUR"
            },
            {}
          ]
        },
        {}
      ]
    },
    {}
  ]
}

Detailed Classifications
GET/widgets/accounts/detailed_classifications

For each of the organizations specified, returns a summary of accounts with their current balances, ordered by classifications


GET https://api-impac.maestrano.com/api/v1/widgets/accounts/expenses_revenue
Responses200
Body
{
  "organizations": [
    "org-abcd",
    "org-qwer"
  ],
  "values": {
    "expenses": [
      42587.32,
      41587.54,
      40558.45
    ],
    "revenue": [
      55871.33,
      54887.66,
      53669.24
    ]
  },
  "currency": "EUR",
  "dates": [
    "2015-01-01",
    "2015-02-01",
    "2015-02-14"
  ],
  "hist_parameters": {
    "from": "2015-01-01",
    "to": "2015-02-14",
    "period": "MONTHLY"
  }
}

Expenses / Revenue
GET/widgets/accounts/expenses_revenue

Returns the sums of the accounts of category EXPENSE and the sum of those of category REVENUE throughout a given period of time.


GET https://api-impac.maestrano.com/api/v1/widgets/accounts/expense_weight
Responses200
Body
{
  "organizations": ["org-fbba", "org-fbbi"],
  "summary": [
   {
     "company": "Company A",
     "ratio": 45.21,
     "account_uid": "id-54546das465safdsf"
   },
   {
     "company": "Company B",
     "ratio": 25.68,
     "account_uid": "id-sdafdsafa654gfasfdg"
   }
  ],
  "selected_account_uid": "id-sdafdsafa654gfasfdg",
  "account_list": [
   {
     "uid": "id-54546das465safdsf",
     "name": "Account 1",
     "company": "Company A",
     "balance": 45648.33,
     "currency": "EUR"
   },
   {
     "uid": "id-sdafdsafa654gfasfdg",
     "name": "Account 1",
     "company": "Company B",
     "balance": 12565.45,
     "currency": "EUR"
   },
   {
     "uid": "..",
     "name": "Account 2",
     "company": "Company A",
     "balance": 544.33,
     "currency": "EUR"
   },
  ]
}

Expense Weight
GET/widgets/accounts/expense_weight

When only one organization is specified

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.

When several companies are specified

If an account of Company A is selected, the engine will try to find a matching account (based on its name) in Company B’s accounts, and return the account’s weight for each of the two companies. The account_uid return in each element of the summary array corresponds to this matching account.

Specific metadata parameters

  • metadata[account_uid]

  • metadata[comparator] Determines if the selected account has to be compared to the total expenses or to the turnover (= total revenue - total expenses) - expenses | turnover - Default = expenses


GET https://api-impac.maestrano.com/api/v1/widgets/accounts/payable_receivable
Responses200
Body
{
  "organizations": [
    "org-abcd",
    "org-qwer"
  ],
  "values": {
    "payables": [
      4587.32,
      4187.54,
      4058.45
    ],
    "receivables": [
      5871.33,
      5487.66,
      5369.24
    ]
  },
  "currency": "EUR",
  "dates": [
    "2015-01-01",
    "2015-02-01",
    "2015-02-14"
  ],
  "hist_parameters": {
    "from": "2015-01-01",
    "to": "2015-02-14",
    "period": "MONTHLY"
  }
}

Payable / Receivable
GET/widgets/accounts/payable_receivable

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


GET https://api-impac.maestrano.com/api/v1/widgets/accounts/profit_and_loss
Responses200
Body
{
  "organizations": [
    "org-fbba"
  ],
  "hist_parameters": {
    "mode": "current",
    "number_of_periods": 3,
    "from": "2015-09-30",
    "to": "2015-11-12",
    "period": "MONTHLY"
  },
  "dates": [
    "2015-09-30",
    "2015-10-31",
    "2015-11-12"
  ],
  "summary": [
    {
      "name": "income",
      "currency": "EUR",
      "totals": [
        2703.42,
        3155.87,
        0
      ],
      "accounts": [
        {
          "id": "623fdc01-5f53-0133-2abb-6c3be58b7a6a",
          "name": "Sales",
          "totals": [
            609.65,
            795.05,
            0
          ],
          "currency": "EUR"
        },
        {}
      ]
    },
    {
      "name": "operating_expenses",
      "currency": "EUR",
      "totals": [
        10578.75,
        12252.95,
        0
      ],
      "accounts": [
        {
          "id": "62a44321-5f53-0133-2ad3-6c3be58b7a6a",
          "name": "Advertising",
          "totals": [
            2272.73,
            0,
            0
          ],
          "currency": "AUD"
        },
        {}
      ]
    },
    {}
  ]
}

Profit and Loss
GET/widgets/accounts/profit_and_loss

Standard PnL report, returning the accounts balances evolution within a given time range, ordered by account type.


Invoicing

GET https://api-impac.maestrano.com/api/v1/widgets/invoices/aged_payables_receivables
Responses200
Body
{
  "organizations": [
    "org-fcjn"
  ],
  "hist_parameters": {
    "from": "2016-01-01",
    "to": "2016-03-21",
    "period": "MONTHLY"
  },
  "dates": [
    " < Dec 2015*",
    "2016-01-31",
    "2016-02-29",
    "2016-03-21"
  ],
  "payables": {
    "name": "aged_payables",
    "totals": [
      0,
      115.73,
      1428.12,
      1994.96
    ],
    "suppliers": [
      {
        "id": "26458361-ced1-0133-d8e1-067b07dedccd",
        "name": "Central Copiers",
        "totals": [
          0,
          115.73,
          0,
          0
        ],
        "currency": "USD"
      },
      {
        "id": "24f312b0-ced1-0133-d8be-067b07dedccd",
        "name": "Heritage Trust",
        "totals": [
          0,
          0,
          0,
          100.05
        ],
        "currency": "USD"
      },
      {
        "id": "21fa6c31-ced1-0133-d86c-067b07dedccd",
        "name": "SMART Agency",
        "totals": [
          0,
          0,
          1428.12,
          1894.91
        ],
        "currency": "USD"
      }
    ],
    "currency": "USD"
  },
  "receivables": {
    "name": "aged_receivables",
    "totals": [
      181.95,
      0,
      -43.2,
      3611.36
    ],
    "customers": [
      {
        "id": "256869d1-ced1-0133-d8cc-067b07dedccd",
        "name": "Basket Case",
        "totals": [
          0,
          0,
          0,
          693.19
        ],
        "currency": "USD"
      },
      {
        "id": "259ce751-ced1-0133-d8d2-067b07dedccd",
        "name": "City Limousines",
        "totals": [
          181.95,
          0,
          -43.2,
          0
        ],
        "currency": "USD"
      },
      {
        "id": "271d6cd1-ced1-0133-d8f3-067b07dedccd",
        "name": "DIISR - Small Business Services",
        "totals": [
          0,
          0,
          0,
          2918.17
        ],
        "currency": "USD"
      }
    ],
    "currency": "USD"
  }
}

Aged Payables and Receivables
GET/widgets/invoices/aged_payables_receivables

Decomposition and comparison of your aged payables and receivables by customers and suppliers, for a selected a period of time.


GET https://api-impac.maestrano.com/api/v1/widgets/invoices/list
Responses200
Body
{
  "organizations": [
    "org-fcjn"
  ],
  "entities": [
    {
      "id": "1e3f38f1-ced1-0133-d7f8-067b07dedccd",
      "name": "Bank West",
      "total_invoiced": 1474.54,
      "total_paid": 1474.54,
      "total_due": 0,
      "invoices": [
        {
          "uid": "34f4f941-ced1-0133-d982-067b07dedccd",
          "reference": "",
          "transaction_no": "ORC1005",
          "invoice_date": "2015-12-31",
          "due_date": "2016-01-10",
          "status": "PAID",
          "invoiced": 400.31,
          "due": 0,
          "paid": 400.31,
          "currency": "USD",
          "tooltip_status": "paid"
        },
        {
          "uid": "3797b7a1-ced1-0133-d9da-067b07dedccd",
          "reference": "",
          "transaction_no": "ORC1006",
          "invoice_date": "2015-12-23",
          "due_date": "2016-01-05",
          "status": "PAID",
          "invoiced": 1074.23,
          "due": 0,
          "paid": 1074.23,
          "currency": "USD",
          "tooltip_status": "paid"
        }
      ],
      "currency": "USD",
      "original_currency": "AUD"
    },
    {
      "id": "256869d1-ced1-0133-d8cc-067b07dedccd",
      "name": "Basket Case",
      "total_invoiced": 699.63,
      "total_paid": 0,
      "total_due": 699.63,
      "invoices": [
        {
          "uid": "42239b81-ced1-0133-db1e-067b07dedccd",
          "reference": "",
          "transaction_no": "ORC1036",
          "invoice_date": "2016-03-18",
          "due_date": "2016-03-28",
          "status": "AUTHORISED",
          "invoiced": 699.63,
          "due": 699.63,
          "paid": 0,
          "currency": "USD",
          "tooltip_status": "due"
        }
      ],
      "currency": "USD",
      "original_currency": "AUD"
    }
  ],
  "total_invoiced": 2174.17,
  "total_due": 699.63,
  "total_paid": 1474.54
}

List
GET/widgets/invoices/list

Returns the list of all invoiced customers or suppliers, with their invoices. Invoices type (suppliers or customers invoices) can be specified as a parameters, as well as the sorting (see Parameters below).

Only invoices with status equal to AUTHORISED, SUBMITTED, PAID, or DRAFT in Connec! will be returned.

For information, in the front-end, Impac! is re-estimating the invoices statuses, based on their balance:

  • When the balance is 0, the invoice is considered PAID.

  • When the balance is greater than 0 but lower than the total invoiced amount, the invoice is considered PARTIALLY PAID.

  • When the balance is equal to the total invoiced amount, the invoice is considered DUE.

  • When the invoice status is DRAFT, the invoice is considered as being a draft, whatever the balance is.

Specific metadata parameters

  • metadata[entity] - customers | suppliers - Default = customers

  • metadata[order_by] - total_invoiced | total_due | total_paid | name - Default = name


GET https://api-impac.maestrano.com/api/v1/widgets/invoices/summary
Responses200
Body
{
  "organizations": [
    "org-fcjn"
  ],
  "summary": [
    {
      "name": "DIISR - Small Business Services",
      "currency": "USD",
      "total": 9549.94
    },
    {
      "name": "Ridgeway University",
      "currency": "USD",
      "total": 4585.54
    },
    {
      "name": "Petrie McLoud Watson & Associates",
      "currency": "USD",
      "total": 4412.13
    },
    {
      "name": "Others",
      "total": 21325.06,
      "currency": "USD"
    }
  ],
  "legend": "Summary of your customers, ordered by total invoiced amount",
  "chart_filter": {
    "criteria": "number",
    "value": 3,
    "max": 20,
    "entity_type": "customers",
    "filter_label": "total invoiced amount"
  }
}

Summary
GET/widgets/invoices/summary

Returns the top customers or suppliers, ordered by total_invoiced, total_paid or total_due amounts. The conditions applied are the same as per Invoices list.

This widget engine is returning a dataset that can be easily represented into a pie chart. For example, if the parameter metadata[chart_filter] = {criteria: 'number', value: 3} is specified, the engine is supposed to return the top-3 customers ordered by total invoiced amount. The engine is going to sum all the other customers invoiced amounts to a total placed in a 4th item named “Others”.

Specific metadata parameters

  • metadata[entity] - customers | suppliers - Default = customers

  • metadata[order_by] - total_invoiced | total_due | total_paid - Default = total_invoiced

  • metadata[chart_filters]


HR

GET https://api-impac.maestrano.com/api/v1/widgets/hr/employee_details
Responses200
Body
{
  "content": {
    "organizations": [
      "org-fciz",
      "org-fc7i"
    ],
    "employees": [
      {
        "full_name": "Odette Garrison",
        "gender": "FEMALE",
        "hired_date": "2015-03-05",
        "pay_schedule_id": "d6cfd4f1-d2e2-0133-bb7e-05d98b7421b7",
        "work_locations": [],
        "opening_balances": [
          {
            "id": "56f2319a95ff94a3551aa145",
            "status": "ACTIVE",
            "type": "EARNINGS",
            "name": "Ordinary Hours",
            "pay_item_id": "d7e51580-d2e2-0133-bb84-05d98b7421b7",
            "amount": 10000
          },
          {
            "id": "56f2319a95ff94a3551aa146",
            "status": "ACTIVE",
            "type": "SUPER",
            "amount": 900,
            "contribution_type": "SGC"
          },
          {
            "id": "56f2319a95ff94a3551aa147",
            "status": "ACTIVE",
            "type": "SUPER",
            "amount": 500,
            "contribution_type": "SGC"
          },
          {
            "id": "56f2319a95ff94a3551aa148",
            "status": "ACTIVE",
            "type": "LEAVE",
            "name": "Annual Leave",
            "pay_item_id": "d81cc740-d2e2-0133-bbb9-05d98b7421b7",
            "units": 20
          },
          {
            "id": "56f2319a95ff94a3551aa149",
            "status": "ACTIVE",
            "type": "LEAVE",
            "name": "Personal/Carer's Leave",
            "pay_item_id": "d82c7ec1-d2e2-0133-bbc6-05d98b7421b7",
            "units": 6
          }
        ],
        "current_balances": [
          {
            "id": "56f2319a95ff94a3551aa14f",
            "status": "ACTIVE",
            "type": "LEAVE",
            "name": "Annual Leave",
            "pay_item_id": "d81cc740-d2e2-0133-bbb9-05d98b7421b7",
            "units": 27.06,
            "type_of_units": "Hours"
          },
          {
            "id": "56f2319a95ff94a3551aa150",
            "status": "ACTIVE",
            "type": "LEAVE",
            "name": "Personal/Carer's Leave",
            "pay_item_id": "d82c7ec1-d2e2-0133-bbc6-05d98b7421b7",
            "units": 6,
            "type_of_units": "Hours"
          }
        ],
        "created_at": "2016-03-23T05:06:00Z",
        "updated_at": "2016-03-23T05:27:22Z",
        "company_currency": "AUD",
        "company": "Bazbar",
        "address": "224 Coffee St, Melbourne VIC 3000, Australia",
        "email": "ogg@madeup.email.com",
        "phone": "9000 1234",
        "salary": {
          "for_period": "YEARLY",
          "amount": 29238.96,
          "currency": "USD"
        },
        "uid": "db9cc650-d2e2-0133-bbe9-05d98b7421b7",
        "firstname": "Odette",
        "lastname": "Garrison",
        "dob": "1978-04-17",
        "location": "-",
        "supervisor": "-",
        "employment_status": "-",
        "note": "-"
      },
      {
        "full_name": "Oliver Gray",
        "gender": "MALE",
        "hired_date": "2015-06-02",
        "pay_schedule_id": "d6ca2fa1-d2e2-0133-bb7a-05d98b7421b7",
        "work_locations": [],
        "opening_balances": [
          {
            "id": "56f2319d95ff94a3551aa155",
            "status": "ACTIVE",
            "type": "SUPER",
            "amount": 600,
            "contribution_type": "SGC"
          }
        ],
        "current_balances": [
          {
            "id": "56f2319d95ff94a3551aa157",
            "status": "ACTIVE",
            "type": "LEAVE",
            "name": "Annual Leave",
            "pay_item_id": "d81cc740-d2e2-0133-bbb9-05d98b7421b7",
            "units": 11.66,
            "type_of_units": "Hours"
          },
          {
            "id": "56f2319d95ff94a3551aa158",
            "status": "ACTIVE",
            "type": "LEAVE",
            "name": "Personal/Carer's Leave",
            "pay_item_id": "d82c7ec1-d2e2-0133-bbc6-05d98b7421b7",
            "units": 5.83,
            "type_of_units": "Hours"
          }
        ],
        "created_at": "2016-03-23T05:06:01Z",
        "updated_at": "2016-03-23T05:30:14Z",
        "company_currency": "AUD",
        "company": "Bazbar",
        "address": "234 King St, Melbourne VIC 3000, Australia",
        "email": "og@madeup.email.com",
        "phone": "0401 123 456",
        "salary": {
          "for_period": "YEARLY",
          "amount": 45350.23,
          "currency": "USD"
        },
        "uid": "dc953000-d2e2-0133-bbee-05d98b7421b7",
        "firstname": "Oliver",
        "lastname": "Gray",
        "dob": "1968-11-25",
        "location": "-",
        "supervisor": "-",
        "employment_status": "-",
        "note": "-"
      }
    ]
  }
}

Employee Details
GET/widgets/hr/employee_details

Returns a list of all employees personal & financial details for the organization(s) within a specified time period. This is used by Impac! front-end to display details of a selected employee.


GET https://api-impac.maestrano.com/api/v1/widgets/hr/employees_list
Responses200
Body
{
  "content": {
    "organizations": [
      "org-fciz",
      "org-fc7i"
    ],
    "total": {
      "period": "YEARLY",
      "employees": 6,
      "average_rate": 39002.18,
      "currency": "USD"
    },
    "employees": [
      {
        "full_name": "Odette Garrison",
        "gender": "FEMALE",
        "hired_date": "2015-03-05",
        "pay_schedule_id": "d6cfd4f1-d2e2-0133-bb7e-05d98b7421b7",
        "work_locations": [],
        "opening_balances": [
          {
            "id": "56f2319a95ff94a3551aa145",
            "status": "ACTIVE",
            "type": "EARNINGS",
            "name": "Ordinary Hours",
            "pay_item_id": "d7e51580-d2e2-0133-bb84-05d98b7421b7",
            "amount": 10000
          },
          {
            "id": "56f2319a95ff94a3551aa146",
            "status": "ACTIVE",
            "type": "SUPER",
            "amount": 900,
            "contribution_type": "SGC"
          },
          {
            "id": "56f2319a95ff94a3551aa147",
            "status": "ACTIVE",
            "type": "SUPER",
            "amount": 500,
            "contribution_type": "SGC"
          },
          {
            "id": "56f2319a95ff94a3551aa148",
            "status": "ACTIVE",
            "type": "LEAVE",
            "name": "Annual Leave",
            "pay_item_id": "d81cc740-d2e2-0133-bbb9-05d98b7421b7",
            "units": 20
          },
          {
            "id": "56f2319a95ff94a3551aa149",
            "status": "ACTIVE",
            "type": "LEAVE",
            "name": "Personal/Carer's Leave",
            "pay_item_id": "d82c7ec1-d2e2-0133-bbc6-05d98b7421b7",
            "units": 6
          }
        ],
        "current_balances": [
          {
            "id": "56f2319a95ff94a3551aa14f",
            "status": "ACTIVE",
            "type": "LEAVE",
            "name": "Annual Leave",
            "pay_item_id": "d81cc740-d2e2-0133-bbb9-05d98b7421b7",
            "units": 27.06,
            "type_of_units": "Hours"
          },
          {
            "id": "56f2319a95ff94a3551aa150",
            "status": "ACTIVE",
            "type": "LEAVE",
            "name": "Personal/Carer's Leave",
            "pay_item_id": "d82c7ec1-d2e2-0133-bbc6-05d98b7421b7",
            "units": 6,
            "type_of_units": "Hours"
          }
        ],
        "created_at": "2016-03-23T05:06:00Z",
        "updated_at": "2016-03-23T05:27:22Z",
        "company_currency": "AUD",
        "company": "Bazbar",
        "address": "224 Coffee St, Melbourne VIC 3000, Australia",
        "email": "ogg@madeup.email.com",
        "phone": "9000 1234",
        "salary": {
          "for_period": "YEARLY",
          "amount": 29238.96,
          "currency": "USD"
        },
        "uid": "db9cc650-d2e2-0133-bbe9-05d98b7421b7",
        "firstname": "Odette",
        "lastname": "Garrison",
        "dob": "1978-04-17",
        "location": "-",
        "supervisor": "-",
        "employment_status": "-",
        "note": "-"
      },
      {
        "full_name": "Oliver Gray",
        "gender": "MALE",
        "hired_date": "2015-06-02",
        "pay_schedule_id": "d6ca2fa1-d2e2-0133-bb7a-05d98b7421b7",
        "work_locations": [],
        "opening_balances": [
          {
            "id": "56f2319d95ff94a3551aa155",
            "status": "ACTIVE",
            "type": "SUPER",
            "amount": 600,
            "contribution_type": "SGC"
          }
        ],
        "current_balances": [
          {
            "id": "56f2319d95ff94a3551aa157",
            "status": "ACTIVE",
            "type": "LEAVE",
            "name": "Annual Leave",
            "pay_item_id": "d81cc740-d2e2-0133-bbb9-05d98b7421b7",
            "units": 11.66,
            "type_of_units": "Hours"
          },
          {
            "id": "56f2319d95ff94a3551aa158",
            "status": "ACTIVE",
            "type": "LEAVE",
            "name": "Personal/Carer's Leave",
            "pay_item_id": "d82c7ec1-d2e2-0133-bbc6-05d98b7421b7",
            "units": 5.83,
            "type_of_units": "Hours"
          }
        ],
        "created_at": "2016-03-23T05:06:01Z",
        "updated_at": "2016-03-23T05:30:14Z",
        "company_currency": "AUD",
        "company": "Bazbar",
        "address": "234 King St, Melbourne VIC 3000, Australia",
        "email": "og@madeup.email.com",
        "phone": "0401 123 456",
        "salary": {
          "for_period": "YEARLY",
          "amount": 45350.23,
          "currency": "USD"
        },
        "uid": "dc953000-d2e2-0133-bbee-05d98b7421b7",
        "firstname": "Oliver",
        "lastname": "Gray",
        "dob": "1968-11-25",
        "location": "-",
        "supervisor": "-",
        "employment_status": "-",
        "note": "-"
      }
    ]
  }
}

Employees List
GET/widgets/hr/employees_list

Returns a list of all employees personal & financial details for the organization(s) within a specified time period, also calculating totals containing “period”, “employees” count, “average_rate” amount, and “currency”.


GET https://api-impac.maestrano.com/api/v1/widgets/hr/leaves_balance
Responses200
Body
{
  "content": {
    "organizations": [
      "org-fciz",
      "org-fc7i"
    ],
    "hist_parameters": {
      "from": "2016-01-01",
      "to": "2016-03-23",
      "period": "YEARLY"
    },
    "dates": [],
    "employees": [
      {
        "uid": "db9cc650-d2e2-0133-bbe9-05d98b7421b7",
        "firstname": "Odette",
        "lastname": "Garrison",
        "leaves": [
          {
            "name": "Annual Leave",
            "units": 27.06,
            "type_of_units": "Hours"
          },
          {
            "name": "Personal/Carer's Leave",
            "units": 6,
            "type_of_units": "Hours"
          }
        ]
      },
      {
        "uid": "dc953000-d2e2-0133-bbee-05d98b7421b7",
        "firstname": "Oliver",
        "lastname": "Gray",
        "leaves": [
          {
            "name": "Annual Leave",
            "units": 11.66,
            "type_of_units": "Hours"
          },
          {
            "name": "Personal/Carer's Leave",
            "units": 5.83,
            "type_of_units": "Hours"
          }
        ]
      }
    ]
  }
}

Leaves Balance
GET/widgets/hr/leaves_balance

Returns employees annual & personal leave balances. Impac! front-end uses this to display leave balances of a selected employee.


GET https://api-impac.maestrano.com/api/v1/widgets/hr/payroll_summary
Responses200
Body
{
  "content": {
    "organizations": [
      "org-fciz",
      "org-fc7i"
    ],
    "hist_parameters": {
      "from": "2016-01-01",
      "to": "2016-03-23",
      "period": "MONTHLY"
    },
    "dates": [
      "2016-01-31",
      "2016-02-29",
      "2016-03-23"
    ],
    "summary": [
      {
        "name": "total_earnings",
        "totals": [
          0,
          7780.19,
          12679.74
        ],
        "currency": "USD",
        "employees": [
          {
            "id": "total_earnings-dec110c1-d2e2-0133-bbf9-05d98b7421b7",
            "name": "Michaels Sonia",
            "currency": "USD",
            "totals": [
              0,
              0,
              0
            ]
          },
          {
            "id": "total_earnings-dc953000-d2e2-0133-bbee-05d98b7421b7",
            "name": "Gray Oliver",
            "currency": "USD",
            "totals": [
              0,
              1628.05,
              3478.92
            ]
          },
          {
            "id": "total_earnings-da753641-d2e2-0133-bbe2-05d98b7421b7",
            "name": "Lebron James",
            "currency": "USD",
            "totals": [
              0,
              1095.54,
              2341.02
            ]
          }
        ]
      },
      {
        "name": "total_leaves",
        "totals": [
          0,
          39.72,
          63.78
        ],
        "currency": "h",
        "employees": [
          {
            "id": "total_leaves-dec110c1-d2e2-0133-bbf9-05d98b7421b7",
            "name": "Michaels Sonia",
            "currency": "h",
            "totals": [
              0,
              0,
              0
            ]
          },
          {
            "id": "total_leaves-dc953000-d2e2-0133-bbee-05d98b7421b7",
            "name": "Gray Oliver",
            "currency": "h",
            "totals": [
              0,
              8.75,
              17.49
            ]
          },
          {
            "id": "total_leaves-da753641-d2e2-0133-bbe2-05d98b7421b7",
            "name": "Lebron James",
            "currency": "h",
            "totals": [
              0,
              8.75,
              17.49
            ]
          }
        ]
      },
      {
        "name": "total_super",
        "totals": [
          0,
          790.57,
          1349.39
        ],
        "currency": "USD",
        "employees": [
          {
            "id": "total_super-dec110c1-d2e2-0133-bbf9-05d98b7421b7",
            "name": "Michaels Sonia",
            "currency": "USD",
            "totals": [
              0,
              0,
              0
            ]
          },
          {
            "id": "total_super-dc953000-d2e2-0133-bbee-05d98b7421b7",
            "name": "Gray Oliver",
            "currency": "USD",
            "totals": [
              0,
              143.95,
              307.6
            ]
          },
          {
            "id": "total_super-da753641-d2e2-0133-bbe2-05d98b7421b7",
            "name": "Lebron James",
            "currency": "USD",
            "totals": [
              0,
              134.3,
              286.98
            ]
          }
        ]
      },
      {
        "name": "total_deductions",
        "totals": [
          0,
          35.7,
          76.28
        ],
        "currency": "USD",
        "employees": [
          {
            "id": "total_deductions-dec110c1-d2e2-0133-bbf9-05d98b7421b7",
            "name": "Michaels Sonia",
            "currency": "USD",
            "totals": [
              0,
              0,
              0
            ]
          },
          {
            "id": "total_deductions-dc953000-d2e2-0133-bbee-05d98b7421b7",
            "name": "Gray Oliver",
            "currency": "USD",
            "totals": [
              0,
              28.56,
              61.03
            ]
          },
          {
            "id": "total_deductions-da753641-d2e2-0133-bbe2-05d98b7421b7",
            "name": "Lebron James",
            "currency": "USD",
            "totals": [
              0,
              7.14,
              15.25
            ]
          }
        ]
      },
      {
        "name": "total_reimbursement",
        "totals": [
          0,
          0,
          0
        ],
        "currency": "USD",
        "employees": [
          {
            "id": "total_reimbursement-dec110c1-d2e2-0133-bbf9-05d98b7421b7",
            "name": "Michaels Sonia",
            "currency": "USD",
            "totals": [
              0,
              0,
              0
            ]
          },
          {
            "id": "total_reimbursement-dc953000-d2e2-0133-bbee-05d98b7421b7",
            "name": "Gray Oliver",
            "currency": "USD",
            "totals": [
              0,
              0,
              0
            ]
          },
          {
            "id": "total_reimbursement-da753641-d2e2-0133-bbe2-05d98b7421b7",
            "name": "Lebron James",
            "currency": "USD",
            "totals": [
              0,
              0,
              0
            ]
          }
        ]
      },
      {
        "name": "total_tax",
        "totals": [
          0,
          1718,
          2814
        ],
        "currency": "USD",
        "employees": [
          {
            "id": "total_tax-dec110c1-d2e2-0133-bbf9-05d98b7421b7",
            "name": "Michaels Sonia",
            "currency": "USD",
            "totals": [
              0,
              0,
              0
            ]
          },
          {
            "id": "total_tax-dc953000-d2e2-0133-bbee-05d98b7421b7",
            "name": "Gray Oliver",
            "currency": "USD",
            "totals": [
              0,
              438,
              876
            ]
          },
          {
            "id": "total_tax-da753641-d2e2-0133-bbe2-05d98b7421b7",
            "name": "Lebron James",
            "currency": "USD",
            "totals": [
              0,
              178,
              356
            ]
          }
        ]
      },
      {
        "name": "total_timeoff",
        "totals": [
          0,
          0,
          0
        ],
        "currency": "h",
        "employees": [
          {
            "id": "total_timeoff-dec110c1-d2e2-0133-bbf9-05d98b7421b7",
            "name": "Michaels Sonia",
            "currency": "h",
            "totals": [
              0,
              0,
              0
            ]
          },
          {
            "id": "total_timeoff-dc953000-d2e2-0133-bbee-05d98b7421b7",
            "name": "Gray Oliver",
            "currency": "h",
            "totals": [
              0,
              0,
              0
            ]
          },
          {
            "id": "total_timeoff-da753641-d2e2-0133-bbe2-05d98b7421b7",
            "name": "Lebron James",
            "currency": "h",
            "totals": [
              0,
              0,
              0
            ]
          }
        ]
      }
    ]
  }
}

Payroll Summary
GET/widgets/hr/payroll_summary

Returns summaries across these 5 categories: “Total Earnings”, “Total Leaves Accruals”, “Total Superannuation Accruals”, “Total Deductions”, “Total Reimbursements”, “Total Taxes”, “Total Time Off” containing totals broken up by employees of given organization(s).

This data is used by Impac! front-end to provide a comparison of your payroll costs across a given time period, displayed using a Pie Chart for comparing totals, and a Line Chart for comparing totals across the time period.


GET https://api-impac.maestrano.com/api/v1/widgets/hr/payroll_taxes
Responses200
Body
{
  "content": {
    "organizations": [
      "org-fciz",
      "org-fc7i"
    ],
    "hist_parameters": {
      "from": "2016-01-01",
      "to": "2016-03-23",
      "period": "MONTHLY"
    },
    "dates": [
      "2016-01-31",
      "2016-02-29",
      "2016-03-23"
    ],
    "total_tax": [
      0,
      1718,
      2814
    ],
    "currency": "USD"
  }
}

Payroll Taxes
GET/widgets/hr/payroll_taxes

Sum of all the taxes paid across the given organization(s) workforce costs within a given time range. The engine calculates and sums each employees total tax value, for each statement period.


GET https://api-impac.maestrano.com/api/v1/widgets/hr/salaries_summary
Responses200
Body
{
  "content": {
    "organizations": [
      "org-fciz",
      "org-fc7i"
    ],
    "total": {
      "period": "YEARLY",
      "employees": 5,
      "average_rate": 39002.18,
      "currency": "USD"
    },
    "summary": {
      "filter": "gender",
      "data": [
        {
          "label": "FEMALE",
          "value": 39714.6,
          "currency": "AUD"
        },
        {
          "label": "MALE",
          "value": 37933.54,
          "currency": "AUD"
        }
      ]
    }
  }
}

Salaries Summary
GET/widgets/hr/salaries_summary

Representation of the average salaries of employees for given organization(s), filtered by “gender”, “Age Range”, “Job Title”, “Time In Company” and by a metadata[period]. Impac! front-end reports totals and displays the summary data in a Bar Chart.

Specific metadata parameters

metadata[filter] Determines which filter is to be applied to the summary calculations - gender | age_range | job_title | time_in_company


GET https://api-impac.maestrano.com/api/v1/widgets/hr/superannuation_accruals
Responses200
Body
{
  "content": {
    "organizations": [
      "org-fciz",
      "org-fc7i"
    ],
    "hist_parameters": {
      "from": "2016-01-01",
      "to": "2016-03-23",
      "period": "YEARLY"
    },
    "dates": [],
    "employees": [
      {
        "uid": "db9cc650-d2e2-0133-bbe9-05d98b7421b7",
        "firstname": "Odette",
        "lastname": "Garrison",
        "total_super": 81340,
        "currency": "USD"
      },
      {
        "uid": "dc953000-d2e2-0133-bbee-05d98b7421b7",
        "firstname": "Oliver",
        "lastname": "Gray",
        "total_super": 25456.51,
        "currency": "USD"
      }
    ]
  }
}

Superannuation Accruals
GET/widgets/hr/superannuation_accruals

Returns total superannuation sum for each of the organization(s) employees over a given time period.


GET https://api-impac.maestrano.com/api/v1/widgets/hr/timesheets
Responses200
Body
{
  "content": {
    "organizations": [
      "org-fciz",
      "org-fc7i"
    ],
    "hist_parameters": {
      "from": "2016-01-01",
      "to": "2016-03-23",
      "period": "MONTHLY"
    },
    "dates": [
      "2016-01-31",
      "2016-03-23"
    ],
    "employees": [
      {
        "id": "dec110c1-d2e2-0133-bbf9-05d98b7421b7",
        "firstname": "Sonia",
        "lastname": "Michaels",
        "total_time_worked": 166,
        "total_time_off": 0
      },
      {
        "id": "dc953000-d2e2-0133-bbee-05d98b7421b7",
        "firstname": "Oliver",
        "lastname": "Gray",
        "total_time_worked": 440,
        "total_time_off": 55
      }
    ]
  }
}

Timesheets
GET/widgets/hr/timesheets

Returns total hours worked and not worked for each of the organization(s) employees over a given time period.


GET https://api-impac.maestrano.com/api/v1/widgets/hr/workforce_summary
Responses200
Body
{
  "content": {
    "organizations": [
      "org-fciz",
      "org-fc7i"
    ],
    "total": {
      "period": "YEARLY",
      "employees": 5,
      "amount": 195010.88,
      "currency": "USD"
    },
    "summary": {
      "filter": "gender",
      "data": [
        {
          "label": "FEMALE",
          "value": 119143.8,
          "currency": "AUD"
        },
        {
          "label": "MALE",
          "value": 75867.08,
          "currency": "AUD"
        }
      ]
    }
  }
}

Workforce Summary
GET/widgets/hr/workforce_summary

Representation of the average salaries of employees for given organization(s), filtered by “gender”, “Age Range”, “Job Title”, “Salary Range” and by a metadata[period]. Impac! front-end reports totals and displays the summary data in a Pie Chart.

Specific metadata parameters

metadata[filter] Determines which filter is to be applied to the summary calculations - gender | age_range | job_title | salary_range


Sales

GET https://api-impac.maestrano.com/api/v1/widgets/sales/aged
Responses200
Body
{
  "content": {
    "organizations": [
      "org-fbcf"
    ],
    "dates": [
      "2016-01-31",
      "2016-02-29",
      "2016-03-16"
    ],
    "aged_sales": {
      "quantity_sold": [
        33,
        0,
        0
      ],
      "gross_value_sold": [
        1068.62,
        0,
        0
      ],
      "net_value_sold": [
        971.47,
        0,
        0
      ]
    },
    "currency": "USD"
  }
}

Aged
GET/widgets/sales/aged

History of your sales through a specified period of time.


GET https://api-impac.maestrano.com/api/v1/widgets/sales/break_even
Responses200
Body
{
  "content": {
    "sales": {
      "to_date": 30261.56,
      "target": 20000
    },
    "break_even": {
      "variance": -10261.560000000001,
      "projected_date": "2016-03-17",
      "opportunities_to_close": 0,
      "eligible_opportunities": 4
    },
    "currency": "USD",
    "period": {
      "from": "2016-01-01",
      "to": "2016-03-17"
    }
  }
}

Break Even
GET/widgets/sales/break_even

Amount of sales missing to break-even target, and estimated date at which the break-even will happen.

Specific metadata parameters

  • metadata[criteria] Determines whether the break-even value has to be calculated based on gross sales (including taxes) or net sales (excluding taxes) - gross | net - Default = gross

  • metadata[threshold] Decimal value representing the sales target at which the break-even point is going to be met. Example: metadata[threshold]=150000.00 for a sales target of $150,000 on the chosen period.


GET https://api-impac.maestrano.com/api/v1/widgets/sales/comparison
Responses200
Body
{
  "content": {
    "organizations": [
      "org-fbcf"
    ],
    "sales_comparison": [
      {
        "name": "Demo Data - Total",
        "totals": {
          "quantity_sold": [
            33,
            0,
            0
          ],
          "gross_value_sold": [
            1068.62,
            0,
            0
          ],
          "net_value_sold": [
            971.47,
            0,
            0
          ]
        },
        "currency": "USD",
        "sales": [
          {
            "currency": "USD",
            "id": "a40dd5c1-a14c-0133-c13b-245e60d776b1",
            "name": "IT2",
            "totals": {
              "quantity_sold": [
                18,
                0,
                0
              ],
              "gross_value_sold": [
                718.92,
                0,
                0
              ],
              "net_value_sold": [
                653.56,
                0,
                0
              ]
            }
          },
          {
            "currency": "USD",
            "id": "a411a651-a14c-0133-c13c-245e60d776b1",
            "name": "IT3",
            "totals": {
              "quantity_sold": [
                11,
                0,
                0
              ],
              "gross_value_sold": [
                197.78,
                0,
                0
              ],
              "net_value_sold": [
                179.8,
                0,
                0
              ]
            }
          }
        ]
      }
    ],
    "dates": [
      "2016-01-31",
      "2016-02-29",
      "2016-03-16"
    ],
    "filter": "gross_value_sold",
    "criteria": null
  }
}

Comparison
GET/widgets/sales/comparison

Compare the evolution of your sales and order by chosen criteria.

Specific metadata parameters

  • metadata[criteria] Determines if the sales summary has to be sorted by products, customers, etc. - product | customer | location | industry - Default = product

  • metadata[filter] Determines which amount type is to be retrieved - quantity_sold | gross_value_sold | net_value_sold - Default = gross_value_sold


GET https://api-impac.maestrano.com/api/v1/widgets/sales/customer_details
Responses200
Body
{
  "content": {
    "total_invoiced": 2365.06,
    "total_paid": 1068.62,
    "total_due": 1296.44,
    "customers": [
      {
        "name": "Bailey-Kirlin",
        "email": "faustino_monahan@towne.info",
        "phone": "(891) 530-5478",
        "website": "http://kaulke.org/wilton.lebsack",
        "currency": "USD",
        "contact": "Jadyn Wunsch",
        "total_due": 57.92,
        "total_paid": 0,
        "total_invoiced": 57.92,
        "original_currency": "USD",
        "country": "US",
        "city": "Clevelandstad",
        "full_address": "173 Schuppe Way, Suite 949, Clevelandstad Oklahoma 73148-5447, US",
        "uid": "a373dfb1-a14c-0133-c117-245e60d776b1"
      },
      {
        "name": "Batz and Sons",
        "email": "golden.nader@connellymante.info",
        "phone": "594-038-5606",
        "website": "http://lakinschmeler.biz/hayley",
        "currency": "USD",
        "contact": "Katharina Mayer",
        "total_due": 0,
        "total_paid": 95.9,
        "total_invoiced": 95.9,
        "original_currency": "USD",
        "country": "US",
        "city": "Lake Gene",
        "full_address": "964 Corkery Gardens, Apt. 494, Lake Gene Maryland 42252, US",
        "uid": "a2a06311-a14c-0133-c0ec-245e60d776b1"
      }
    ],
    "from": "2016-01-01",
    "to": "2016-03-16",
    "organizations": [
      "org-fbcf"
    ]
  }
}

Customer Details
GET/widgets/sales/customer_details

All the details corresponding to a selected customer.


GET https://api-impac.maestrano.com/api/v1/widgets/sales/cycle
Responses200
This response has no content.

Cycle
GET/widgets/sales/cycle

Shows how much time (average) leads stay at a each status

Specific metadata parameters

  • metadata[threshold_sec] Decimal value representing minimum time (in seconds) during which a Lead has to be at a certain status for it to be considered in the cycle calculation. Example: metadata[threshold_sec] = 86400 will consider only the lead statuses that have been assigned to leads during at least one day - Default = 1300.

  • metadata[unit] Determines which time unit has to be used to display how much time a lead stayed at a given status - HOURS | DAYS | WEEKS | MONTHS - Default = DAYS.

  • metadata[keep_blanks] Determines whether leads with blank status have to be considered in the cycle calculation - Default = false.

  • metadata[debug] Displays additional information - Default = false.


GET https://api-impac.maestrano.com/api/v1/widgets/sales/forecast
Responses200
Body
{
  "content": {
    "dates": [
      "2015-09-30",
      "2015-10-31",
      "2015-11-30",
      "2015-12-31",
      "2016-01-31",
      "2016-02-29",
      "2016-03-31",
      "2016-04-30",
      "2016-05-31",
      "2016-06-30",
      "2016-07-31",
      "2016-08-31"
    ],
    "totals": [
      0,
      6040.65,
      9393.43,
      26972.7,
      26811.48,
      19909.45,
      7690678.029999999,
      0,
      0,
      0,
      0,
      0
    ],
    "opportunities": [
      [],
      [],
      [],
      [],
      [],
      [],
      [
        {
          "_id": "e591c6f1-ce38-0133-bed6-067b07dedccd",
          "created_at": "2016-03-17 06:39:18 UTC",
          "updated_at": "2016-03-17 06:49:16 UTC",
          "channel_id": "org-fc7i",
          "assignee_type": "Entity::AppUser",
          "assignee_id": "a03f69e0-cbd0-0133-25ab-067b07dedccd",
          "code": "POT1",
          "name": "Cool guy",
          "probability": "0.0",
          "sales_stage": "Prospecting",
          "expected_close_date": "2016-03-19 06:49:16 UTC",
          "amount": {
            "amount": 22630.54,
            "currency": "USD"
          },
          "sales_stage_changes": [
            {
              "_id": "56ea5116780569281e000001",
              "created_at": "2016-03-17 06:39:18 UTC",
              "updated_at": "2016-03-17 06:39:18 UTC",
              "status": "Prospecting"
            }
          ],
          "assignee": "Branden Cash"
        },
        {
          "_id": "24c4abd1-ce39-0133-bedf-067b07dedccd",
          "created_at": "2016-03-17 06:41:03 UTC",
          "updated_at": "2016-03-17 06:48:53 UTC",
          "channel_id": "org-fc7i",
          "assignee_type": "Entity::AppUser",
          "assignee_id": "a03f69e0-cbd0-0133-25ab-067b07dedccd",
          "code": "POT3",
          "name": "Daniel Eberhard",
          "probability": "0.0",
          "sales_stage": "Prospecting",
          "expected_close_date": "2016-03-28 06:48:52 UTC",
          "amount": {
            "amount": 37717.57,
            "currency": "USD"
          },
          "sales_stage_changes": [
            {
              "_id": "56ea517f780569281e00000d",
              "created_at": "2016-03-17 06:41:03 UTC",
              "updated_at": "2016-03-17 06:41:03 UTC",
              "status": "Prospecting"
            }
          ],
          "assignee": "Branden Cash"
        },
        {
          "_id": "62cf9931-ce3e-0133-c165-067b07dedccd",
          "created_at": "2016-03-17 07:18:35 UTC",
          "updated_at": "2016-03-17 07:19:00 UTC",
          "channel_id": "org-fc7i",
          "assignee_type": "Entity::AppUser",
          "assignee_id": "a03f69e0-cbd0-0133-25ab-067b07dedccd",
          "code": "POT4",
          "name": "Hasip Nazario",
          "probability": "0.0",
          "sales_stage": "Closed Won",
          "expected_close_date": "2016-03-31 07:18:59 UTC",
          "amount": {
            "amount": 7543514.76,
            "currency": "USD"
          },
          "sales_stage_changes": [
            {
              "_id": "56ea5a4b7805695678000001",
              "created_at": "2016-03-17 07:18:35 UTC",
              "updated_at": "2016-03-17 07:18:35 UTC",
              "status": "Qualification"
            },
            {
              "_id": "56ea5a5f7805695678000007",
              "created_at": "2016-03-17 07:18:55 UTC",
              "updated_at": "2016-03-17 07:18:55 UTC",
              "status": "Closed Won"
            }
          ],
          "assignee": "Branden Cash"
        },
        {
          "_id": "13599861-ce39-0133-beda-067b07dedccd",
          "created_at": "2016-03-17 06:40:34 UTC",
          "updated_at": "2016-03-17 06:49:02 UTC",
          "channel_id": "org-fc7i",
          "assignee_type": "Entity::AppUser",
          "assignee_id": "a03f69e0-cbd0-0133-25ab-067b07dedccd",
          "code": "POT2",
          "name": "Ted Cornell",
          "probability": "0.0",
          "sales_stage": "Qualification",
          "expected_close_date": "2016-03-30 06:49:02 UTC",
          "amount": {
            "amount": 75435.14,
            "currency": "USD"
          },
          "sales_stage_changes": [
            {
              "_id": "56ea5162780569281e000007",
              "created_at": "2016-03-17 06:40:34 UTC",
              "updated_at": "2016-03-17 06:40:34 UTC",
              "status": "Qualification"
            }
          ],
          "assignee": "Branden Cash"
        }
      ],
      [],
      [],
      [],
      [],
      []
    ],
    "period": {
      "from": "2015-09-01",
      "to": "2016-08-31"
    },
    "currency": "USD"
  }
}

Forecast
GET/widgets/sales/forecast

Returns an aggregation of your sales over the last 6 months and the projection of your sales over the 6 months to come, based on your opportunities.

Opportunities will have to have an expected amount and an expected close date for the widget engine to be able to retrieve them.

Specific metadata parameters

  • metadata[criteria] Determines whether the past sales have to be calculated based on gross sales (including taxes) or net sales (excluding taxes) - gross | net - Default = gross

GET https://api-impac.maestrano.com/api/v1/widgets/sales/growth
Responses200
Body
{
  "content": {
    "organizations": [
      "org-fbcf"
    ],
    "dates": [
      "2016-01-31",
      "2016-02-29",
      "2016-03-17"
    ],
    "summary": [
      {
        "id": "a40dd5c1-a14c-0133-c13b-245e60d776b1",
        "name": "Kincrome 24oz Steel Claw Hammer",
        "currency": "USD",
        "company": "Demo Data",
        "code": "Demo Data - IT2",
        "totals": [
          718.92,
          0,
          0
        ]
      },
      {
        "id": "a411a651-a14c-0133-c13c-245e60d776b1",
        "name": "Trojan 600g Brick Hammer",
        "currency": "USD",
        "company": "Demo Data",
        "code": "Demo Data - IT3",
        "totals": [
          197.78,
          0,
          0
        ]
      }
    ],
    "filter": "gross_value_sold",
    "hist_parameters": {
      "from": "2016-01-01",
      "to": "2016-03-17",
      "period": "MONTHLY"
    },
    "product": null
  }
}

Growth
GET/widgets/sales/growth

Sales growth for a given product.

Specific metadata parameters

  • metadata[filter] Determines which amount type is to be retrieved - quantity_purchased | quantity_sold | gross_value_purchased | net_value_purchased | gross_value_sold | net_value_sold - Default = gross_value_sold

  • metadata[product] Uid of the selected product. Informational - not needed as the growth of all products is going to be retrieved in the returned value :summary.


GET https://api-impac.maestrano.com/api/v1/widgets/sales/leads_funnel
Responses200
Body
{
  "content": {
    "leads_per_status": {
      "unknown": 2,
      "Contacted": {
        "total": 1,
        "leads": [
          {
            "_id": "3740e121-ce39-0133-bee9-067b07dedccd",
            "created_at": "2016-03-17 06:41:35 UTC",
            "updated_at": "2016-03-17 07:40:35 UTC",
            "code": "LEA2",
            "last_name": "Guanting",
            "full_name": "Guanting",
            "lead_status": "Contacted",
            "status": "ACTIVE",
            "assignee_type": "Entity::AppUser",
            "assignee_id": "a03f69e0-cbd0-0133-25ab-067b07dedccd",
            "lead_status_changes": [
              {
                "_id": "56ea519e780569281e000035",
                "created_at": "2016-03-17 06:41:34 UTC",
                "updated_at": "2016-03-17 06:41:34 UTC",
                "status": ""
              },
              {
                "_id": "56ea5301780569281e000057",
                "created_at": "2016-03-17 06:47:29 UTC",
                "updated_at": "2016-03-17 06:47:29 UTC",
                "status": "Hot"
              },
              {
                "_id": "56ea5f737805695ed700000e",
                "created_at": "2016-03-17 07:40:35 UTC",
                "updated_at": "2016-03-17 07:40:35 UTC",
                "status": "Contacted"
              }
            ],
            "assignee": "Branden Cash",
            "source_company": "Demo Data"
          }
        ]
      },
      "Cold": {
        "total": 1,
        "leads": [
          {
            "_id": "305fdcd1-ce39-0133-bee4-067b07dedccd",
            "created_at": "2016-03-17 06:41:24 UTC",
            "updated_at": "2016-03-17 07:41:48 UTC",
            "code": "LEA1",
            "last_name": "Taniel",
            "full_name": "Taniel",
            "lead_status": "Cold",
            "status": "ACTIVE",
            "assignee_type": "Entity::AppUser",
            "assignee_id": "a03f69e0-cbd0-0133-25ab-067b07dedccd",
            "lead_status_changes": [
              {
                "_id": "56ea5194780569281e000013",
                "created_at": "2016-03-17 06:41:24 UTC",
                "updated_at": "2016-03-17 06:41:24 UTC",
                "status": ""
              },
              {
                "_id": "56ea530d780569281e000064",
                "created_at": "2016-03-17 06:47:41 UTC",
                "updated_at": "2016-03-17 06:47:41 UTC",
                "status": "Contacted"
              },
              {
                "_id": "56ea5fbb780569eb57000012",
                "created_at": "2016-03-17 07:41:47 UTC",
                "updated_at": "2016-03-17 07:41:47 UTC",
                "status": "Cold"
              }
            ],
            "assignee": "Branden Cash",
            "source_company": "Demo Data"
          }
        ]
      }
    },
    "from": "2016-01-01",
    "to": "2016-03-17"
  }
}

Leads Funnel
GET/widgets/sales/leads_funnel

Sales funnel based on your leads status.


GET https://api-impac.maestrano.com/api/v1/widgets/sales/leads_list
Responses200
Body
{
  "content": {
    "statistics": {
      "converted": [
        0
      ],
      "lost": [
        0
      ],
      "total": [
        4
      ]
    },
    "leads": [
      {
        "_id": "b4b6d300-ce41-0133-2e19-067b07dedccd",
        "created_at": "2016-03-17 07:42:22 UTC",
        "updated_at": "2016-03-17 07:42:22 UTC",
        "code": "LEA4",
        "last_name": "Clive",
        "full_name": "Clive",
        "lead_status": "-",
        "status": "ACTIVE",
        "assignee_type": "Entity::AppUser",
        "assignee_id": "a03f69e0-cbd0-0133-25ab-067b07dedccd",
        "lead_status_changes": [
          {
            "_id": "56ea5fdd780569eb57000038",
            "created_at": "2016-03-17 07:42:21 UTC",
            "updated_at": "2016-03-17 07:42:21 UTC",
            "status": ""
          }
        ],
        "assignee": "Branden Cash",
        "source_company": "Demo Data"
      },
      {
        "_id": "aafd8161-ce41-0133-2e14-067b07dedccd",
        "created_at": "2016-03-17 07:42:05 UTC",
        "updated_at": "2016-03-17 07:42:05 UTC",
        "code": "LEA3",
        "last_name": "Sophus",
        "full_name": "Sophus",
        "lead_status": "-",
        "status": "ACTIVE",
        "assignee_type": "Entity::AppUser",
        "assignee_id": "a03f69e0-cbd0-0133-25ab-067b07dedccd",
        "lead_status_changes": [
          {
            "_id": "56ea5fcd780569eb57000016",
            "created_at": "2016-03-17 07:42:05 UTC",
            "updated_at": "2016-03-17 07:42:05 UTC",
            "status": ""
          }
        ],
        "assignee": "Branden Cash",
        "source_company": "Demo Data"
      }
    ],
    "dates": [
      "2026-03-18"
    ],
    "from": "2006-03-18",
    "to": "2026-03-18",
    "organizations": [
      "org-fciz",
      "org-fc7i"
    ]
  }
}

Leads List
GET/widgets/sales/leads_list

Listing of your current leads.


GET https://api-impac.maestrano.com/api/v1/widgets/sales/list
Responses200
Body
{
  "content": {
    "organizations": [
      "org-fbcf"
    ],
    "summary": [
      {
        "name": "Demo Data",
        "total": 1068.62,
        "currency": "USD",
        "products": [
          {
            "id": "a40dd5c1-a14c-0133-c13b-245e60d776b1",
            "name": "Kincrome 24oz Steel Claw Hammer",
            "currency": "USD",
            "code": "IT2",
            "company": "Demo Data",
            "total": 718.92
          },
          {
            "id": "a411a651-a14c-0133-c13c-245e60d776b1",
            "name": "Trojan 600g Brick Hammer",
            "currency": "USD",
            "code": "IT3",
            "company": "Demo Data",
            "total": 197.78
          }
        ]
      }
    ],
    "filter": "gross_value_sold",
    "hist_parameters": {
      "from": "2016-01-01",
      "to": "2016-03-17",
      "period": "RANGE"
    }
  }
}

List
GET/widgets/sales/list

Detailed list of all your products sales.

Specific metadata parameters

  • metadata[criteria] Determines if the sales summary has to be sorted by products, customers, etc. - product | customer | location | industry - Default = product

  • metadata[filter] Determines which amount type is to be retrieved. - quantity_purchased | quantity_sold | gross_value_purchased | net_value_purchased | gross_value_sold | net_value_sold - Default = gross_value_sold


GET https://api-impac.maestrano.com/api/v1/widgets/sales/margin
Responses200
Body
{
  "content": {
    "dates": [
      "2016-01-31",
      "2016-02-29",
      "2016-03-17"
    ],
    "sales": [
      {
        "name": "Kincrome 24oz Steel Claw Hammer",
        "code": "IT2",
        "id": "a40dd5c1-a14c-0133-c13b-245e60d776b1",
        "company": "Demo Data",
        "currency": "USD",
        "quantity_purchased": [
          8,
          0,
          0
        ],
        "quantity_sold": [
          18,
          0,
          0
        ],
        "gross_value_purchased": [
          319.52,
          0,
          0
        ],
        "net_value_purchased": [
          290.47,
          0,
          0
        ],
        "gross_value_sold": [
          718.92,
          0,
          0
        ],
        "net_value_sold": [
          653.56,
          0,
          0
        ]
      }
    ],
    "currency": "USD",
    "from": "2016-01-01",
    "to": "2016-03-17",
    "margins": {
      "gross": [
        639.2,
        0,
        0
      ],
      "net": [
        581.09,
        0,
        0
      ]
    },
    "organizations": [
      "org-fbcf"
    ]
  }
}

Margin
GET/widgets/sales/margin

Sales gross margin, corresponding to the difference between value sold and value purchased.


GET https://api-impac.maestrano.com/api/v1/widgets/sales/net_sales
Responses200
Body
{
  "content": {
    "organizations": [
      "org-fbcf"
    ],
    "currency": "USD",
    "sales": [
      {
        "total": 2365.06,
        "trans_count": 37,
        "avg": 63.92
      }
    ],
    "returns": [
      {
        "total": 0,
        "trans_count": 0,
        "avg": 0
      }
    ],
    "net_result": [
      {
        "total": 2365.06,
        "trans_count": 37,
        "avg": 63.92
      }
    ]
  }
}

Net Sales
GET/widgets/sales/net_sales

Difference between total sales and returns from your customers.


GET https://api-impac.maestrano.com/api/v1/widgets/sales/new_vs_existing_customers
Responses200
Body
{
  "content": {
    "summary": {
      "customers_count": {
        "total": 37,
        "new": 4,
        "existing": 33
      },
      "total_sales": {
        "total": 2365.06,
        "new": 159.76,
        "existing": 2205.3
      },
      "transactions_count": {
        "total": 37,
        "new": 4,
        "existing": 33
      }
    }
  }
}

New vs Existing Customers
GET/widgets/sales/new_vs_existing_customers

Compare new and existing customers from within a time range.


GET https://api-impac.maestrano.com/api/v1/widgets/sales/number_of_leads
Responses200
Body
{
  "content": {
    "number_of_leads": {
      "converted": [
        0,
        0
      ],
      "lost": [
        0,
        0
      ],
      "total": [
        0,
        4
      ]
    },
    "dates": [
      "2016-02-29",
      "2016-03-18"
    ],
    "organizations": [
      "org-fciz",
      "org-fc7i"
    ]
  }
}

Number of Leads
GET/widgets/sales/number_of_leads

The number of converted, lost, and total leads you had for the last period.

Specific metadata parameters

  • metadata[hist_parameters] - Only period key will be applied, with any valid period except HOURLY

GET https://api-impac.maestrano.com/api/v1/widgets/sales/opportunities_funnel
Responses200
Body
{
  "content": {
    "opps_per_sales_stage": {
      "Prospecting": {
        "total": 2,
        "opps": [
          {
            "_id": "24c4abd1-ce39-0133-bedf-067b07dedccd",
            "created_at": "2016-03-17 06:41:03 UTC",
            "updated_at": "2016-03-17 06:48:53 UTC",
            "channel_id": "org-fc7i",
            "assignee_type": "Entity::AppUser",
            "assignee_id": "a03f69e0-cbd0-0133-25ab-067b07dedccd",
            "code": "POT3",
            "name": "Daniel Eberhard",
            "probability": "0.0",
            "sales_stage": "Prospecting",
            "expected_close_date": "2016-03-28 06:48:52 UTC",
            "amount": {
              "amount": 37717.57,
              "currency": "USD"
            },
            "sales_stage_changes": [
              {
                "_id": "56ea517f780569281e00000d",
                "created_at": "2016-03-17 06:41:03 UTC",
                "updated_at": "2016-03-17 06:41:03 UTC",
                "status": "Prospecting"
              }
            ],
            "assignee": "Branden Cash"
          },
          {
            "_id": "e591c6f1-ce38-0133-bed6-067b07dedccd",
            "created_at": "2016-03-17 06:39:18 UTC",
            "updated_at": "2016-03-17 06:49:16 UTC",
            "channel_id": "org-fc7i",
            "assignee_type": "Entity::AppUser",
            "assignee_id": "a03f69e0-cbd0-0133-25ab-067b07dedccd",
            "code": "POT1",
            "name": "Cool guy",
            "probability": "0.0",
            "sales_stage": "Prospecting",
            "expected_close_date": "2016-03-19 06:49:16 UTC",
            "amount": {
              "amount": 22630.54,
              "currency": "USD"
            },
            "sales_stage_changes": [
              {
                "_id": "56ea5116780569281e000001",
                "created_at": "2016-03-17 06:39:18 UTC",
                "updated_at": "2016-03-17 06:39:18 UTC",
                "status": "Prospecting"
              }
            ],
            "assignee": "Branden Cash"
          }
        ]
      },
      "Qualification": {
        "total": 1,
        "opps": [
          {
            "_id": "13599861-ce39-0133-beda-067b07dedccd",
            "created_at": "2016-03-17 06:40:34 UTC",
            "updated_at": "2016-03-17 06:49:02 UTC",
            "channel_id": "org-fc7i",
            "assignee_type": "Entity::AppUser",
            "assignee_id": "a03f69e0-cbd0-0133-25ab-067b07dedccd",
            "code": "POT2",
            "name": "Ted Cornell",
            "probability": "0.0",
            "sales_stage": "Qualification",
            "expected_close_date": "2016-03-30 06:49:02 UTC",
            "amount": {
              "amount": 75435.14,
              "currency": "USD"
            },
            "sales_stage_changes": [
              {
                "_id": "56ea5162780569281e000007",
                "created_at": "2016-03-17 06:40:34 UTC",
                "updated_at": "2016-03-17 06:40:34 UTC",
                "status": "Qualification"
              }
            ],
            "assignee": "Branden Cash"
          }
        ]
      },
      "Closed Won": {
        "total": 1,
        "opps": [
          {
            "_id": "62cf9931-ce3e-0133-c165-067b07dedccd",
            "created_at": "2016-03-17 07:18:35 UTC",
            "updated_at": "2016-03-17 07:19:00 UTC",
            "channel_id": "org-fc7i",
            "assignee_type": "Entity::AppUser",
            "assignee_id": "a03f69e0-cbd0-0133-25ab-067b07dedccd",
            "code": "POT4",
            "name": "Hasip Nazario",
            "probability": "0.0",
            "sales_stage": "Closed Won",
            "expected_close_date": "2016-03-31 07:18:59 UTC",
            "amount": {
              "amount": 7543514.76,
              "currency": "USD"
            },
            "sales_stage_changes": [
              {
                "_id": "56ea5a4b7805695678000001",
                "created_at": "2016-03-17 07:18:35 UTC",
                "updated_at": "2016-03-17 07:18:35 UTC",
                "status": "Qualification"
              },
              {
                "_id": "56ea5a5f7805695678000007",
                "created_at": "2016-03-17 07:18:55 UTC",
                "updated_at": "2016-03-17 07:18:55 UTC",
                "status": "Closed Won"
              }
            ],
            "assignee": "Branden Cash"
          }
        ]
      }
    }
  }
}

Opportunities Funnel
GET/widgets/sales/opportunities_funnel

Sales funnel based on your opportunities sales stage


GET https://api-impac.maestrano.com/api/v1/widgets/sales/performance
Responses200
Body
{
  "content": {
    "assignees": [
      {
        "name": "Branden Cash",
        "total_won": 7543514.76,
        "win_ratio": 100,
        "totals": [
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          7543514.76
        ],
        "win_ratios": [
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          100
        ],
        "opportunities": [
          {
            "_id": "62cf9931-ce3e-0133-c165-067b07dedccd",
            "created_at": "2016-03-17 07:18:35 UTC",
            "updated_at": "2016-03-17 07:19:00 UTC",
            "channel_id": "org-fc7i",
            "assignee_type": "Entity::AppUser",
            "assignee_id": "a03f69e0-cbd0-0133-25ab-067b07dedccd",
            "code": "POT4",
            "name": "Hasip Nazario",
            "probability": "0.0",
            "sales_stage": "Closed Won",
            "expected_close_date": "2016-03-31 07:18:59 UTC",
            "amount": {
              "amount": 7543514.76,
              "currency": "USD"
            },
            "sales_stage_changes": [
              {
                "_id": "56ea5a4b7805695678000001",
                "created_at": "2016-03-17 07:18:35 UTC",
                "updated_at": "2016-03-17 07:18:35 UTC",
                "status": "Qualification"
              },
              {
                "_id": "56ea5a5f7805695678000007",
                "created_at": "2016-03-17 07:18:55 UTC",
                "updated_at": "2016-03-17 07:18:55 UTC",
                "status": "Closed Won"
              }
            ],
            "assignee": "Branden Cash"
          }
        ]
      }
    ],
    "statistics": {
      "total_won": 7543514.76,
      "average_win_ratio": 100
    },
    "dates": [
      "2015-03-01",
      "2015-04-01",
      "2015-05-01",
      "2015-06-01",
      "2015-07-01",
      "2015-08-01",
      "2015-09-01",
      "2015-10-01",
      "2015-11-01",
      "2015-12-01",
      "2016-01-01",
      "2016-02-01",
      "2016-03-18"
    ]
  }
}

Performance
GET/widgets/sales/performance

Comparison of the performance of your accounts managers and sales teams.


GET https://api-impac.maestrano.com/api/v1/widgets/sales/segmented_turnover
Responses200
Body
{
  "content": {
    "organizations": [
      "org-fbcf"
    ],
    "hist_parameters": {
      "from": "2016-01-01",
      "to": "2016-03-17",
      "period": "MONTHLY"
    },
    "ranges": [
      {
        "label": "17.98-22.38",
        "value": 197.78,
        "percentage": 18.51
      },
      {
        "label": "22.38-26.78",
        "value": 0,
        "percentage": 0
      },
      {
        "label": "26.78-31.18",
        "value": 0,
        "percentage": 0
      },
      {
        "label": "31.18-35.58",
        "value": 0,
        "percentage": 0
      },
      {
        "label": "35.58-39.94",
        "value": 870.84,
        "percentage": 81.49
      }
    ],
    "currency": "USD",
    "dates": [
      "2016-01-31",
      "2016-03-17"
    ],
    "filter": "gross"
  }
}

Segmented Turnover
GET/widgets/sales/segmented_turnover

Decomposition of your turnover per product average price.

Specific metadata parameters

  • metadata[filter] Determines whether the gross (including taxes) or net (excluding taxes) sales have to be used to determine the turnover segmentation. - net | gross - Default = gross

GET https://api-impac.maestrano.com/api/v1/widgets/sales/summary
Responses200
Body
{
  "content": {
    "organizations": [
      "org-fbcf"
    ],
    "summary": [
      {
        "id": "a411a651-a14c-0133-c13c-245e60d776b1",
        "name": "Trojan 600g Brick Hammer",
        "currency": "USD",
        "code": "IT3",
        "company": "Demo Data",
        "total": 197.78
      },
      {
        "id": "others",
        "name": "Others",
        "code": "Others",
        "total": 151.92,
        "currency": "USD"
      }
    ],
    "filter": "gross_value_sold",
    "chart_filter": {
      "criteria": "percentage",
      "value": 80,
      "max": 3,
      "entity_type": "products",
      "filter_label": "gross_value_sold"
    },
    "hist_parameters": {
      "from": "2016-01-01",
      "to": "2016-03-17",
      "period": "RANGE"
    }
  }
}

Summary
GET/widgets/sales/summary

Sales summary by criteria prepared for a pie chart display.

Specific metadata parameters

  • metadata[criteria] Determines if the sales summary has to be sorted by products, customers, etc. - product | customer | location | industry - Default = product

  • metadata[filter] Determines which amount type is to be retrieved. - quantity_purchased | quantity_sold | gross_value_purchased | net_value_purchased | gross_value_sold | net_value_sold - Default = gross_value_sold


GET https://api-impac.maestrano.com/api/v1/widgets/sales/top_opportunities
Responses200
Body
{
  "content": {
    "opportunities": [
      {
        "_id": "24c4abd1-ce39-0133-bedf-067b07dedccd",
        "created_at": "2016-03-17 06:41:03 UTC",
        "updated_at": "2016-03-17 06:48:53 UTC",
        "channel_id": "org-fc7i",
        "assignee_type": "Entity::AppUser",
        "assignee_id": "a03f69e0-cbd0-0133-25ab-067b07dedccd",
        "code": "POT3",
        "name": "Daniel Eberhard",
        "probability": "0.0",
        "sales_stage": "Prospecting",
        "expected_close_date": "2016-03-28 06:48:52 UTC",
        "amount": {
          "amount": 37717.57,
          "currency": "USD"
        },
        "sales_stage_changes": [
          {
            "_id": "56ea517f780569281e00000d",
            "created_at": "2016-03-17 06:41:03 UTC",
            "updated_at": "2016-03-17 06:41:03 UTC",
            "status": "Prospecting"
          }
        ],
        "assignee": "Branden Cash"
      },
      {
        "_id": "13599861-ce39-0133-beda-067b07dedccd",
        "created_at": "2016-03-17 06:40:34 UTC",
        "updated_at": "2016-03-17 06:49:02 UTC",
        "channel_id": "org-fc7i",
        "assignee_type": "Entity::AppUser",
        "assignee_id": "a03f69e0-cbd0-0133-25ab-067b07dedccd",
        "code": "POT2",
        "name": "Ted Cornell",
        "probability": "0.0",
        "sales_stage": "Qualification",
        "expected_close_date": "2016-03-30 06:49:02 UTC",
        "amount": {
          "amount": 75435.14,
          "currency": "USD"
        },
        "sales_stage_changes": [
          {
            "_id": "56ea5162780569281e000007",
            "created_at": "2016-03-17 06:40:34 UTC",
            "updated_at": "2016-03-17 06:40:34 UTC",
            "status": "Qualification"
          }
        ],
        "assignee": "Branden Cash"
      }
    ],
    "total_potential": 0,
    "currency": "USD",
    "eligible_opportunities": 3
  }
}

Top Opportunities
GET/widgets/sales/top_opportunities

List of your top opportunities, based on close probability and expected close date.

Specific metadata parameters

  • metadata[threshold] Determines how many opportunities have to be returned. Default = 5

Generated by aglio on 12 Apr 2018