Skip to main content

Uploading documents for signature

The Uploading Documents for Signature feature allows you to integrate, through the SDK, the secure upload of documents that need to be electronically signed.

Integration Examples

warning

For the integration, it is necessary to have an <iframe id='iframeId'> element where the SDK will be rendered, and the AucoSDK function must be provided with the ID of this element.

info

Follow the link to see the reference of the events required for an SDK integration: 👉🏻 Events

Basic Integration

import { AucoSDK } from 'auco-sdk-integration';

const unsubscribe = AucoSDK({
iframeId: 'iframeId',
sdkType: 'upload',
language: 'es', // Accepted languages ​​'es' | 'en'
keyPublic: 'prk_xxxxx', // Company private key needed to create the process
events: {
onSDKReady,
onSDKClose,
onSDKToken,
},
sdkData: {
userAttributes: {
email: 'admin@company.com', // Email of user registered in Auco, recommended use company admin's email
},
uxOptions: {
primaryColor: '#021c30',
alternateColor: '#a557f2',
},
},
env: process.env.PUBLIC_ENVIRONMENT == 'dev' ? 'DEV' : 'PROD',
});

Integration with custom data

The custom attribute allows you to send an object with additional custom information within sdkData. This object is stored in the database associated with the process and included in the webhook payload if configured.

import { AucoSDK } from 'auco-sdk-integration';

const unsubscribe = AucoSDK({
iframeId: 'iframeId',
sdkType: 'upload',
language: 'es', // Accepted languages 'es' | 'en'
keyPublic: 'prk_xxxxx', // Company private key needed to create the process
events: {
onSDKReady,
onSDKClose,
onSDKToken,
},
sdkData: {
userAttributes: {
email: 'admin@company.com', // Email of user registered in Auco, recommended use company admin's email
},
custom: {
// (optional) Object with custom data, saved to DB and sent via webhook
internalId: 'ORD-12345',
department: 'legal',
priority: 'high',
},
uxOptions: {
primaryColor: '#021c30',
alternateColor: '#a557f2',
},
},
env: process.env.PUBLIC_ENVIRONMENT == 'dev' ? 'DEV' : 'PROD',
});

Integration with pre-loaded signers (STABLE)

danger

This method will be deprecated in the future, it is recommended to use the method detailed in the next item.

info

Follow the link to see the reference of accepted countries and document types 👉🏻 Documents and countries

import { AucoSDK } from 'auco-sdk-integration';

const unsubscribe = AucoSDK({
iframeId: 'iframeId',
sdkType: 'upload',
language: 'es', // Accepted languages ​​'es' | 'en'
keyPublic: 'prk_xxxxx', // Company private key required for process creation
events: {
onSDKReady,
onSDKClose,
onSDKToken,
},
sdkData: {
userAttributes: {
email: 'admin@company.com', // Email of user registered in Auco, recommended use company admin's email
},
users: [
{
name: 'Signer';
email: 'signer@auco.ai';
phone: '+573151234567';
country: 'CO';
id: '1234567890';
idType: 'CC';
}
],
uxOptions: {
primaryColor: '#021c30',
alternateColor: '#a557f2',
},
},
env: process.env.PUBLIC_ENVIRONMENT == 'dev' ? 'DEV' : 'PROD',
});

Integration with pre-loaded signers

warning

This feature is only available from v1.0.0 onwards

info

Follow the link to see the reference of accepted countries and document types 👉🏻 Documents and countries

import { AucoSDK } from 'auco-sdk-integration';

const unsubscribe = AucoSDK({
iframeId: 'iframeId',
sdkType: 'upload',
language: 'es', // Accepted languages ​​'es' | 'en'
keyPublic: 'prk_xxxxx', // Company private key needed to create the process
events: {
onSDKReady,
onSDKClose,
onSDKToken,
},
sdkData: {
userAttributes: {
email: 'admin@company.com', // Email of user registered in Auco, recommended use company admin's email
},
flowData: {
type: 'participants',
participants: [
{
id: 'id1',
type: 'signer',
name: 'Signer',
email: 'signer@auco.ai',
phone: '+573161979572',
country: 'CO',
identification: '123',
identificationType: 'CC',
locked: true, // This participant cannot be edited or deleted.
disableAutoSign: true, // (optional) Disables automatic signing for this participant
},
{
id: 'id2',
type: 'approver',
name: 'Approver',
email: 'approver@auco.ai',
phone: '+573161979572',
country: 'CO',
identification: '1234',
identificationType: 'CC',
},
{
id: 'id3',
type: 'reader',
name: 'Reader',
email: 'reader@auco.ai',
locked: true, // This participant cannot be edited or deleted.
},
],
},
uxOptions: {
primaryColor: '#021c30',
alternateColor: '#a557f2',
},
},
env: 'DEV',
});

Integration with pre-filled flow

In this type of integration, when opening the SDK, the user only needs to enter the signatures.

warning

This feature is only available from v1.0.0 onwards

info

Follow the link to see the reference of accepted countries and document types 👉🏻 Documents and countries

import { AucoSDK } from 'auco-sdk-integration';

const unsubscribe = AucoSDK({
iframeId: 'iframeId',
sdkType: 'upload',
language: 'es', // Accepted languages 'es' | 'en'
keyPublic: 'prk_xxxxx', // Company private key required for process creation
events: {
onSDKReady,
onSDKClose,
onSDKToken,
},
sdkData: {
userAttributes: {
email: 'admin@company.com', // Email of user registered in Auco, recommended use company admin's email
},
flowData: {
type: 'complete',
files: [file1, file2], // Array of documents to be uploaded (type File), Auco will join them into a single PDF
emailData: {
name: 'Flujo precargado',
message: 'Mensaje',
subject: 'Sujeto',
expire: new Date(), // (optional) Expiration date of the flow
remember: '48', // (optional) Every how many hours a reminder will be sent
notificationOff: true, // Auco will not send emails to participants.
},
platform: 'whatsapp', // Platform where the signing processes will be carried out ('auco' | 'whatsapp')
validations: {
otpCode: 'phone', // (optional) Medium through which OTP will be sent ('phone' | 'email')
flow: false, // Guided Identity Validation
identification: true, // Identity document validation
identificationCardBack: true, // Rear ID Validation
selfie: true, // Validation with facial photo
},
participants: [
{
id: 'id_1',
type: 'signer',
name: 'Signer',
email: 'signer@auco.ai',
phone: '+573151234567',
country: 'CO',
identificationType: 'CC',
identification: '1234',
disableAutoSign: true, // (optional) Disables automatic signing for this participant
},
{
id: 'id_2',
type: 'approver',
name: 'Approver',
email: 'approver@auco.ai',
phone: '+573151234567',
country: 'CO',
identificationType: 'CC',
identification: '1234',
},
{
id: 'id_3',
type: 'reader',
email: 'reader@auco.ai',
name: 'Reader',
},
],
},
uxOptions: {
primaryColor: '#021c30',
alternateColor: '#a557f2',
},
},
env: 'DEV',
});

Basic Editing Integration

In this type of integration, you can edit a document that has not yet been signed; the original document information will be auto-completed.

warning

This feature is only available from v1.0.3 onwards.

import { AucoSDK } from 'auco-sdk-integration';

const unsubscribe = AucoSDK({
iframeId: 'iframeId',
sdkType: 'upload',
language: 'es', // Accepted languages: 'es' | 'en'
keyPublic: 'prk_xxxxx', // Company private key required for process creation
events: {
onSDKReady,
onSDKClose,
onSDKToken,
},
sdkData: {
userAttributes: {
email: 'admin@company.com', // Email for registered Auco user. It is recommended to use the company admin email
},
flowData: {
type: 'edit',
code: 'CODEDOCUM',
keepPositions: true, // Optional - Keeps the signature positions from the original document
},
uxOptions: {
primaryColor: '#021c30',
alternateColor: '#a557f2',
},
},
env: 'DEV',
});

Integration for editing with overwriting

In this type of integration, you can edit a document that has not yet been signed and overwrite the original document information in the integration.

warning

This feature is only available from v1.0.3 onwards.

info

If the integration overwrites all the original document information (files, emailData, platform, validations, and participants), when opening the SDK, the user will only need to place the signatures.

import { AucoSDK } from 'auco-sdk-integration';

const unsubscribe = AucoSDK({
iframeId: 'iframeId',
sdkType: 'upload',
language: 'es', // Accepted languages ​​'es' | 'en'
keyPublic: 'prk_xxxxx', // Company private key required for process creation
events: {
onSDKReady,
onSDKClose,
onSDKToken,
},
sdkData: {
userAttributes: {
email: 'admin@company.com', // Email of the user registered with Auco. It is recommended to use the company admin email
},
flowData: {
type: 'edit',
code: 'CODEDOCUM',
files: [file1], // Optional - Array of documents (type File) to upload
emailData: {...}, // Optional - Email and/or reminder settings
platform: 'whatsapp', // Optional - Platform where the signature will be made ('auco' | 'whatsapp')
validations: {...}, // Optional - Validations
participants: [...], // Optional - List of participants to overwrite the originals
keepPositions: true, // Optional - Keeps the signature positions from the original document
},
uxOptions: {
primaryColor: '#021c30',
alternateColor: '#a557f2',
},
},
env: 'DEV',
});