跳到主要内容

扩展字段(Extra Fields)

这组端点用于查询文档模板中可用的扩展字段,并为某笔操作中的这些字段保存自定义取值。

注意

使用扩展字段的前提是文档模板已经确定。否则,请先生成一份草稿预览,再使用这些端点。

重要

扩展字段按文档类型(document_type)组织。通过 POST 保存扩展字段时,该 document_type 下此前的取值会被整体替换 — 不会与已有取值进行合并。


查询可用扩展字段(GET)​

返回与该操作文档类型关联的模板中可用的扩展字段。

Request​

ENDPOINT
/commercial_paper/operation/OPERATION-KEY/extra_fields
方法
GET

Path Params​

字段类型描述最大字符数
OPERATION-KEY *string操作的唯一键值(UUID v4)。36

Query Params​

字段类型描述最大字符数
document_type *string文档类型。document_type 枚举值

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​

字段类型描述最大字符数
operation_key *string操作的唯一键值(UUID v4)。36
document_type *string所查询的文档类型。document_type 枚举值
template_key *string关联模板的唯一键值(UUID v4)。36
extra_fields *array模板中可用的扩展字段列表。-

extra_fields 对象的字段​

字段类型描述最大字符数
field_key *string扩展字段的唯一标识。255
field_label *string扩展字段的描述性标签。255
field_type *string扩展字段的数据类型(例如 string)。50

保存扩展字段(POST)​

为某笔操作中特定文档类型保存扩展字段的取值。所提交的取值会整体替换该 document_type 下此前的扩展字段。

Request​

ENDPOINT
/commercial_paper/operation/OPERATION-KEY/extra_fields
方法
POST

Path Params​

字段类型描述最大字符数
OPERATION-KEY *string操作的唯一键值(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​

字段类型描述最大字符数
document_type *string文档类型。document_type 枚举值
extra_fields *object包含扩展字段及其取值的对象。其键必须与 GET 查询返回的 field_key 一致。所有取值必须为字符串。-
注意

extra_fields 对象中提交的键必须与模板中可用的 field_key 完全一致。无效的键会导致报错。

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​

字段类型描述最大字符数
operation_key *string操作的唯一键值(UUID v4)。36
document_type *string文档类型。document_type 枚举值
extra_fields *object包含已保存扩展字段及其相应取值的对象。-

document_type 枚举值​

枚举值描述
commercial_paper设立条款
adhesion_term加入条款

错误​

错误码HTTP描述
COM000007404未找到该操作。
COM000008403该操作不属于发起请求的租户。
COM000044400该文档类型尚未定义模板。请先生成草稿预览,再继续操作。
COM000045400扩展字段的键在模板中不可用。