跳到主要内容

插入清算记录


Request

ENDPOINT
/settlement/fund_class/FUND_CLASS_KEY/payment_batch/EXTERNAL_ID/settlement
MÉTODO
POST
信息

清算和资产回购均通过此端点执行。区分两者的字段为 collection_origin_type。如果是清算,使用的枚举值为 "borrower";如果是回购,则使用 "assignor"

Request Body
{
"asset_type": "ccb",
"total_value": 130.50,
"external_id": "931e9437-d025-41ab-bb53-6b94e10fd361",
"settlement_type": "installment_settlement",
"contract_number":"0123456789/ABC",
"installment_number": 1,
"collection_date": "2025-01-01",
"collection_origin_type": "borrower"
}
注意

字段 asset_external_idcontract_number 是系统中资产的标识符,必须传入其中一个,但不能同时传入两者。

Body Params

必填字段 *

字段类型描述字符数
asset_type *string指定要传入的资产类型最多 255
total_value *float资产付款总值(保留两位小数)最多 24
external_id *string集成合作伙伴系统中清算记录的唯一标识键最多 50
settlement_type *string指定要传入的清算类型最多 50
collection_origin_type *string确定操作是清算还是回购枚举值
contract_numberstring与资产相关的合同编号最多 50
asset_external_idstring转让时提供的资产在合作伙伴系统中的唯一标识键最多 50
if_codestring金融工具代码(B3)最多 50
participant_control_numberstring转让时提供的参与者控制编号最多 50
installment_numberint待付款分期编号最多 24
installment_maturity_datestring待付款分期的到期日ISO 8601
collection_datestring付款日期(此字段供集成方控制使用)ISO 8601
信息

请求体中的 external_id 字段指的是清算记录的标识符,而端点中的 EXTERNAL_ID 字段指的是批次的标识符。

资产类型

枚举值描述
ccb银行信用凭证
cce出口信用凭证
structured_ccb结构化银行信用凭证
structured_cce结构化出口信用凭证
structured_nce结构化出口信用票据
structured_cci结构化不动产信用凭证
duplicata_mercantil商业汇票
duplicata_servicos服务汇票
discounted_contract合同

清算类型

枚举值描述
asset_settlement资产全额清算
asset_amortization资产摊销(宽限期)
fine_payment资产利息或罚息支付
installment_settlement分期清算(此时需传入 installment_number 字段)
installment_amortization分期摊销(此时需传入 installment_number 字段)
installment_fine_payment分期利息或罚息支付(此时需传入 installment_number 字段)
gloss分期冲销(此时需传入 installment_number 字段)

collection_origin_type 类型

枚举值描述
borrower操作为清算时使用
assignor操作为回购时使用

Response

STATUS
201
Request Body
{
"status": "validated",
"total_value": 130.50,
"external_id": "931e9437-d025-41ab-bb53-6b94e10fd361",
"installment_number": 1,
"type":"installment_settlement",
"settlement_result":0.0,
"assets":[
{
"asset_key": "f34e9437-d025-41ab-bb53-6b94e10fd361",
"number_of_units": 1,
"present_value": 1250.00,
"installment_face_value":130.50
}
]
}

可能的错误


STATUS
404
Response Body
{
"title": "Payment batch not found",
"description": "The Payment Batch with external_id {payment_batch_external_id} was not found",
"translation": "O Lote de Pagamento com identificador externo {payment_batch_external_id} não foi encontrado",
"code": "SET000010"
}



STATUS
400
Response Body
{
"title": "Already Exists Settlement With External Id",
"description": "The settlement with external_id {settlement_external_id} in payment batch with external id {payment_batch_external_id} already exists",
"translation": "a liquidação com identificador {settlement_external_id} no lote de identificador {payment_batch_external_id} já existe",
"code": "SET000013"
}