JSON Configuration
Main Properties of the Root Object
{
"name": "My First Automation",
"preBuild": false,
"username": "example_user",
"config": [],
"signatureProfile": [],
"sign": []
}
| Property | Type | Required | Description |
|---|---|---|---|
name | string | Required | Name of the automation |
config | array | Required | Array of questions for the user |
signatureProfile | array | Required | Definition of signers and approvers |
sign | array | Required | Names of required questions |
preBuild | boolean | Required | If true, includes automatic pre-fill |
custom | object | Required | Object that allows customizing template characteristics |
preBuild Property - Automatic Pre-fill
When preBuild is true, you must include preBuildData. This field enables automatic pre-filling of the
template: some fields are completed in advance so the user only needs to finish filling out the
document.
In preBuildData, you declare the questions that will be pre-filled in this first instance. The last element of the array must be the email of the end user, who will receive the completion request by email.
{
"preBuild": true,
"preBuildData": ["buyer_name", "buyer_email", "end_user_email"]
}
config and its question types
In this section, all the questions that the user must fill out to generate the document for signature are added.
- Each question in
configis an object with specific properties. It always requiresname,description, andtype. - Questions can also have a default value by adding the
valueattribute.
{
"name": "unique_identifier",
"description": "Text the user sees",
"type": "question_type"
}
1. Free Text (text)
Accepts any text without restrictions.
{
"name": "product_description",
"description": "Briefly describe the product",
"type": "text"
}
2. Name (name)
Same as text, but automatically converts to uppercase in the HTML.
{
"name": "buyer_name",
"description": "Enter your full name",
"type": "name"
}
All name type questions in the final document will be generated in uppercase
Output example:
- User enters:
john doe - Displayed in HTML:
JOHN DOE
3. Number (number)
Only accepts numeric values.
{
"name": "items_quantity",
"description": "How many items do you want?",
"type": "number"
}
With additional text:
{
"name": "items_quantity",
"description": "How many items do you want?",
"type": "number",
"addText": true // Automatically adds "items"
}
4. Currency (currency)
Automatically formats as currency ($ COP).
{
"name": "total_amount",
"description": "Enter the value in pesos",
"type": "currency"
}
Options:
{
"name": "total_amount",
"description": "Enter the value in pesos",
"type": "currency",
"removeText": true // Only shows the number and $
}
Example:
- User enters:
50000 - Displayed:
$50,000(or$50000ifremoveTextis true)
5. Email (email)
Validates that it is a correct email.
{
"name": "buyer_email",
"description": "Enter your email address",
"type": "email"
}
6. Phone (phone)
Validates phone number according to the selected country code.
{
"name": "buyer_phone",
"description": "Enter your phone number",
"type": "phone"
}
7. Date (date)
Shows a calendar to select a date.
{
"name": "delivery_date",
"description": "Select the delivery date",
"type": "date"
}
8. List - Clause Type (clausula)
Dropdown with predefined options. Allows limiting other questions.
{
"name": "document_type",
"description": "Select the document type",
"type": "clausula",
"value": "id_card",
"options": [
{
"name": "National ID Card",
"value": "id_card"
},
{
"name": "Foreign ID Card",
"value": "foreign_id"
},
{
"name": "Passport",
"value": "passport"
}
]
}
Corresponding HTML:
<span name="document_type_id_card">ID Card</span>
<span name="document_type_foreign_id" hidden>Foreign ID</span>
<span name="document_type_passport" hidden>PASSPORT</span>
Explanation:
- A
<span>is created for each option - The name is:
{question_name}_{option_value} - The element with the default option does not have
hidden - Others have
hiddento initially hide them - The SDK changes the
hiddenattribute based on the user's selection
9. List - Select Type (select)
Simple dropdown, does NOT allow limiting other questions.
{
"name": "document_type",
"description": "Select the document type",
"type": "select",
"value": "id_card",
"options": [
{
"name": "National ID Card",
"label": "National ID Card",
"value": "id_card"
},
{
"name": "Foreign ID Card",
"label": "Foreign ID Card",
"value": "foreign_id"
}
]
}
Corresponding HTML:
<span name="document_type">_______________</span>
The SDK automatically places the text from the label attribute in the element.
10. Conditional Questions with prereq
The prereq property controls the conditional visibility of a question. Its attributes are:
-
k(key): name of the reference question -
v(value): required value in the reference question to show the current question
Structure
"prereq": [
{
"k": "reference_question_name",
"v": "required_value"
}
]
Complete Example:
document_type: Is the name of the question used as a reference in this example.id_card_number: question that is enabled only ifdocument_typeisid_card.foreign_id_number: question that is enabled only ifdocument_typeisforeign_id.
The question referenced in k MUST be of type clausula. As seen in this case,
document_type is of type clausula.
[
{
"name": "document_type",
"description": "Select the buyer's document type",
"type": "clausula",
"value": "id_card",
"options": [
{ "name": "National ID Card", "value": "id_card" },
{ "name": "Foreign ID Card", "value": "foreign_id" }
]
},
{
"name": "id_card_number",
"description": "Enter the national ID card number",
"type": "number",
"prereq": [{ "k": "document_type", "v": "id_card" }]
},
{
"name": "foreign_id_number",
"description": "Enter the foreign ID number",
"type": "number",
"prereq": [{ "k": "document_type", "v": "foreign_id" }]
}
]
Signature Profiles (signatureProfile)
Defines who signs the document and their associated data. In this signer object, the raw data of each signer is NOT stored; instead, the reference to the question that will contain the information for each signer is written.
| Property | Type | Required | Description |
|---|---|---|---|
name | String | Required | Name of the question where the signer's name is entered |
identification | String | Required | Name of the question for identification (can have multiple with |) |
email | String | Required | Name of the question for the signer's email |
phone | String | Required | Name of the question for the phone (recommended for OTP) |
type | String | Required | Unique identifier (used as id in the Complete HTML) |
Example - One Signer
{
"name": "buyer_name",
"identification": "buyer_id",
"email": "buyer_email",
"phone": "buyer_phone",
"type": "buyer"
}
Example - Multiple Identifications
If you have multiple identification questions (ID Card, Foreign ID, Passport):
{
"name": "seller_name",
"identification": "seller_id_card|seller_foreign_id|seller_passport",
"email": "seller_email",
"phone": "seller_phone",
"type": "seller"
}
Values are separated with | (pipe).
Required Questions
The sign property is an array with the names of questions that the user cannot skip:
- The user must mandatorily complete the questions registered in
sign. - Cannot leave blank the questions registered in
sign. - Cannot proceed without filling the questions registered in
sign.
"sign": [
"buyer_name",
"buyer_email",
"buyer_id"
]
Key Differences: clausula vs select
| Feature | Clausula | Select |
|---|---|---|
| List type | Dropdown | Dropdown |
| HTML elements needed | One per option | Only one |
| Can limit other questions | Yes | No |
prereq attribute | Allowed | Allowed |
| Options structure | {name, value} | {name, label, value} |