Extra Fields
This set of endpoints allows you to query the extra fields available in a document template and to save custom values for those fields in an operation.
To use extra fields, the document template must already have been defined. Otherwise, generate a draft preview before using these endpoints.
Extra fields are organized by document type (document_type). When saving extra fields via POST, the previous values for that document_type are entirely replaced — no merge with existing values is performed.
Query Available Extra Fields (GET)
Returns the extra fields available in the template associated with the operation's document type.
Request
Path Params
| Field | Type | Description | Max. Characters |
|---|---|---|---|
OPERATION-KEY * | string | Unique key of the operation (UUID v4). | 36 |
Query Params
| Field | Type | Description | Max. Characters |
|---|---|---|---|
document_type * | string | Document type. | document_type enumerators |
Response
Response Body
{
"operation_key": "550e8400-e29b-41d4-a716-446655440000",
"document_type": "commercial_paper",
"template_key": "660e8400-e29b-41d4-a716-446655440001",
"extra_fields": [
{
"field_key": "warranty_description",
"field_label": "Descrição da Garantia",
"field_type": "string"
},
{
"field_key": "special_conditions",
"field_label": "Condições Especiais",
"field_type": "string"
},
{
"field_key": "additional_clause",
"field_label": "Cláusula Adicional",
"field_type": "string"
}
]
}
Response Body Params
| Field | Type | Description | Max. Characters |
|---|---|---|---|
operation_key * | string | Unique key of the operation (UUID v4). | 36 |
document_type * | string | Document type queried. | document_type enumerators |
template_key * | string | Unique key of the associated template (UUID v4). | 36 |
extra_fields * | array | List of extra fields available in the template. | - |
Fields of the extra_fields object
| Field | Type | Description | Max. Characters |
|---|---|---|---|
field_key * | string | Unique identifier of the extra field. | 255 |
field_label * | string | Descriptive label of the extra field. | 255 |
field_type * | string | Data type of the extra field (e.g. string). | 50 |
Save Extra Fields (POST)
Saves the values of the extra fields for a specific document type in an operation. The values sent entirely replace the previous extra fields for the informed document_type.
Request
Path Params
| Field | Type | Description | Max. Characters |
|---|---|---|---|
OPERATION-KEY * | string | Unique key of the operation (UUID v4). | 36 |
Request Body
{
"document_type": "commercial_paper",
"extra_fields": {
"warranty_description": "Garantia prestada pelo avalista",
"special_conditions": "Condição especial de vencimento antecipado",
"additional_clause": "Cláusula de cross default"
}
}
Request Body Params
| Field | Type | Description | Max. Characters |
|---|---|---|---|
document_type * | string | Document type. | document_type enumerators |
extra_fields * | object | Object containing the extra fields and their values. The keys must match the field_key returned by the GET query. All values must be strings. | - |
The keys sent in the extra_fields object must match exactly the field_key available in the template. Invalid keys will result in an error.
Response
Response Body
{
"operation_key": "550e8400-e29b-41d4-a716-446655440000",
"document_type": "commercial_paper",
"extra_fields": {
"warranty_description": "Garantia prestada pelo avalista",
"special_conditions": "Condição especial de vencimento antecipado",
"additional_clause": "Cláusula de cross default"
}
}
Response Body Params
| Field | Type | Description | Max. Characters |
|---|---|---|---|
operation_key * | string | Unique key of the operation (UUID v4). | 36 |
document_type * | string | Document type. | document_type enumerators |
extra_fields * | object | Object containing the saved extra fields with their respective values. | - |
document_type enumerators
| Enum | Description |
|---|---|
commercial_paper | Constitutive Term |
adhesion_term | Adhesion Term |
Errors
| Code | HTTP | Description |
|---|---|---|
COM000007 | 404 | Operation not found. |
COM000008 | 403 | Operation does not belong to the requesting tenant. |
COM000044 | 400 | Template not defined for the document type. Generate a draft preview before proceeding. |
COM000045 | 400 | Extra field keys not available in the template. |