Trendsic Platform Service

<back to all web services

FinanceRequest

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/dashboard/finance
"use strict";
export class DashboardStatTile {
    /** @param {{Key?:string,Label?:string,Value?:number,PreviousValue?:number,Unit?:string,DeltaPct?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    Key;
    /** @type {string} */
    Label;
    /** @type {number} */
    Value;
    /** @type {?number} */
    PreviousValue;
    /** @type {string} */
    Unit;
    /** @type {?number} */
    DeltaPct;
}
export class DashboardSeriesPoint {
    /** @param {{Label?:string,Value?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    Label;
    /** @type {number} */
    Value;
}
export class DashboardSeries {
    /** @param {{Name?:string,Points?:DashboardSeriesPoint[]}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    Name;
    /** @type {DashboardSeriesPoint[]} */
    Points = [];
}
export class FinanceLocationRow {
    /** @param {{LocationName?:string,ServiceRev?:number,ProductRev?:number,SubscriptionRev?:number,Total?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    LocationName;
    /** @type {number} */
    ServiceRev;
    /** @type {number} */
    ProductRev;
    /** @type {number} */
    SubscriptionRev;
    /** @type {number} */
    Total;
}
export class FinanceTopRow {
    /** @param {{Name?:string,Revenue?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    Name;
    /** @type {number} */
    Revenue;
}
export class FinanceSubscriptionInfo {
    /** @param {{Mrr?:number,Arr?:number,ActiveCount?:number,NewCount?:number,ChurnedCount?:number,ChurnRatePct?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    Mrr;
    /** @type {number} */
    Arr;
    /** @type {number} */
    ActiveCount;
    /** @type {number} */
    NewCount;
    /** @type {number} */
    ChurnedCount;
    /** @type {number} */
    ChurnRatePct;
}
export class FinanceResponse {
    /** @param {{ResponseStatus?:ResponseStatus,Stats?:DashboardStatTile[],Trend?:DashboardSeries[],SourceMix?:DashboardSeries,ByLocation?:FinanceLocationRow[],TopServices?:FinanceTopRow[],TopProducts?:FinanceTopRow[],Subscriptions?:FinanceSubscriptionInfo}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {ResponseStatus} */
    ResponseStatus;
    /** @type {DashboardStatTile[]} */
    Stats = [];
    /** @type {DashboardSeries[]} */
    Trend = [];
    /** @type {DashboardSeries} */
    SourceMix;
    /** @type {FinanceLocationRow[]} */
    ByLocation = [];
    /** @type {FinanceTopRow[]} */
    TopServices = [];
    /** @type {FinanceTopRow[]} */
    TopProducts = [];
    /** @type {FinanceSubscriptionInfo} */
    Subscriptions;
}
export class FinanceRequest {
    /** @param {{FromDate?:string,ToDate?:string,LocationIds?:string[]}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    FromDate;
    /** @type {string} */
    ToDate;
    /** @type {string[]} */
    LocationIds = [];
}

JavaScript FinanceRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/dashboard/finance HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	FromDate: 0001-01-01,
	ToDate: 0001-01-01,
	LocationIds: 
	[
		00000000000000000000000000000000
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	},
	Stats: 
	[
		{
			Key: String,
			Label: String,
			Value: 0,
			PreviousValue: 0,
			Unit: String
		}
	],
	Trend: 
	[
		{
			Name: String,
			Points: 
			[
				{
					Label: String,
					Value: 0
				}
			]
		}
	],
	SourceMix: 
	{
		Name: String,
		Points: 
		[
			{
				Label: String,
				Value: 0
			}
		]
	},
	ByLocation: 
	[
		{
			LocationName: String,
			ServiceRev: 0,
			ProductRev: 0,
			SubscriptionRev: 0,
			Total: 0
		}
	],
	TopServices: 
	[
		{
			Name: String,
			Revenue: 0
		}
	],
	TopProducts: 
	[
		{
			Name: String,
			Revenue: 0
		}
	],
	Subscriptions: 
	{
		Mrr: 0,
		Arr: 0,
		ActiveCount: 0,
		NewCount: 0,
		ChurnedCount: 0,
		ChurnRatePct: 0
	}
}