Skip to main content

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.

warning

To use extra fields, the document template must already have been defined. Otherwise, generate a draft preview before using these endpoints.

Important

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​

ENDPOINT
/commercial_paper/operation/OPERATION-KEY/extra_fields
METHOD
GET

Path Params​

FieldTypeDescriptionMax. Characters
OPERATION-KEY *stringUnique key of the operation (UUID v4).36

Query Params​

FieldTypeDescriptionMax. Characters
document_type *stringDocument type.document_type enumerators

Response​

STATUS
200
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​

FieldTypeDescriptionMax. Characters
operation_key *stringUnique key of the operation (UUID v4).36
document_type *stringDocument type queried.document_type enumerators
template_key *stringUnique key of the associated template (UUID v4).36
extra_fields *arrayList of extra fields available in the template.-

Fields of the extra_fields object​

FieldTypeDescriptionMax. Characters
field_key *stringUnique identifier of the extra field.255
field_label *stringDescriptive label of the extra field.255
field_type *stringData 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​

ENDPOINT
/commercial_paper/operation/OPERATION-KEY/extra_fields
METHOD
POST

Path Params​

FieldTypeDescriptionMax. Characters
OPERATION-KEY *stringUnique 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​

FieldTypeDescriptionMax. Characters
document_type *stringDocument type.document_type enumerators
extra_fields *objectObject containing the extra fields and their values. The keys must match the field_key returned by the GET query. All values must be strings.-
warning

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​

STATUS
201
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​

FieldTypeDescriptionMax. Characters
operation_key *stringUnique key of the operation (UUID v4).36
document_type *stringDocument type.document_type enumerators
extra_fields *objectObject containing the saved extra fields with their respective values.-

document_type enumerators​

EnumDescription
commercial_paperConstitutive Term
adhesion_termAdhesion Term

Errors​

CodeHTTPDescription
COM000007404Operation not found.
COM000008403Operation does not belong to the requesting tenant.
COM000044400Template not defined for the document type. Generate a draft preview before proceeding.
COM000045400Extra field keys not available in the template.