Getting started

Get Access to API

Authentication

Making your first request

Guides

Generate Doc X-Ray

Generate Bank X-Ray

Generate Financial X-Ray

Generate ESG X-Ray

Generate Manager X-Ray

Concepts

Overview

Request

Reports

Medium

Doc X-Ray

Bank X-Ray

Financial X-Ray

ESG X-Ray

Manager X-Ray

Resources

API versioning

Webhooks

Uploading a media

Add a creator to your request

Risk Assessment x Bank X-Ray

<aside> ⚠️ WARNING In order to follow this guide, you will first need to get access to our API (Get Access to API) and be able to send requests using our Authentication method

</aside>

In this page, you will find a step-by-step guide that will walk you through the generation of a Bank X-Ray using the Risk Assessment API.

In this guide, you will generate your first Bank X-Ray using the following steps:


1. Create a request

For the first step of the analysis, create a request with a POST call to /requests

<aside> ℹ️ To learn how to assign this request to a specific user from an email address, consult : Add a creator to your request

</aside>

In the example below, all fields are mandatory except if mentioned otherwise:

POST /requests
{
  "code": {
    "type": "siren",
    "id": "514673987"
  }
}

The API will answer with additional fields on the request:

{
  "request": {
    "id": "[requestId]", // Unique ID of the request
    "code": {
      "type": "siren",
      "id": "514673987"
  }
  "status": "pending_analysis",
  "stage": "1.1",
  ...
  }
}

If you wish to re-fetch the data of a request, you can make a GET call to /requests/[id].

<aside> ℹ️ For more information about the requests end-points, please refer to the API reference (Request API Reference)

</aside>


2. Upload a media

The upload of a document is done in 3 steps:

  1. POST /media to our API with the type and metadata of the file you wish to send us. You will receive data needed to upload to S3.

    bank_statement, other
    
  2. Upload the file to AWS S3 using the data received from the previous step.

  3. Once the upload is successful, call POST /media/[id] to set the status to online and optionally add the period and date of the document.

To read a detailed step-by-step guide, please read Resource: Uploading a media

<aside> 📦 Note: The maximum allowed file size is 20MB.

</aside>

<aside> ℹ️ For more information about the allowed file formats, please refer to the API reference (Media API Reference)

</aside>


3. Retrieve Bank X-Ray

Once you have uploaded a media, our Bank X-Ray will be launched automatically and will return an analysis within a few minutes. However, if our OCR fails, we use an alternative extraction method that can take up to 48h.

To wait for the end of the request analysis, you have two options:

  1. Poll regularly the API to check when a new report is available; or
  2. Use webhooks to be notified when a new report has been created. (Our recommendation)

When the report has been created, refer to the cases below to know the next steps.

Polling the API

Make GET HTTP requests to /requests/[requestId] to receive the latest data of the request.

Make GET HTTP requests to /reports?source=bank_xray&request=[requestId] to receive the Bank X-Ray reports associated to the request

Using webhooks

<aside> 🪝 If you choose to use webhooks, start by checking out our Resource Webhooks

</aside>

We provide a webhook that will update you when a new report is generated:

{
  "event": "new_report",
  "requestId": "[requestId]",
  "reportId": "[reportId]"
}

After receiving webhooks, retrieve the data of the request or offer using the following GET HTTP calls:


4. Review the analysis

Once you have received the update using either the API calls or webhooks from the previous section, you can retrieve the Bank X-Ray report using the following GET HTTP call:

The API will answer with additional fields on the report:

{
  "report": {
    "id": "[reportId]",
    "request": "[requestId]",
    "source": "bank_xray",
    "raw": {
      "movementReport": {  // Movement overview of the information extracted from the bank statemetn
        "totalDebitAmount": {
        "period": 68226.41,
        "annualised": 803310.96
        },
        ...
      },
      "summary": [  // Summary of the information extracted from the bank statement
        { 
          "startDate": "2021-07-31",
          "endDate": "2021-08-31",
          "bic": "",
          "iban": null,
          "statementId": 1,
          "pageCount": 9,
          "startBalance": 166623.16,
          "endBalance": 262738.66,
          "totalCreditAmount": 164341.91,
          "totalDebitAmount": 68226.41,
          "movements": "correct"
        }
      ],
      "bankFlag": {
        "color": "red",  // Sentiment regarding the company bank statements
        "dataSanity": 100,
        "reasons": [  // List of criteria analysed    
          {
            "criteria": "missedSocialSecurity",
            "quantile": 100,
            "value": 1,
            "sentiment": "bad",
            "popovers": [
              "Social security assesses the company's regularity of payments, compliance with the social security administration's due dates, and correspondence with regulations."
            ]
          },
          ...
        ],
      },
      "riskClass": 4,  // Risk class associated with the bank statements going from 1-5, 1-Very good 5-Very Bad
      "score": 0.8,
      "allTransactions": [  // List of all the transaction extracted from the bank statements
        {		 
			    ...
        },
      ],
      ...
    }
  }
}

<aside> ℹ️ For more information about the reports end-points, please refer to the API reference (Report API Reference)

</aside>

Download a Bank X-Ray Report as a PDF through API

You can automatically download the Bank X-Ray report in PDF format through the API, which contains the same data as the PDF available in the front-end interface.

To perform the download, use the following endpoint:

This feature is available to users with the required permissions (same as for accessing reports): read_bank_xray_report.

The API result is as follows:

{
  "fileExtension": "pdf",
  "request": "61b1aaa1015c69003931e945",
  "report": "61baf58cb92353003b888c3d",
  "creation": "2021-12-16T08:15:08.000Z",
  "bankXrayPdfB64": "..."
}

Note: the call might take a while to respond.

← Previous

Guides: Generate Doc X-Ray

Next →

Guides: Generate Financial X-Ray