16. Skip to content

16. Integration flow: Digital profiles

This integration flow allows the creation of digital profiles in Trak.e from the entity's systems. In general, this integration is done from onboarding. Trak.e allows you to generate a partial profile and then complete its information as more information is collected from the end user. In some cases this is done by synchronizing a CRM or core system of the client at the end of the day or periodically. Both schemes are valid and supported by Trak.e.

It is essential to note that the information in the profile should be kept in sync between Trak.e and the system(s) that feed Trak.e. For example, if a user changes their address, economic activity or updates documentation. The same if in Trak.e it is totally or partially disabled due to an alert. For this second part, Trak.e provides a notification scheme based on callbacks.

 Integration Flow: Digital Profile

16.1 Integration Example

16.1.1 Step 1: Create a cabinet for the documents

In order to create a cabinet you should use cabinets service. The only required data is a name for the cabinet, which can be any string - this is no important. For example, the following requests creates a cabinet:

curl --request POST \
  --url https://api-dev.trake.io/doc/cabinet \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --data '{
    "name":"docs_dp_2039499639"
}'

16.1.2 Step 2: Create a Digital Profile

To create a digital profile, the minimum data required are name, tax_payer_id and person type. You should also include the identifier of the cabinet that will hold the digital profiles documents. For example, the following cURL allows you to create a legal person digital profile:

curl --request POST \
  --url https://api-dev.trake.io/dprofile/profile \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "Treviño S.A.",
    "tax_payer_id": "30993334444",
    "person_type": "legal_person",
    "documents": [
        "64dbbe98119dd4ef7da9908d"
    ]
}'

this example allows you to create a natural person digital profile:

curl --request POST \
  --url https://api-dev.trake.io/dprofile/profile \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "Nicolas Jesus Martinez",
    "tax_payer_id": "20394995675",
    "person_type": "natural_person",
    "documents": [
        "64dbbe98119dd4ef7da9908d"
    ]
}'

16.1.3 Step 3: Create a document

To create a document in a cabinet, you should use the Document Creation service. The identifier of the cabinet to which we desire to add the document is passed as a path parameter. The data you should send are a name for the document, and in the 'ref' field you should reference the identifier of the digital profile. For example:

curl --request POST \
  --url https://api-dev.trake.io/doc/cabinet/64dbbe98119dd4ef7da9908d/document \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --data '{
    "name" : "balance 2023",
    "ref": "64dbbe98119dd4ef7da9908d"
}'

16.1.4 Step 4: Upload files

To upload files to the documents, you should use the File Upload service. The files are uploaded via HTTP request with body multipart/form-data with a 'files' key to which the files are associated. For example:

curl --request PUT \
  --url https://api-dev.trake.io/doc/document/64dbc020119dd4ef7da9908e/files \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: multipart/form-data' \
  --form 'files=@/tmp/foo.png'

You should repeat steps 3 and 4 as many times as you need in order to apload all the documents and files.