Skip to main content

Generic KPI API

This document describes a 'reverse' web API that is to be provided to ITX to display custom information in the Contact Center's KPI panel. The displayed information is supposed to be a list of documents (e.g. orders or invoices) containing records about sold or bought products or services. However, the documents might contain arbitrary information. They just need to have the required structure.

The API is to respond to the requests similar to GET https://customer.api/rest/kpi?customerId={id} where {id} value is the identifier of a specific company. Exact URL / path is arbitrary and might contain other fixed parameters (e.g. authentication tokens) if needed. The response should be in JSON format of the structure described below.

It is supposed that the integration / synchronization between ITX and the external information system (whatever it is) was performed beforehand, so ITX already has information about companies' external identifiers. If so, ITX adds the {id} value corresponding to the currently opened company card to the request.

The API definition in OpenAPI (Swagger) format is provided and can be used with Swagger Codegen to generate server code stubs. The example response included in the definition is displayed in ITX like that:

Generic KPI block

Response format

NameTypeDescriptionNotes
sections[KpiSectionDTO]List of KPI panel sections.[optional]

KpiSectionDTO

NameTypeDescriptionNotes
titleStringSection title, like 'Orders' or 'Invoices'.
messageStringError or any other message for the section, like 'No data available'.[optional]
documents[KpiDocumentDTO]Documents to be shown in the panel. Documents are supposed to be of the kind represented by the section title.

KpiDocumentDTO

NameTypeDescriptionNotes
documentNumberStringUnique document identifier (number), mandatory.
documentDateDateDocument timestamp in ISO 8601 format, UTC timezone. Use yyyy-MM-dd'T'HH:mm:ss'Z' format.
externalUrlStringThe document's URL in an external system, e.g. in e-commerce.[optional]
trackingUrlStringThe corresponding URL in a logistics provider's system.[optional]
statusKpiStatusDTO[optional]
amountNumberOrder sum with .00 precision.[optional]
currencyStringOrder currency.[optional]
lines[KpiDocumentLineDTO]Document lines.[optional]
fields[KpiCustomFieldDTO]Custom fields.[optional]

KpiStatusDTO

NameTypeDescriptionNotes
nameStringStatus text.
colorCodeStringOne of the supported color codes. If absent, NORMAL is supposed.[optional]
updatedDateDateStatus modification timestamp in ISO 8601 format, UTC timezone. Use yyyy-MM-dd'T'HH:mm:ss'Z' format.[optional]

Color Codes

  • NORMAL
  • GREEN
  • ORANGE
  • RED

KpiDocumentLineDTO

NameTypeDescriptionNotes
nameStringItem (supposedly, a product or service) name.
quantityNumberTotal quantity bought or sold.[optional]
deliveredNumberDelivered quantity.[optional]
urlStringProduct or service URL in an external system, e.g. in e-commerce.[optional]
fields[KpiCustomFieldDTO]Custom fields[optional]
expandableFields[KpiExpandableDTO]Additional expandable info section.[optional]

KpiCustomFieldDTO

NameTypeDescriptionNotes
nameStringCustom field name. Nameless fields are allowed only in KpiDocumentDTO.[optional]
valueStringCustom field value.

KpiExpandableDTO

NameTypeDescriptionNotes
columns[String]Property names.
fields[KpiCustomFieldDTO]Custom fields.[optional]