Precision API

Getting Started

The current version of the API lives at  Screenshot 2021-12-13 at 16.44.33.png

The easiest way to start using our API is by finding an HTTP client online. We would recommend using Postman, or Paw as they are ready-to-use, free tools.

In our demo we are going to use Postman.

Endpoints Summary

EndpointWhat it does
/clientsReturns a list of Clients
/clients/{clientId}Returns details of a specific Client
/clients/{clientId}/activity-statsReturns Activity Stats metrics for a specific Client

Authentication

In order to get data out, you must pass an authorization token in the request header:

Request Header:Authorization: Bearer <your token>

To generate a token please use the following instructions:

In Precision head to “Your Settings” and under the API tab generate your token.

Screenshot 2021-10-22 at 17.07.58.png

WARNING:

Store the token securely and do not share it with anyone else.

For example, to use your token in Postman, select bearer token as your authentication method and copy your given token into the correct field. See below:

postman.png

Rate Limits

A rate limit restricts the number of API requests a consumer can make within a given time period. If this limit is exceeded the consumer will be throttled and API requests will fail.
Dext Precision Rate Limits are set to 60 requests/minute.
If you exceed your rate limit allowance your request will be rejected. An HTTP 429 (Too Many Requests) response will be returned.
Dext Precision returns rate limit details in the header of API responses to allow consumers to monitor their API usage.
Example response header:

KeyValue
DateThu, 30 Jan 2020 16:27:15 GMT
Content-Typeapplication/json
Connectionkeep-alive
Servercloudflare
X-RateLimit-Limit60
X-RateLimit-Remaining42

Response Codes

200 – OK

A 200 status code indicates that the request was accepted and processed successfully.

404 – Not found

A 404 error status code indicates that the API can’t map the requested URI to a resource.

429 – Too many requests

A 429 error status code is returned when an API consumer hits our rate limits.

500 – Internal Server Error

A 500 error status code is a generic API server-side error response. Please contact our support team if this persists.

API Endpoints

GET /clients


The /clients endpoint returns a list of all Dext Precision clients that the given authentication token has access to, in a summarised format.

Request:https://api.xavier-analytics.com/clients

Response Content Type:application/JSON

Response Model:

[
    {
        "id": "string",
        "name": "string",
        "practiceCode": "string",
        "providerId": "string",
        "healthScore": integer,
        "alertLevel": "string"
    }
]

Example value:

example value.png

GET /clients/{clientId}


The /clients/{clientId} endpoint returns a detailed set of information about a particular client identified by the clientId, including some calculated metrics.

Request:https://api.xavier-analytics.com/clients/{clientId}

Response Content Type:application/JSON

Response Model:

{
    "id": "string",
    "name": "string",
    "providerId": "string",
    "practiceCode": "string",
    "organisationType": "string",
    "companyNumber": "string",
    "healthScore": integer,
    "alertLevel": "string",
    "hmrcStatus": "string",
    "yearEnd": "string",
    "vatDetails": {
        "scheme": "string",
        "number": "string",
        "reportingCycle": "string",
        "periodStart": "string",
        "periodEnd": "string"
    },
    "metrics": {
        "debtorBalance": float,
        "avgDebtorDays": integer,
        "oneDayImpact": float,
    },
    "bankReconciliation" : {
        "bankAccounts": integer,
        "manualFeeds": integer
    }
}

Example value:

example value2.png

GET /clients/{clientId}/activity-stats


The /clients/{clientId}/activity-stats endpoint returns the rolling annual and monthly-average Activity Stats for a particular client, identified by the clientId.

Request:https://api.xavier-analytics.com/clients/{clientId}/activity-stats

Response Content Type:application/JSON

Response Model:

{
    "annual": {
        "start": "string",
        "end": "string",
        "turnover": float,
        "salesCount": integer,
        "billsCount": integer,
        "creditsCount": integer,
        "manualJournalsCount": integer,
        "bankTransactionsCount": integer,
        "totalCount": integer,
        "turnoverChangeYoY": integer,
        "salesChangeYoY": integer,
        "billsChangeYoY": integer,
        "creditsChangeYoY": integer,
        "manualJournalsChangeYoY": integer,
        "bankTransactionsChangeYoY": integer,
        "totalChangeYoY": integer
    },
    "monthlyAverage": {
        "start": "string",
        "end": "string",
        "turnover": float,
        "salesCount": integer,
        "billsCount": integer,
        "creditsCount": integer,
        "manualJournalsCount": integer,
        "bankTransactionsCount": integer,
        "totalCount": integer,
        "turnoverChangeYoY": integer,
        "salesChangeYoY": integer,
        "billsChangeYoY": integer,
        "creditsChangeYoY": integer,
        "manualJournalsChangeYoY": integer,
        "bankTransactionsChangeYoY": integer,
        "totalChangeYoY": integer
    },
    "quarterlyAverage": {
        "start": "string",
        "end": "string",
        "turnover": float,
        "salesCount": integer,
        "billsCount": integer,
        "creditsCount": integer,
        "manualJournalsCount": integer,
        "bankTransactionsCount": integer,
        "totalCount": integer,
        "turnoverChangeMoM": integer,
        "salesChangeMoM": integer,
        "billsChangeMoM": integer,
        "creditsChangeMoM": integer,
        "manualJournalsChangeMoM": integer,
        "bankTransactionsChangeMoM": integer,
        "totalChangeMoM": integer,
        "turnoverChangeYoY": integer,
        "salesChangeYoY": integer,
        "billsChangeYoY": integer,
        "creditsChangeYoY": integer,
        "manualJournalsChangeYoY": integer,
        "bankTransactionsChangeYoY": integer,
        "totalChangeYoY": integer
    }
}

Example value:

example value3.png