Flujo Plantillas V2

Flujo de trabajo

1. Generar Token

curl --location --request POST 'https://api.weetrust.mx/access/token' \
--header 'user-id: YY0mSXZX3WUPmvHvolHfcLTGvaaa' \
--header 'api-key: b43855513bce9498db596bdb2ca84092653a5555'

2.- Obtener plantillas

curl --location 'https://api.weetrust.mx/templates/v2' \
--header 'token: token' \
--header 'user-id: YY0mSXZX3WUPmvHvolHfcLTGvaaa' \
--header 'Authorization: Bearer token'

Respuesta:

"templates": [
            {
                "_id": "6515c125e74729525b035ddf",
                "name": "example_de_plantilla.docx",
                "description": "Plantilla de ejemplo",
                "templateID": "6515c125e74729525b033ddf",
                "key": "docxs/example_de_plantilla.docx",
                "status": "ACTIVE",
                "signatories": [
                    {
                        "key": "firma_cliente",
                        "type": "signature",
                        "_id": "6511c27b18cc2e002a00b7a9"
                    }
                ],
                "form": [
                 		{
                        "key": "RFC",
                        "type": "text",
                        "isRequired": true,
                        "label": "¿RFC de cliente?",
                        "_id": "650ddeafb1e23d002a7d9aa5"
                    }
                ],
                "formSignatory": [
                    {
                        "key": "name",
                        "type": "text",
                        "isRequired": true,
                        "label": "¿Nombre de Firmante?",
                        "_id": "650ddeafb1e23d002a7d9aa5"
                    },
                ]
            }
        ]

El siguiente paso es obtener el templateID y el form, el form son las variables que necesitamos llenar para el estampado de las variables en la plantilla, el formSignatory son las preguntas que en este caso se le preguntaran al firmante antes de proceder a la firma del documento.

3.- Enviar documento desde plantilla a firma

curl --location 'https://api.weetrust.mx/templates/createDocumentByTemplateV2' \
--header 'token: token' \
--header 'user-id: YY0mSXZX3WUPmvHvolHfcLTGvaaa' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer token' \
--data-raw '{
    "templateID": "6515c125e74729525b035ddf",
    "country": "México",
    "inputs": {
        "RFC": "RFCEXAPLE"
    },
    "signatories": [
        {
            "email": "[email protected]",
            "name": "Juan Perez"
        }
    ]
}'

Esto detonara un correo que se le enviara al firmante con la url de firma para proceder a flujo de firma.