Creating validations in Plutto is easy, but the time they take to complete is variable. It could go from less than a minute to a couple of them. That's why we implemented webhooks to let you know when validations are ready to be reviewed.

๐Ÿ“˜

Webhooks are set in each validation

You can choose in each validation if you want to be notified when it's completed. There's no global setting so you can have total control.

How to set up webhooks

The only thing you need to do is to add the field webhook_url to the validation object when creating a validation with our API. If you want to setup a webhook for a validation created in the dashboard let us know.

{
    "entity_validation": {
        "tin": "77447361-0",
        "country": "CL",
        "contact_email": "[email protected]",
        "webhook_url": "https://yoursite.com/some-webhook-path" //only https urls allowed
    }
}

Available webhooks

Depending on your use case you might want to listen to different webhooks. At this moment there are 2 available for a validation.

  • "validation.ready" it's triggered once every piece of information is gathered so you have the full validation object.
  • "validation.ready_without_legal_cases" it's triggered once every job is done except for legal cases. This is because corporation with huge amounts of legal cases can take a while to be ready. We've seen some companies take a little more than 1 hour to retrieve 1000+ legal cases. This webhook is perfect if you need a more consistent and faster response. It takes less than 20 seconds for 90% of cases

How webhooks work?

Once the validation is ready we'll POST you the validation object to the url provided. It is extremely important that you return a response with http code 200 so we know you received it correctly.

In case we don't get the 200 response, we'll retry up to 20 times using exponential times between each retry. If we never get a 200 response after the 20th retry, we'll discard the webhook.

This is the body of the post we'll send to you:
note that this example response was trimmed for demonstration purposes. You can check the full validation object here

{
  	"type": "validation.ready",
    "validation": {
        "id": "val_fe0e26bcce7c671a",
        "entity_validation_id": "bval_f5c7bb362a1faa0a",
        "entity_name": "PLUTTO SPA",
        "entity_tin": "77447361-0",
        "entity_country": "CL",
        "status": "created",
        "created_at": "2022-10-20T13:15:39.623Z",
        "contact_email": "[email protected]",
        "suggested_manager_name": null,
        "webhook_url": "https://yoursite.com/some-webhook-path",
        "entity": {
            "id": "bsn_a6058b75987582ae",
            "created_at": "2022-10-20T13:15:39.410Z",
            "name": "PLUTTO SPA",
            "tin": "77447361-0",
            "status": "active",
            "country": "CL",
            "legal_cases": {
                "total_count": 0,
                "last_case": null
            },
            "tax_office_data": {
                "has_activity_initiation": true,
                "activity_initiation_date": "2021-09-27",
                "can_tax_in_foreign_money": false,
                "is_small_enterprise": true,
                "activities": [
                    {
                        "code": "582000",
                        "date": "2021-10-04",
                        "name": "EDICION DE PROGRAMAS INFORMATICOS",
                        "exempt": false,
                        "category": 1
                    },
                    {
                        "code": "620200",
                        "date": "2021-09-27",
                        "name": "ACTIVIDADES DE CONSULTORIA DE INFORMATICA Y DE GESTION DE INSTALACIONE",
                        "exempt": false,
                        "category": 1
                    },
                    {
                        "code": "631100",
                        "date": "2021-10-04",
                        "name": "PROCESAMIENTO DE DATOS, HOSPEDAJE Y ACTIVIDADES CONEXAS",
                        "exempt": false,
                        "category": 1
                    },
                    {
                        "code": "661903",
                        "date": "2021-10-04",
                        "name": "EMPRESAS DE ASESORIA Y CONSULTORIA EN INVERSION FINANCIERA; SOCIEDADES",
                        "exempt": false,
                        "category": 1
                    }
                ]
            },
            "formation": {
                "country": "CL",
                "company_type": "spa",
                "constitution_date": "2021-08-27",
                "date_of_document": null,
                "registry": null,
                "duration": null,
                "activity_description": "El objeto de la sociedad serรก la creaciรณn, desarrollo, implementaciรณn, distribuciรณn, licenciamiento, explotaciรณn y comercializaciรณn de todo tipo de software y plataformas tecnolรณgicas; la prestaciรณn de asesorรญas, consultorรญas y servicios en el รกrea de operaciones, computacional y tecnolรณgica a travรฉs de todo tipo de soportes y/o medios tecnolรณgicos; la inversiรณn en toda clase de bienes y productos tecnolรณgicos, para cualquier uso: la adquisiciรณn, enajenaciรณn, administraciรณn, inversiรณn y explotaciรณn de bienes muebles e inmuebles, incluyendo patentes, marcas, licencias, permisos y cualquier otro derecho de propiedad industrial; y, en general, ejecutar los actos y celebrar los contratos necesarios al fin indicado, al desarrollo de su actividad y a la inversiรณn de los fondos disponibles de la sociedad.",
                "administration": {
                    "administration_type": "Administraciรณn, representaciรณn y uso razรณn social: Antonia San Martรญn Sola",
                    "managers": [
                        {
                            "name": "ANTONIA SAN MARTIN SOLA",
                            "tin": "",
                            "person_id": "per_ff8a5b69b9b10c89",
                            "faculties": [...]
                        }
                    ],
                    "sii_representatives": [...]
                },
                "equity": {
                    "total_amount": 1000000,
                    "total_shares": 10000,
                    "currency": "CLP",
                    "shares_type": null,
                    "shareholders": [...]
                }
            },
            "addresses": [...]
        },
        "files": [...]
    }
}

How to validate our webhooks?

In order to validate that the data is really coming from our end, you can check that the Bearer token in the Authorization header is in fact the one that you set.

Thus, in a webhook request, you might find something as the following example:

POST /webhook_url HTTP/1.1
Host: plutto_backend.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer sk_ef9f347e8e2ea65ebf074d2fd18187fd87ff52fc28954e8d
Content-Length: 81

{
  "firstName": "Jane",
  "lastName": "Doe",
  "email": "[email protected]"
}

In this case, the Authorization header is Authorization: Bearer sk_ef9f347e8e2ea65ebf074d2fd18187fd87ff52fc28954e8d.

๐Ÿ“˜

Setting Your Webhooks Bearer Tokens

In case you haven't already set your bearer token, please contact us