# QI Tech — Lending-as-a-Service › 债务

Documentação da QI Tech em texto corrido, para colar em um LLM.
Fonte: https://docs.qitech.com.br
42 página(s).

Índice:
- 更新信贷合同受让方 (/zh-Hans/documentation/emissao_de_divida/atualizar_cessionario_047911bb-d3fb-48fe-88fd-aebdeb7e11ad)
- 更新信贷合同关联方信息 (/zh-Hans/documentation/emissao_de_divida/atualizar_dados_da_parte_relacionada)
- 授权放款 (/zh-Hans/documentation/emissao_de_divida/autorizar_desembolso)
- 放款前取消债务 (/zh-Hans/documentation/emissao_de_divida/cancelamento/cancelar_divida_antes_de_desembolsar)
- 永久取消 (/zh-Hans/documentation/emissao_de_divida/cancelamento/cancelar_permanentemente)
- 放款后七天内取消债务 (/zh-Hans/documentation/emissao_de_divida/cancelamento/desistencia/cancelamento_de_divida_em_ate_sete_dias_apos_o_desembolso)
- 查询退款 pix qr code (/zh-Hans/documentation/emissao_de_divida/cancelamento/desistencia/consulta_de_pix_qr_code_de_devolucao)
- 简介 (/zh-Hans/documentation/emissao_de_divida/cancelamento/desistencia/introducao)
- 简介 (/zh-Hans/documentation/emissao_de_divida/cancelamento/introducao)
- 配置放款日期 (/zh-Hans/documentation/emissao_de_divida/configurar_data_de_desembolso)
- 债务查询 (/zh-Hans/documentation/emissao_de_divida/consulta_de_divida)
- 按合同编号查询债务 (/zh-Hans/documentation/emissao_de_divida/consulta_por_contract_number)
- 按信贷操作密钥查询债务 (/zh-Hans/documentation/emissao_de_divida/consulta_por_credit_operation_key)
- 按请求标识符密钥查询债务 (/zh-Hans/documentation/emissao_de_divida/consulta_por_requester_identifier_key)
- 操作放款 (/zh-Hans/documentation/emissao_de_divida/desembolso_da_operacao)
- 个人债务发行 (/zh-Hans/documentation/emissao_de_divida/emissao/emissao_de_divida_pf)
- 企业债务发行 (/zh-Hans/documentation/emissao_de_divida/emissao/emissao_de_divida_pj)
- 放款 Payload 示例 (/zh-Hans/documentation/emissao_de_divida/emissao/exemplo_payloads_desembolso)
- 替代签署方式 (/zh-Hans/documentation/emissao_de_divida/formalizacao/assinatura_de_contrato)
- 通过 OPT-IN 签署合同 (/zh-Hans/documentation/emissao_de_divida/formalizacao/assinatura_opt_in)
- 发送已签署 PDF (/zh-Hans/documentation/emissao_de_divida/formalizacao/assinatura_pdf)
- 通过自拍签署合同 (/zh-Hans/documentation/emissao_de_divida/formalizacao/assinatura_selfie)
- 合同签署 (/zh-Hans/documentation/emissao_de_divida/formalizacao/introducao_formalizacao)
- 为分期付款生成 Boleto 或 PIX (/zh-Hans/documentation/emissao_de_divida/gerar_boleto_ou_pix_para_uma_parcela)
- 简介 (/zh-Hans/documentation/emissao_de_divida/introducao)
- Metadata (/zh-Hans/documentation/emissao_de_divida/metadata)
- 简介 (/zh-Hans/documentation/emissao_de_divida/reapresentacao_de_conta_bancaria)
- 重新发送信贷合同关联方文件 (/zh-Hans/documentation/emissao_de_divida/reenviar_documentos_das_partes_relacionadas)
- 放款后操作 (/zh-Hans/documentation/emissao_de_divida/reprocessar_acao_pos_desembolso)
- 更改放款数据 (/zh-Hans/documentation/emissao_de_divida/reprocessar_multiplas_datas/trocar_conta)
- 更改放款日期 (/zh-Hans/documentation/emissao_de_divida/reprocessar_multiplas_datas/trocar_data)
- 保险 (/zh-Hans/documentation/emissao_de_divida/seguro)
- 债务模拟（旧版） (/zh-Hans/documentation/emissao_de_divida/simulacao_de_divida_antigo)
- 债务模拟（新版） (/zh-Hans/documentation/emissao_de_divida/simulacao_de_divida_novo)
- 在沙盒中模拟错误 (/zh-Hans/documentation/emissao_de_divida/simulando_erros)
- 债务的可能状态 (/zh-Hans/documentation/emissao_de_divida/status_de_uma_divida)
- 重发 Webhook (/zh-Hans/documentation/notificacoes/reenvio_de_notificacoes)
- 债务 Webhook (/zh-Hans/documentation/webhooks/dividas)
- Webhooks de gestão de risco (/zh-Hans/documentation/webhooks/gestao_de_risco)
- 不当款项 Webhook (/zh-Hans/documentation/webhooks/indevidos)
- 分期支付 Webhook (/zh-Hans/documentation/webhooks/pagamento_de_parcela)
- 分期 Webhook (/zh-Hans/documentation/webhooks/parcelas)

---

# 更新信贷合同受让方

URL: /zh-Hans/documentation/emissao_de_divida/atualizar_cessionario_047911bb-d3fb-48fe-88fd-aebdeb7e11ad

    ### 重要说明：

    更新受让方时，需满足以下要求：
    - 信贷操作不得已取消；
    - 信贷操作不得正处于转让流程中；
    - 信贷操作不得已被转让；
    - 必须存在与新买方的转让配置。

## 请求

ENDPOINT /debt/ DEBT-KEY /purchaser
MÉTODO PATCH

**请求体**

```json
{
  "purchaser_document_number": "01234567890001"
}
```

### 路径参数

| 字段 | 类型 | 描述 |
|---|---|---|
| `debt_key` * | string | 操作的 debt_key。 |

## 响应

STATUS 201

**响应体**

```json
{}
```

STATUS 400

**响应体**

```json
{
  "data": "{\"title\": \"Bad Request\", \"description\": \"Credit Operation is already in assignment process for changing the purchaser.\", \"translation\": \"A operação de crédito está em processo de cessão e não pode ter seu comprador alterado.\", \"extra_fields\": {}, \"code\": \"COP000376\"}"
}
```

---

# 更新信贷合同关联方信息

URL: /zh-Hans/documentation/emissao_de_divida/atualizar_dados_da_parte_relacionada

## 请求

ENDPOINT /debt/ DEBT-KEY /related_party/ RELATED-PARTY-KEY
MÉTODO PATCH

### 个人
**请求体**

```json
{
  "name": "Teste teste",
  "email": "teste@teste.com",
  "address": {
    "street": "Rua teste",
    "neighborhood": "Bairro teste",
    "number": "123",
    "postal_code": "09725540",
    "city": "São Caetano do sul",
    "state": "SP"
  },
  "phone": {
    "country_code": "55",
    "area_code": "11",
    "number": "41234123"
  },
  "mother_name": "Mãe Teste",
  "document_identification_number": "1234567",
  "nationality": "Brasileiro",
  "marital_status": "single",
  "profession": "Diretor Executivo",
  "birth_date": "1999-01-01",
  "document_identification_date": "2015-01-01",
  "document_identification_type": "cnh",
  "gender": "female"
}
```

### 法人
**请求体**

```json
{
	"name": "Teste teste",
	"email": "teste@teste.com",
	"address": {
		"street": "Rua teste",
		"neighborhood": "Bairro teste",
		"number": "123",
		"postal_code": "09725540",
		"city": "São Caetano do sul",
		"state": "SP"
	},
	"phone": {
		"country_code": "55",
		"area_code": "11",
		"number": "41234123"
	},
	"trading_name": "Nome fantasia teste",
	"foundation_date": "2020-01-01",
	"simples_nacional_participant": false
}
```

### 路径参数

| 字段 | 类型 | 描述 |
|---|---|---|
| `debt_key` * | string | 操作的 debt_key。 |
| `related_party_key` * | string | 需要发送文件的关联方的密钥。 |

## 响应

STATUS 201

**响应体**

```json
{
	"status": "waiting_signature",
	"data": {
		"annual_cet": 26.0802,
		"cet": 1.95,
		"installments": [**],
		"disbursed_issue_amount": 2209.06,
		"contract_fees": [{
			"fee_amount": 22.71,
			"fee_type": "spread"
		}],
		"prefixed_interest_rate": {
			"created_at": "2023-07-21T16:30:07",
			"interest_base": "calendar_days_365",
			"annual_rate": 0.23872053,
			"monthly_rate": 0.018,
			"daily_rate": 0.00058669
		},
		"contract_fee_amount": 22.71,
		"requester_identifier_key": "af0e8a5d-650e-4348-b955-a424307c44df",
		"iof_charge_method": "financed",
		"external_contract_fee_amount": 0,
		"borrower": {
			"document_number": "04062377942",
			"related_party_key": "c3b213ee-897a-4e42-9697-6c0b56fb0020",
			"name": "TESTE TESTE"
		},
		"additional_iof": 8.629534,
		"entry": null,
		"external_contract_fees": [**],
		"collaterals": [**],
		"total_pre_fixed_amount": 1088.47822388,
		"contract": {
			"urls": [
				"https://storage.googleapis.com/live-doc-api/documents/a0e3678a-9d48-47e8-8e00-ed9435713588/teste.pdf"
			],
			"number": "0008938245/TT"
		},
		"net_external_contract_fee_amount": 0,
		"number_of_installments": 8,
		"total_iof": 61.87,
		"base_iof": 53.2421439,
		"issue_amount": 2270.93,
		"assignment_amount": 2293.64
	},
	"event_datetime": "2023-07-21 16:30:11",
	"webhook_type": "debt",
	"key": "01d62579-be1e-482f-b766-069786b44344"
}
```

STATUS 400

**响应体**

```json
{
  "data": "{\"title\": \"Bad Request\", \"description\": \"Collateral type social_security is not allowed for update related party.\", \"translation\": \"O tipo de garantia social_security não permite atualizar a parte relacionada.\", \"extra_fields\": {}, \"code\": \"COP000328\"}"
}
```

---

# 授权放款

URL: /zh-Hans/documentation/emissao_de_divida/autorizar_desembolso

## 请求

ENDPOINT /debt/ DEBT-KEY /allow_disbursement
MÉTODO POST

**请求体**

```json
{
   "allow_disbursement": true
}

```

### 路径参数

| 字段 | 类型 | 描述 |
|---|---| ---|
| `debt_key` *（必填）* | string | 已发行债务的 ID。 |

### 请求体参数

| 字段 | 类型 | 描述 |
|---|---| ---|
| `allow_disbursement` | string | 放款授权指示。 |

## 响应

STATUS 201

**响应体**

```json
{
  "additional_iof": 45.65,
  "credit_operation_key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
  "contract_number": "0000192840/AMT",
  "annual_cet": 226.17,
  "assigned": false,
  "assigned_at": null,
  "assignment_amount": 6844.51,
  "issue_amount": 6844.51,
  "disbursed_issue_amount": 6594,
  "final_disbursement_amount": 6594,
  "base_iof": 204.86,
  "calculus_correction": null,
  "cet": 10.35,
  "collateral_constituted": true,
  "collateral_type": null,
  "contract_fee_amount": 0,
  "external_contract_fee_amount": 0,
  "net_external_contract_fee_amount": 0,
  "creditor_bank_account_key": null,
  "disbursement_date": "2026-01-01",
  "disbursement_start_date": "2026-01-01",
  "disbursement_end_date": "2026-01-01",
  "first_due_date": "2026-12-10",
  "number_of_installments": 4,
  "interest_grace_period": 0,
  "interest_payment_month_period": 1,
  "interest_subsidy_amount": 0,
  "interest_subsidy_percentage": 0,
  "iof_charge_method": "financed",
  "ipoc_code": "3240250202021123456789090000542149/T",
  "issue_date": "2026-02-02",
  "issuer_document_number": "12345678909",
  "issuer_name": "teste",
  "origin_key": "8bf10bc5-345e-4d4c-b038-650bc7277c6e",
  "principal_amortization_month_period": 1,
  "principal_grace_period": 0,
  "purchaser_document_number": "32402502000135",
  "requester_key": "783ea550-9e70-4482-bcae-127a913b5b1e",
  "requester_identifier_key": "8bf10bc5-345e-4d4c-b038-650bc7277c6e",
  "settlement_bank_account_key": null,
  "share_quantity": 7,
  "third_party_account_key": "5d068423-6094-49e4-b15b-7740038295a8",
  "total_iof": 250.51,
  "is_allowed_to_disburse": true,
  "credit_operation_status": {
    "translation_path": "co.CreditOperationStatus.waiting_disbursement",
    "translation_ptbr": "Aguardando Desembolso",
    "enumerator": "waiting_disbursement"
  }
}

```

STATUS 400

**响应体**

```json
{
  "data": "{\"title\": \"Bad Request\", \"description\": \"Invalid request body.\", \"translation\": \"Corpo da requisição inválido.\", \"extra_fields\": {}, \"code\": \"LEG000069\"}"
}
```

---

# 放款前取消债务

URL: /zh-Hans/documentation/emissao_de_divida/cancelamento/cancelar_divida_antes_de_desembolsar

## 请求

ENDPOINT /debt/ DEBT-KEY /cancel
MÉTODO PATCH

## 响应

STATUS 200

响应体

```json
{
  "data": [
    {
      "borrower": {
        "document_number": "68394265057",
        "name": "Xuxa Meneguel"
      },
      "contract_fee_amount": 5.56,
      "installments": [
        {
          "bank_slip_key": null,
          "calendar_days": 57,
          "due_date": "2020-09-30",
          "due_principal": -0.00217819,
          "fine_amount": null,
          "has_interest": true,
          "installment_key": "28eb5907-ed25-4a86-bb9d-b6dc944f13df",
          "installment_number": 1,
          "installment_status": "opened",
          "installment_type": "principal",
          "paid_amount": 0,
          "post_fixed_amount": 0,
          "pre_fixed_amount": 268.75782181,
          "principal_amortization_amount": 1111.9,
          "tax_amount": 0,
          "total_amount": 1380.66,
          "workdays": 40
        }
      ],
      "operation_key": "7986dcc7-4331-478f-af47-adfbdf7f4a36",
      "status": "opened"
    }
  ],
  "pagination": {
    "current_page": 1,
    "next_page": null,
    "rows_per_page": 100,
    "total_pages": 1,
    "total_rows": 55
  }
}

```

STATUS 400

响应体

```json
{
  "title": "Bad Request",
  "description": "Operation cc5075bb-cfc3-4cd3-a9b5-527978de673c actual status does not allow cancel operation. Actual status is canceled",
  "translation": "Status da operação cc5075bb-cfc3-4cd3-a9b5-527978de673c não permite cancelamento.Status atual: canceled",
  "code": "LEG000073"
}
```

### 路径参数

| 字段 | 类型 | 描述 |
|---|---| ---|
| `debt_key` * | string | 创建信贷操作时返回的债务密钥。 |

---

# 永久取消

URL: /zh-Hans/documentation/emissao_de_divida/cancelamento/cancelar_permanentemente

## 请求

ENDPOINT /debt/ debt_key /cancel_permanently
MÉTODO POST

## 响应

STATUS 200

响应体

```json
{
  "data": {
    "additional_iof": 38000,
    "annual_cet": "253,2642%",
    "assignment_amount": 10000000,
    "base_iof": 69331,
    "borrower": {
      "document_number": "89940878025962",
      "name": "Parmalat"
    },
    "cet": "11,0900%",
    "collaterals": [],
    "contract": {
      "external_contract_key": "2f0b8b6e-0b60-47f0-b27f-e291c028549b",
      "number": "1907258737/P",
      "signature_information": [],
      "urls": []
    },
    "contract_fee_amount": 50000,
    "contract_fees": [
      {
        "fee_amount": 50000,
        "fee_type": "tac"
      }
    ],
    "external_contract_fee_amount": 0,
    "external_contract_fees": [],
    "installments": [],
    "iof_charge_method": "financed",
    "issue_amount": 10000000,
    "net_external_contract_fee_amount": 0,
    "number_of_installments": 10,
    "post_fixed_interest_base": "workdays",
    "post_fixed_interest_rate": 1,
    "prefixed_interest_rate": {
      "annual_rate": 2.32,
      "created_at": null,
      "daily_rate": 0.0033388,
      "interest_base": "calendar_days",
      "monthly_rate": 0.10516767
    },
    "requester_identifier_key": "b7ddbcfb-3de0-49d8-8014-07972d8b27f2",
    "total_iof": 107331,
    "total_pre_fixed_amount": 5935915.16
  },
  "event_datetime": "2022-05-12 16:53:10",
  "key": "b7ddbcfb-3de0-49d8-8014-07972d8b27f2",
  "status": "waiting_signature",
  "webhook_type": "debt"
}
```

STATUS 400

响应体

```json
{
  "data": "{\"title\": \"Bad Request\", \"description\": \"Invalid request body.\", \"translation\": \"Corpo da requisição inválido.\", \"extra_fields\": {}, \"code\": \"LEG000069\"}"
}

```

---

# 放款后七天内取消债务

URL: /zh-Hans/documentation/emissao_de_divida/cancelamento/desistencia/cancelamento_de_divida_em_ate_sete_dias_apos_o_desembolso

## 请求

ENDPOINT /debt/reversal
MÉTODO POST

请求体

```json
{
    "contract_number": "0000049343/TW"
}

```

## 响应

STATUS 200

响应体

```json
{
  "amount": "2026.93",
  "copy_paste_pix": "00020126930014br.gov.bcb.pix2571qrcode-h.dev.qitech.app/bacen/cobv/dece8d3e-32ce-439e-8204000053039865802BR5925Joao61080150400062070503***63046ECD",
  "expiration_date": "2022-09-28",
  "payer_document_number": "000000000008",
  "payer_name": "Teste",
  "reversal_key": "f98a1b7c-5e3c-4e6f-8887-c7fedfa0d5b5",
  "status": "waiting_payment"
}

```

STATUS 400

响应体

```json
{
  "data": "{\"title\": \"Bad Request\", \"description\": \"Invalid request body.\", \"translation\": \"Corpo da requisição inválido.\", \"extra_fields\": {}, \"code\": \"LEG000069\"}"
}

```

## 字段定义
| 字段 | 类型 | 描述 | 最大字符数 |
|-------------------|--------|--------------------------------|--------------|
| `contract_number` * | string | 信贷合同编号。 | |

---

# 查询退款 pix qr code

URL: /zh-Hans/documentation/emissao_de_divida/cancelamento/desistencia/consulta_de_pix_qr_code_de_devolucao

返回为处于取消流程中的信贷业务先前生成的退款 pix qr code。请在 `/debt/reversal` 创建退款后使用此接口,重新获取 qr code 数据(例如,用于再次向付款人展示)。

## 请求

ENDPOINT /credit_operation/{credit_operation_key}/pix_qrcode
MÉTODO GET

:::info
此请求没有请求体。必须将 `credit_operation_key` 作为 URL 中的路径参数传入。
:::

## 响应

STATUS 200

响应体

```json
{
  "amount": "2026.93",
  "copy_paste_pix": "00020126930014br.gov.bcb.pix2571qrcode-h.dev.qitech.app/bacen/cobv/dece8d3e-32ce-439e-8204000053039865802BR5925Joao61080150400062070503***63046ECD",
  "debt_key": "a1f3d9c0-8b7e-4c9f-9d1a-1234567890ab",
  "expiration_date": "2022-09-28",
  "payer_document_number": "000000000008",
  "payer_name": "Teste",
  "qr_code_key": "7c3e5b22-4d8e-4a6b-9f11-abcdef123456",
  "reversal_key": "f98a1b7c-5e3c-4e6f-8887-c7fedfa0d5b5",
  "status": "waiting_payment"
}
```

STATUS 404

响应体 — 未找到信贷业务

```json
{
  "data": "{\"title\": \"Not Found\", \"description\": \"Credit Operation not found\", \"translation\": \"Operação não encontrada\", \"extra_fields\": {}, \"code\": \"COP000027\"}"
}
```

响应体 — 未找到退款

```json
{
  "data": "{\"title\": \"Not Found\", \"description\": \"Reversal not found.\", \"translation\": \"Estorno não encontrado.\", \"extra_fields\": {}, \"code\": \"COP000205\"}"
}
```

## 字段定义

### 路径参数

| 字段 | 类型 | 描述 |
|------|------|------|
| `credit_operation_key` * | string (uuid) | 为其生成退款 pix qr code 的信贷业务的唯一标识。 |

### 响应字段

| 字段 | 类型 | 描述 |
|------|------|------|
| `amount` | string | 退款 pix qr code 的金额(单位:雷亚尔)。 |
| `copy_paste_pix` | string | 用于支付的 pix 复制粘贴码。 |
| `debt_key` | string (uuid) | 与退款关联的信贷业务(债务)标识。 |
| `expiration_date` | string (date) | pix qr code 的过期日期,格式为 `YYYY-MM-DD`。 |
| `payer_document_number` | string | 付款人的 CPF/CNPJ。 |
| `payer_name` | string | 付款人姓名。 |
| `qr_code_key` | string (uuid) | 已发行 pix qr code 的唯一标识。 |
| `reversal_key` | string (uuid) | 与该 pix qr code 关联的退款的唯一标识。 |
| `status` | string | pix qr code 的当前状态(例如 `waiting_payment`)。 |

---

# 简介

URL: /zh-Hans/documentation/emissao_de_divida/cancelamento/desistencia/introducao

鉴于《消费者保护法典》允许通过数字方式获取信贷的借款人在 7 天内取消债务，QI Tech 开发了专门的功能来满足这些情况。

## 运作方式

在 QI Tech 系统中，有两种方式可在 7 天内取消债务：

### 1 - 通过退还放款收到的金额

如果在放款日期后 7 天内识别到对操作已放款总金额的退还，无论是通过 PIX 冲销还是向放款源账户的新转账，系统将自动取消操作，原因为：'disbursed_amount_refunded'。

### 2 - 通过取消 API

通过端点 [POST /debt/reversal](cancelamento_de_divida_em_ate_sete_dias_apos_o_desembolso) ，可以生成 QR Code，一旦借款人付款，操作即被取消。

在两种情况下，一旦资金到达 QI Tech，操作即被取消，如果合同转让已经发生，则金额将冲销给受让方。

此端点可在放款后 7 天内使用，QR Code 的有效期设定为生成后 14 天——此期限后将无法再取消合同。

## 要求

为使此端点正常运行，需要联系 QI Tech 支持团队以解锁端点并配置受让方账户以冲销资金。

---

# 简介

URL: /zh-Hans/documentation/emissao_de_divida/cancelamento/introducao

通过 QI Tech 系统可执行两种类型的债务取消。

## 放款前取消债务

QI Tech 提供的放款前信贷操作取消服务，仅需向我们的 API 发出一个请求即可。

## 放款后七天内取消债务

QI Tech 提供的放款后七天内信贷操作取消服务，仅需向我们的 API 发出一个请求即可。

提交请求后，将返回 PIX QR Code。支付后，操作将被取消，所有冲销将自动执行。

## Webhook

付款确认后，我们的服务会执行所有冲销，并向客户发送 webhook，示例如下：

```json
{
   "reversal":{
      "date":"2022-09-06",
      "incoming_pix_transfer_key":null,
      "status":"pending_fund",
      "amount_to_send":2026.93,
      "third_party_account_key":"17e5120f-14f7-4802-8676-b63011154edf",
      "reversal_key":"eb0bbd1d-111d-4a61-bb65-c1f66a005ea2",
      "amount":2026.93,
      "is_total":true,
      "created_at":"2022-09-06T01:14:01",
      "is_operation_canceled":true,
      "transaction_key":null
   },
   "assigned_at":"None",
   "credit_operation_key":"2893b8bd-8f4e-4e45-9325-fc7003beb869",
   "assigned":true,
   "contract_number":"0000049333/TW"
}
```

:::info **七天后取消操作时需注意的主要事项：**

- 冲销申请必须在放款日期后的 8 个工作日内提出。

- 通过 QR Code 付款必须在放款日期后的 15 个工作日内完成。

- 信贷操作的当前状态不能是"未结"以外的状态。

- 不得有任何分期已付款。

- 当所有冲销成功执行后，系统每天运行一次例程，收集适当金额并发送给基金。

:::

---

# 配置放款日期

URL: /zh-Hans/documentation/emissao_de_divida/configurar_data_de_desembolso

## 请求

ENDPOINT /debt/ DEBT-KEY /set_disbursement_date
MÉTODO POST

**body.json**

```json
{
    "disbursement_date": "2021-09-01",
    "disbursement_bank_account": {
        "name": "Pedro Felipe Henrique Alves",
        "bank_code": "329",
        "account_digit": "1",
        "branch_number": "001",
        "account_number": "94632180173",
        "document_number": "026.923.850-63"
    }
}

```

:::caution **注意！**

 如果选择以多日期方式发行债务，则在合同签署后，必须通过此端点设置放款日期。

:::

### 路径参数

| 字段 | 类型 | 描述 |
|---|---| ---|
| `debt_key` * | string | 创建信贷操作时返回的债务密钥。 |

### 请求体参数

| 字段 | 类型 | 描述 | 字符数 |
|---|---|---|---|
| `disbursement_date` * | date | 操作的放款日期。 | 10 | 
| `disbursement_bank_account` | object | **[放款银行账户对象](#objeto-disbursement_bank_accounts)** - 操作放款的银行账户信息。 | | 

### 放款银行账户对象

放款银行信息可与放款日期一起更改，默认情况下，放款将转入债务人名下的账户。

| 字段 | 类型 | 描述 | 最大字符数 | 
|-----------------------|--------|----------------------------------------------------------------------------------------------------|--------------|
| name | string | 账户持有人姓名 | 50 |
| document_number | string | 账户持有人 CPF | 11 |
| bank_code * | string | 金融机构的 COMPE 代码（https://www.bcb.gov.br/pom/spb/estatistica/port/ASTR003.pdf） | 3 |
| branch_number * | string | 支行号码（请勿填写支行验证位！） | 4 |
| account_number * | string | 账号（不含验证位！） | 10 |
| account_digit * | string | 账户验证位（字母处填写零） | 1 |
| account_type | enum | [账户类型枚举值](#enumerador-account-type) 账户类型 | 1 |

## 响应

STATUS 400

**body.json**

```json
{
  "key": "25dd0a85-dbd7-453f-9076-d776a9ef7c3a",
  "event_datetime": "2022-03-29 15:30:20",
  "data": {},
  "webhook_type": "debt",
  "status": "disbursement_date_set"
}

```

STATUS 400

**body.json**

```json
{
  "data": "{\"title\": \"Bad Request\", \"description\": \"Invalid request body.\", \"translation\": \"Corpo da requisição inválido.\", \"extra_fields\": {}, \"code\": \"LEG000069\"}"
}
```

---

# 债务查询

URL: /zh-Hans/documentation/emissao_de_divida/consulta_de_divida

## 请求

ENDPOINT /debt
MÉTODO GET

## 查询参数
| 字段 | 类型 | 描述 | 字符数 |
|---|---|-------------------------------------------------------------------------| ---|
| `key` | string | 创建信贷操作时返回的债务密钥。 | - |
| `requester_identifier_key` | string | 创建债务时发送的 UUID4 密钥。 | - |
| `contract_number` | string | 债务发行时返回的 CCB 编号。 | - |
| `issuer_document_number` | string | 发行人的证件号码。 | - |
| `issuer_name` | string | 债务发行人姓名。 | - |
| `page_size` | string | 每页显示的结果数量。 | - |
| `status` | string | 操作状态。 | - |
| `page` | string | 当前查询的页码。 | - |
| `total_due_balance` | boolean | 当设置为 `true` 时，响应中将包含 `balance_due` 字段（操作的未偿总余额）。默认情况下（`false` 或不传），**不**返回 `balance_due`。 | - |

:::tip 未偿余额（`balance_due`）
`balance_due` 字段表示操作的未偿总余额，**仅当查询时携带 `total_due_balance=true` 参数才会返回**。否则响应不包含未偿余额。

请求示例：

```bash
GET /debt?contract_number=ABC1234&total_due_balance=true
```
:::

## 响应

STATUS 200

响应体：无参数查询

```json
{
  "data": [
    {
      "borrower": {
        "document_number": "68394265057",
        "name": "Xuxa Meneguel"
      },
      "contract_fee_amount": 5.56,
      "installments": [
        {
          "bank_slip_key": null,
          "calendar_days": 57,
          "due_date": "2020-09-30",
          "due_principal": -0.00217819,
          "fine_amount": null,
          "has_interest": true,
          "installment_key": "28eb5907-ed25-4a86-bb9d-b6dc944f13df",
          "installment_number": 1,
          "installment_status": "opened",
          "installment_type": "principal",
          "paid_amount": 0,
          "post_fixed_amount": 0,
          "pre_fixed_amount": 268.75782181,
          "principal_amortization_amount": 1111.9,
          "tax_amount": 0,
          "total_amount": 1380.66,
          "workdays": 40
        }
      ],
      "operation_key": "7986dcc7-4331-478f-af47-adfbdf7f4a36",
      "status": "opened"
    }
  ],
  "pagination": {
    "current_page": 1,
    "next_page": null,
    "rows_per_page": 100,
    "total_pages": 1,
    "total_rows": 55
  }
}

```

响应体：带参数查询

```json
{
  "data": {
    "additional_iof": 11.547136,
    "after_disbursement_actions": [],
    "all_day_disbursement": true,
    "annual_cet": 41.0883,
    "assigned": false,
    "assigned_at": null,
    "assignment_amount": 3038.72,
    "attached_document_list": [
      {
        "created_at": "2022-10-19T11:53:01",
        "document_key": "5df59dca-b8d1-4dca-8358-8b4bd944f3dc",
        "document_type": {
          "enumerator": "document_identification",
          "translation_path": "co.DocumentType.document_identification"
        },
        "document_url": "https://storage.googleapis.com/sandbox-doc-api/documents/5df59dca-b8d1-4dca-8358-8b4bd944f3dc/image_1666180300436.jpg",
        "related_party_key": null,
        "signature_required": false,
        "signature_url": null,
        "signed": false
      }
    ],
    "balance_due": 3150.62,
    "base_iof": 27.17569413,
    "calculus_correction": null,
    "central_depository": null,
    "cet": 2.91,
    "cetip_assignments": [],
    "cetip_settlements": [],
    "collateral_constituted": true,
    "collateral_type": null,
    "collaterals": [],
    "contract_fee_amount": 0,
    "contract_fees": [],
    "contract_number": "TESTE118261",
    "created_at": "2022-10-19T11:53:00",
    "credit_operation_key": "438ceaa3-2906-4ee3-85f9-0dcacd5f2581",
    "credit_operation_status": {
      "enumerator": "opened",
      "translation_path": "co.CreditOperationStatus.opened",
      "translation_ptbr": "Desembolsada"
    },
    "credit_operation_type": {
      "enumerator": "ccb",
      "translation_path": "co.CreditOperationType.ccb"
    },
    "credit_rating": null,
    "creditor_bank_account_key": "5d068423-6094-49e4-b15b-7740038295a8",
    "custodian": {
      "enumerator": "qi_scd",
      "translation_path": "co.Custodian.qi_scd"
    },
    "decimal_annual_cet": 0.43241941956989105,
    "decimal_cet": 0.0304,
    "disburse_before_assign": true,
    "disbursed_at": "2022-10-19T11:54:47",
    "disbursed_issue_amount": 3000,
    "disbursement_account": [
      {
        "account_branch": "1234",
        "account_digit": "1",
        "account_number": "2345678601",
        "account_type": "checking_account",
        "amount_receivable": null,
        "created_at": "2022-10-19T11:53:01",
        "digitable_line": null,
        "disbursement_type": "pix",
        "document_number": "92147661180",
        "financial_institutions": {
          "code_number": 104,
          "is_active": true,
          "is_pix_participant": true,
          "ispb": "00360305",
          "name": "CAIXA ECONOMICA FEDERAL"
        },
        "financial_institutions_code_number": 104,
        "is_pix_disbursement": true,
        "ispb": "00360305",
        "name": "104 CAIXA ECONOMICA FEDERAL",
        "percentage_receivable": 100,
        "pix_key": null,
        "pix_transfer_key": "da80477f-412e-40a5-81b0-c830b238081e",
        "pix_type": "manual",
        "qr_code_key": null,
        "retry_counter": 0,
        "retry_vector": null,
        "transaction_key": null,
        "webhook_key": null
      }
    ],
    "disbursement_callback": {
      "installments": [
        {
          "bank_slip_key": "9d8c566a-c865-495e-8764-db8351e7ac41",
          "digitable_line": "32990001031000699925348000000207991730000055231",
          "due_date": "2022-11-18",
          "qr_code_key": "bdd41d56-8588-4468-9705-5233994cdc39",
          "qr_code_url": "00020126970014br.gov.bcb.pix2575qrcode-h.sandbox.qitech.app/bacen/cobv/bdd41d56-8588-4468-9705-5233994cdc395204000053039865802BR5925QI SOCIEDADE DE CREDITO D6009Sao Paulo61080145200062070503***63044F44"
        }
      ],
      "key": "438ceaa3-2906-4ee3-85f9-0dcacd5f2581",
      "origin_type": "lego-api",
      "status": "opened",
      "transaction_receipts": [
        {
          "amount": 3000,
          "description": "00360305 1234 2345678601-1 92147661180 - 104 CAIXA ECONOMICA FEDERAL",
          "destination": {
            "account_digit": "1",
            "account_number": "2345678601",
            "bank_ispb": "00360305",
            "branch": "1234",
            "branch_digit": null,
            "document": "92147661180",
            "name": "104 CAIXA ECONOMICA FEDERAL",
            "purpose": "Crédito PIX em Conta",
            "type": "checking_account"
          },
          "fee": 0,
          "origin": {
            "account_branch": "0001",
            "account_digit": "5",
            "account_key": "5d068423-6094-49e4-b15b-7740038295a8",
            "account_number": "00002",
            "bank_code": "329",
            "branch": "0001",
            "branch_digit": null,
            "document": "32402502000135",
            "name": "QI SOCIEDADE DE CRÉDITO DIRETO S.A.",
            "type": "payment_account"
          },
          "origin_transaction_key": null,
          "timestamp": "2022-10-19T11:55:03",
          "transaction_key": "da80477f-412e-40a5-81b0-c830b238081e"
        }
      ]
    },
    "disbursement_confirmed_at": "2022-10-20T13:00:56",
    "disbursement_date": "2022-10-19",
    "disbursement_end_date": "2022-10-19",
    "disbursement_inelegibility_reason": null,
    "disbursement_inelegibility_reason_issued": null,
    "disbursement_options": [
      {
        "additional_iof": 11.547136,
        "annual_cet": 41.0883,
        "assignment_amount": 3038.72,
        "base_iof": 27.17569413,
        "calculus_correction": null,
        "cet": 2.91,
        "contract_fee_amount": 0,
        "contract_fees": [],
        "created_at": "2022-10-19T11:53:01",
        "disbursed_issue_amount": 3000,
        "disbursement_date": "2022-10-19",
        "external_contract_fee_amount": 0,
        "external_contract_fees": [],
        "first_due_date": "2022-11-18",
        "installments": [
          {
            "additional_costs": [],
            "business_due_date": "2022-11-21",
            "calendar_days": 30,
            "created_at": "2022-10-19T11:53:01",
            "due_date": "2022-11-18",
            "due_interest": 0,
            "due_principal": 3038.72,
            "fine_amount": null,
            "has_interest": true,
            "installment_number": 1,
            "post_fixed_amount": 0,
            "pre_fixed_amount": 75.66402982,
            "principal_amortization_amount": 476.64597018,
            "tax_amount": 1.17254909,
            "total_amount": 552.31,
            "workdays": 20
          }
        ],
        "interest_subsidy_amount": 0,
        "issue_amount": 3038.72,
        "net_external_contract_fee_amount": 0,
        "prefixed_interest_rate": null,
        "share_quantity": 4,
        "total_iof": 38.72
      }
    ],
    "disbursement_start_date": "2022-10-19",
    "document_certifier": {
      "enumerator": "electronic_client_side",
      "translation_path": "co.DocumentCertifier.electronic_client_side"
    },
    "early_settlement_configuration": {
      "created_at": "2022-10-19T11:53:00",
      "early_settlement_configuration_type": {
        "enumerator": "fixed_rate",
        "translation_path": "co.EarlySettlementConfigurationType.fixed_rate"
      },
      "effective_end_date": null,
      "fixed_interest_rate": 0
    },
    "endorsement": null,
    "entry": null,
    "events": [],
    "external_contract_fee_amount": 0,
    "external_contract_fees": [],
    "extra_fields": null,
    "facial_biometrics_enabled": false,
    "final_disbursement_amount": 3000,
    "financial_index": null,
    "fine_configuration": {
      "contract_fine_rate": 0.02,
      "created_at": "2022-10-19T11:53:00",
      "fine_delay_rate": {
        "annual_rate": 0.12682503,
        "created_at": "2022-10-19T11:53:00",
        "daily_rate": 0.00033173,
        "interest_base": {
          "enumerator": "calendar_days",
          "translation_path": "co.InterestBase.calendar_days",
          "year_days": 360
        },
        "monthly_rate": 0.01
      }
    },
    "first_due_date": "2022-11-18",
    "first_due_date_delay": null,
    "if_code": null,
    "installments": [
      {
        "accrual_reference_date": null,
        "additional_costs": [],
        "advanced_paid_amount": 0,
        "bank_slip_key": "9d8c566a-c865-495e-8764-db8351e7ac41",
        "business_due_date": "2022-11-21",
        "calendar_days": 30,
        "cetip_settlements": [],
        "created_at": "2022-10-19T11:53:00",
        "digitable_line": "32990001031000699925348000000207991730000055231",
        "due_date": "2022-11-18",
        "due_interest": 0,
        "due_principal": 3038.72,
        "events": [],
        "fine_amount": 13.02,
        "has_interest": true,
        "installment_key": "1d76836e-1fcc-4b67-8c01-64faa43de9c8",
        "installment_number": 1,
        "installment_payment": [],
        "installment_status": {
          "enumerator": "overdue",
          "translation_path": "co.InstallmentStatus.overdue"
        },
        "installment_type": {
          "enumerator": "principal",
          "translation_path": "co.InstallmentType.principal"
        },
        "original_due_principal": 3038.72,
        "original_pre_fixed_amount": 75.66402982,
        "original_principal_amortization_amount": 476.64597018,
        "original_total_amount": 552.31,
        "paid_amount": 0,
        "paid_at": null,
        "payment_type": {
          "enumerator": "bankslip",
          "translation_path": "co.PaymentType.bankslip"
        },
        "post_fixed_amount": 0,
        "pre_fixed_amount": 75.66402982,
        "principal_amortization_amount": 476.64597018,
        "qr_code_key": "bdd41d56-8588-4468-9705-5233994cdc39",
        "qr_code_url": "00020126970014br.gov.bcb.pix2575qrcode-h.sandbox.qitech.app/bacen/cobv/bdd41d56-8588-4468-9705-5233994cdc395204000053039865802BR5925QI SOCIEDADE DE CREDITO D6009Sao Paulo61080145200062070503***63044F44",
        "renegotiation_proposal_key": null,
        "tax_amount": 1.17254909,
        "total_accrual_amount": null,
        "total_amount": 565.33,
        "total_paid_amount": 0,
        "updated_at": "2022-11-29T09:17:44",
        "workdays": 20
      }
    ],
    "interest_grace_period": 0,
    "interest_payment_month_period": 1,
    "interest_subsidy_amount": 0,
    "interest_subsidy_percentage": 0,
    "interest_type": {
      "enumerator": "pre_price_days",
      "translation_path": "co.InterestType.pre_price_days"
    },
    "iof_charge_method": "financed",
    "ipoc_code": "324025020203192147661180DiDi118261",
    "is_allowed_to_disburse": true,
    "is_portability": false,
    "is_refinancing": 0,
    "isin_number": null,
    "issue_amount": 3038.72,
    "issue_date": "2022-10-19",
    "issuer_document_number": "92147661180",
    "issuer_name": "Wxy  Wsx",
    "kyc": null,
    "modality": {
      "code": "0203",
      "description": "crédito pessoal - sem consignação em folha de pagam.",
      "enumerator": null,
      "visible": true
    },
    "net_external_contract_fee_amount": 0,
    "next_due_date": "2022-12-19",
    "number_of_installments": 6,
    "operation_extra_fields": null,
    "operation_type": {
      "enumerator": "structured_operation",
      "translation_path": "co.OperationType.structured_operation"
    },
    "origin_key": "438ceaa3-2906-4ee3-85f9-0dcacd5f2581",
    "origin_type": {
      "enumerator": "lego-api",
      "translation_path": "co.OriginType.lego-api"
    },
    "original_prefixed_interest_rate": {
      "annual_rate": 0.34331516,
      "created_at": "2022-10-19T11:53:00",
      "daily_rate": 0.00082017,
      "interest_base": {
        "enumerator": "calendar_days",
        "translation_path": "co.InterestBase.calendar_days",
        "year_days": 360
      },
      "monthly_rate": 0.0249
    },
    "original_total_iof": 38.72,
    "payment_and_settlement_agent": {
      "enumerator": "qi_scd",
      "translation_path": "co.PaymentAndSettlementAgent.qi_scd"
    },
    "payment_type": {
      "enumerator": "bankslip",
      "translation_path": "co.PaymentType.bankslip"
    },
    "payroll_data": null,
    "portability_amount": null,
    "portability_financial_institution_code_number": null,
    "portability_original_contract": null,
    "post_fixed_interest_base": {
      "enumerator": "workdays",
      "translation_path": "co.InterestBase.workdays",
      "year_days": 252
    },
    "post_fixed_interest_rate": null,
    "prefixed_interest_rate": {
      "annual_rate": 0.34331516,
      "created_at": "2022-10-19T11:53:00",
      "daily_rate": 0.00082017,
      "interest_base": {
        "enumerator": "calendar_days",
        "translation_path": "co.InterestBase.calendar_days",
        "year_days": 360
      },
      "monthly_rate": 0.0249
    },
    "principal_amortization_month_period": 1,
    "principal_grace_period": 0,
    "purchaser_document_number": "32402502000135",
    "rebate_account": null,
    "refinanced_credit_operations": [],
    "registration_institution": {
      "enumerator": "qi_scd",
      "translation_path": "co.RegistrationInstitution.qi_scd"
    },
    "related_party_list": [
      {
        "address": {
          "city": "Aguascalientes",
          "complement": null,
          "created_at": "2022-10-19T11:52:59",
          "neighborhood": "Aguascalientes",
          "number": "1",
          "postal_code": "20000000",
          "state": "SP",
          "street": "Zona Centro"
        },
        "attached_document_list": [],
        "birth_date": "1997-10-19",
        "email": "wxr@ff.com",
        "income": 0.01,
        "individual_document_number": "92147661180",
        "is_pep": false,
        "marital_status": {
          "enumerator": "single",
          "translation_path": "co.MaritalStatus.single"
        },
        "name": "Wxy  Wsx",
        "nationality": "nationality",
        "person_type": "natural",
        "related_party_key": "203b2ada-ff3e-44a6-a843-f244aa1afbc9",
        "role_type": {
          "enumerator": "issuer",
          "translation_path": "co.RoleType.issuer"
        }
      }
    ],
    "requester_identifier_key": "89bb875a4a654ecfbad0c6ce0b3b5037",
    "requester_key": "75f2ab85-a5ce-40b9-9b1e-915175906d78",
    "requester_name": "DiDi Global (99Pay)",
    "resource_source_account": {
      "enumerator": "third_party",
      "translation_path": "co.ResourceSourceAccount.third_party"
    },
    "selfie_enabled": false,
    "settlement_bank_account_key": null,
    "share_quantity": 4,
    "signature_method": {
      "enumerator": "email"
    },
    "tax_configuration": {
      "created_at": "2019-03-15T13:09:32",
      "iof_additional_rate": 0.0038,
      "iof_rate": 0.000082
    },
    "tax_exempt_amount": null,
    "third_party_account_key": "5d068423-6094-49e4-b15b-7740038295a8",
    "total_iof": 38.72
  },
  "operation_key": "438ceaa3-2906-4ee3-85f9-0dcacd5f2581",
  "status": "opened",
  "webhook_type": "signed_debt"
}

```

STATUS 400

响应体

```json
{
  "data": "{\"title\": \"Bad Request\", \"description\": \"Invalid request body.\", \"translation\": \"Corpo da requisição inválido.\", \"extra_fields\": {}, \"code\": \"LEG000069\"}"
}

```

## 查询参数
| 字段 | 类型 | 描述 | 字符数 |
|---|---|-------------------------------------------------------------------------| ---|
| `key` | string | 创建信贷操作时返回的债务密钥。 | - |
| `requester_identifier_key` | string | 创建债务时发送的 UUID4 密钥。 | - |
| `contract_number` | string | 债务发行时返回的 CCB 编号。 | - |
| `issuer_document_number` | string | 发行人的证件号码。 | - |
| `issuer_name` | string | 债务发行人姓名。 | - |
| `page_size` | string | 每页显示的结果数量。 | - |
| `status` | string | 操作状态。 | - |
| `page` | string | 当前查询的页码。 | - |
| `total_due_balance` | boolean | 当设置为 `true` 时，响应中将包含 `balance_due` 字段（操作的未偿总余额）。默认情况下，**不**返回 `balance_due`。 | - |

---

# 按合同编号查询债务

URL: /zh-Hans/documentation/emissao_de_divida/consulta_por_contract_number

## 请求

ENDPOINT /v2/credit_operation/contract_number/ CONTRACT-NUMBER
MÉTODO GET

## ⚠️ 重要说明

如果合同编号中包含斜杠（`/`），需要将斜杠**编码**为 `%2F`。

### 实际示例
**原始输入：**
```
contract_number = 02159312/FGP
```

**应发送为：**
```
02159312%2FFGP
```

### Python 编码示例：
```python
import urllib.parse

contract_number = "02159312/FGP"
encoded_contract_number = urllib.parse.quote(contract_number)
print(encoded_contract_number)  # 02159312%2FFGP
```

:::

### 路径参数

| 字段 | 类型 | 描述 | 字符数 |
|---|---|---|---|   
| `contract_number` * | string | 信贷合同编号。 | string |

## 响应

STATUS 200

响应体

```json
{
  "credit_operation_key": "eaf5836a-ea6f-4baa-ac26-ce5199dfa448",
  "issue_amount": 1006.77,
  "origin_key": "52539e23-5c01-4b9c-8a68-6ed750ec7bc5",
  "assigned_at": "2025-08-24T10:00:00Z",
  "total_iof": 6.77,
  "disbursement_start_date": "2022-08-24",
  "disbursement_end_date": "2022-08-24",
  "issue_date": "2022-08-24",
  "requester_identifier_key": "5cb7456c-f2e3-41b3-b17a-ad47ba3c3cda",
  "installments": [
    {
      "business_due_date": "2022-08-30",
      "due_date": "2022-08-29",
      "calendar_days": 5,
      "due_interest": 0,
      "due_principal": 1006.77,
      "fine_amount": 0,
      "has_interest": true,
      "post_fixed_amount": 0,
      "pre_fixed_amount": 18.93,
      "principal_amortization_amount": 363.14,
      "tax_amount": 0.15,
      "total_amount": 382.07,
      "workdays": 3,
      "accrual_reference_date": null,
      "advanced_paid_amount": 0.0,
      "bank_slip_key": null,
      "digitable_line": null,
      "installment_key": "b56f61ec-202c-4a7a-8a5e-11f90972bae8",
      "installment_status": "created",
      "installment_type": "principal",
      "original_due_principal": 1006.77,
      "original_pre_fixed_amount": 18.93,
      "original_principal_amortization_amount": 363.14,
      "paid_amount": 0.0,
      "original_total_amount": 382.07,
      "qr_code_key": null,
      "qr_code_url": null,
      "renegotiation_proposal_key": null,
      "total_accrual_amount": 0,
      "total_paid_amount": 0,
      "installment_number": 1,
      "paid_at": null,
      "updated_at": null,
      "principal_amortization_payment_amount": 0,
      "prefixed_interest_payment_amount": 0
    }
  ],
  "first_due_date": "2022-08-29",
  "requester_key": "52f36417-368e-4f5b-8841-71e3b9caa72f",
  "original_total_iof": 6.77,
  "contract_number": "0000000001/WO",
  "credit_operation_status_enumerator": "waiting_signature",
  "operation_type_enumerator": "structured_operation",
  "disbursement_date": "2022-08-24",
  "issuer_name": "Wilker Oliveiraço",
  "issuer_document_number": "37197645832",
  "external_contract_fees": []
}
```

STATUS 400

响应体

```json
{
  "data": "{\"title\": \"Bad Request\", \"description\": \"Invalid request body.\", \"translation\": \"Corpo da requisição inválido.\", \"extra_fields\": {}, \"code\": \"LEG000069\"}"
}
```

---

# 按信贷操作密钥查询债务

URL: /zh-Hans/documentation/emissao_de_divida/consulta_por_credit_operation_key

## 请求

ENDPOINT /v2/credit_operation/ CREDIT-OPERATION-KEY
MÉTODO GET

### 路径参数

| 字段 | 类型 | 描述 | 字符数 |
|---|---|---|---|   
| `credit_operation_key` * | string | 信贷操作的密钥。 | UUID |

## 响应

STATUS 200

响应体

```json
{
  "credit_operation_key": "eaf5836a-ea6f-4baa-ac26-ce5199dfa448",
  "issue_amount": 1006.77,
  "origin_key": "52539e23-5c01-4b9c-8a68-6ed750ec7bc5",
  "total_iof": 6.77,
  "disbursement_start_date": "2022-08-24",
  "disbursement_end_date": "2022-08-24",
  "assigned_at": "2025-08-24T10:00:00Z",
  "issue_date": "2022-08-24",
  "requester_identifier_key": "5cb7456c-f2e3-41b3-b17a-ad47ba3c3cda",
  "installments": [],
  "first_due_date": "2022-08-29",
  "requester_key": "52f36417-368e-4f5b-8841-71e3b9caa72f",
  "original_total_iof": 6.77,
  "contract_number": "0000000001/WO",
  "credit_operation_status_enumerator": "waiting_signature",
  "operation_type_enumerator": "structured_operation",
  "disbursement_date": "2022-08-24",
  "issuer_name": "Wilker Oliveiraço",
  "issuer_document_number": "37197645832",
  "external_contract_fees": []
}
```

STATUS 400

响应体

```json
{
  "data": "{\"title\": \"Bad Request\", \"description\": \"Invalid request body.\", \"translation\": \"Corpo da requisição inválido.\", \"extra_fields\": {}, \"code\": \"LEG000069\"}"
}
```

---

# 按请求标识符密钥查询债务

URL: /zh-Hans/documentation/emissao_de_divida/consulta_por_requester_identifier_key

## 请求

ENDPOINT /v2/credit_operation/requester_identifier_key/ REQUESTER-IDENTIFIER-KEY
MÉTODO GET

### 路径参数

| 字段 | 类型 | 描述 | 字符数 |
|---|---|---|---|   
| `requester_identifier_key` * | string | 创建债务时发送的 UUID4 密钥。 | UUID |

## 响应

STATUS 200

响应体

```json
{
  "credit_operation_key": "eaf5836a-ea6f-4baa-ac26-ce5199dfa448",
  "issue_amount": 1006.77,
  "origin_key": "52539e23-5c01-4b9c-8a68-6ed750ec7bc5",
  "total_iof": 6.77,
  "disbursement_start_date": "2022-08-24",
  "disbursement_end_date": "2022-08-24",
  "assigned_at": "2025-08-24T10:00:00Z",
  "issue_date": "2022-08-24",
  "requester_identifier_key": "5cb7456c-f2e3-41b3-b17a-ad47ba3c3cda",
  "installments": [],
  "first_due_date": "2022-08-29",
  "requester_key": "52f36417-368e-4f5b-8841-71e3b9caa72f",
  "original_total_iof": 6.77,
  "contract_number": "0000000001/WO",
  "credit_operation_status_enumerator": "waiting_signature",
  "operation_type_enumerator": "structured_operation",
  "disbursement_date": "2022-08-24",
  "issuer_name": "Wilker Oliveiraço",
  "issuer_document_number": "37197645832",
  "external_contract_fees": []
}
```

STATUS 400

响应体

```json
{
  "data": "{\"title\": \"Bad Request\", \"description\": \"Invalid request body.\", \"translation\": \"Corpo da requisição inválido.\", \"extra_fields\": {}, \"code\": \"LEG000069\"}"
}
```

---

# 操作放款

URL: /zh-Hans/documentation/emissao_de_divida/desembolso_da_operacao

操作放款是指释放信贷合同资金，在 QI Tech 中，放款方式遵循信贷产品的配置，如放款配置中所详述。

:::info 信息
默认情况下，操作通过 PIX 向操作中提供的账户放款，但可选择以下五种方式：

**1- 带账户信息的 PIX**；

**2- 带密钥的 PIX**；

**3- TED**；

**4- PIX QR Code**；

**5- Boleto**；

这些方式具有特定字段，在合同发行的"disbursement_bank_accounts"键中有详细说明。
:::

QI Tech 的放款例程每分钟运行一次，检查是否满足针对该特定合同所配置产品的所有要求，并更改其状态。

## 放款要求

- **放款日期**

信贷操作合同仅在设定为"disbursement_date"的日期放款。

- **信贷合同已发行并签署**

操作的信贷合同必须已发行并签署。

- **担保已设立**

对于需要担保的操作，必须先设立担保才能继续放款。

- **放款审批**

如果"放款审批"配置处于激活状态，则合同只有在 API 审批调用之后才会放款。

- **有首付款的操作需已付款**

如果所创建的操作包含首付款参数，则只有在 QI Tech 系统中完成付款和财务清算后才能放款。

- **限额对齐**

必须有可用的信用额度，操作才能被放款。

---

# 个人债务发行

URL: /zh-Hans/documentation/emissao_de_divida/emissao/emissao_de_divida_pf

使用债务发行 API，可以为自然人申请发行债务。无需提前注册借款人，只需在申请时提供注册数据即可。

:::danger 注意！

QI Tech 提供新客户入驻和反欺诈解决方案。

如需报价，请联系我们的商务团队：

comercial@qitech.com.br 或 (11) 3522-1301
:::

债务 API 设计为只需执行一次请求即可完成，需在提前上传文件（[文档上传](../../upload_de_documentos)）之后执行。
请求头和请求体的签名格式详情请参见[此处](../../primeiros_passos/teste_de_autenticacao)。

## 请求

ENDPOINT /debt
MÉTODO POST

请求体

```json
{
    "borrower": {
        "name": "Alan Mathison Turing",
        "email": "alan.turing@email.com",
        "phone": {
            "number": "912345678",
            "area_code": "11",
            "country_code": "055"
        },
        "is_pep": false,
        "address": {
            "city": "São Paulo",
            "state": "SP",
            "number": "1000",
            "street": "Avenida Feliz",
            "complement": "AP 801",
            "postal_code": "49026100",
            "neighborhood": "Centro"
        },
        "role_type": "issuer",
        "birth_date": "1990-11-20",
        "mother_name": "Nome da Mãe do Alan",
        "nationality": "brasileiro",
        "person_type": "natural",
        "individual_document_number": "96969879003",
        "document_identification": "494598fd-c226-4332-a500-591ae3884673"
    },
    "financial": {
        "disbursed_amount": 123456,
        "interest_type": "pre_price_days",
        "credit_operation_type": "ccb",
        "monthly_interest_rate": 0.018,
        "disbursement_date": "2026-03-01",
        "rebates": [
            {
                "amount": 10,
                "fee_type": "tac",
                "amount_type": "absolute",
                "rebate_bank_account": {
                    "name": "CONTA BANCARIA",
                    "bank_code": "329",
                    "account_digit": "1",
                    "branch_number": "0001",
                    "account_number": "00003",
                    "document_number": "32402502000135"
                }
            }
        ],
        "interest_grace_period": 0,
        "principal_grace_period": 0,
        "number_of_installments": 2,
        "fine_configuration": {
            "contract_fine_rate": 0.02,
            "interest_base": "calendar_days",
            "monthly_rate": 0.01
        }
    },
    "disbursement_bank_account": {
        "name": "Alan Mathison Turing",
        "document_number": "96969879003",
        "bank_code": "341",
        "branch_number": "8615",
        "account_number": "22110",
        "account_digit": "2",
        "account_type": "checking_account"
    },
    "purchaser_document_number": "32402502000135",
    "credit_agent": {
        "document_number": "87237271016",
        "name": "Agente de credito"
    }
}
```

:::warning 注意
`credit_agent` 对象代表信贷代理（有时称为"pastinha"），负责该债务的来源开发。对于代扣工资贷款的发行，该字段为必填项。
:::

## 响应

此次债务请求的响应将返回还款计划以及 **DEBT-KEY**，即债务在 QI SCD 中的标识符。

STATUS 200

响应体

```json
{
    "webhook_type": "debt",
    "key": "1baea8a0-0fca-4f7c-8857-a227d4da72f8",
    "status": "waiting_signature",
    "event_datetime": "2025-03-27 22:46:10",
    "data": {}
}
```

## 定义

### 请求体对象
| 字段 | 类型 | 描述 | 最大字符数 | 
|---------------------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------|
| **borrower** * | object | **[Borrower 对象](#objeto-borrower)** - 信贷操作的债务人 | - | 
| **disbursement_bank_account** * | object | **[Disbursement Bank Account 对象](#objeto-disbursement_bank_accounts)** - 操作放款的银行账户数据 | - |
| **financial** * | object | **[Financial 对象](#objeto-financial)** - 操作放款的银行账户数据，标识所发送的对象为自然人。borrower PF 时必须始终包含 "natural" 值 | - |
| **purchaser_document_number** * | string | 信贷操作受让人（买方）的 CNPJ | - |

### Borrower 对象
| 字段 | 类型 | 描述 | 最大字符数 | 
|----------------------------------|---------|---------------------------------------------------------------------------------------|--------------|
| **name** * | string | 债务人姓名 | 100 |
| **email** | string | 债务人电子邮件 | 254 |
| **phone** | object | **[Phone 对象](#objeto-phone)** - 债务人联系电话 | - | 
| **is_pep** * | boolean | PEP 指示器（http://www.portaldatransparencia.gov.br/download-de-dados/pep） | - |
| **address** * | object | **[Address 对象](#objeto-address)** - 债务人地址 | - | 
| **role_type** * | enum | 默认值：_issuer_ | - |
| **birth_date** * | date | 债务人出生日期（格式 "YYYY-MM-DD"） | - |
| **mother_name** * | string | 债务人母亲姓名 | 100 |
| **nationality** | string | 债务人国籍 | 50 |
| **person_type** * | string | 自然人标识 - 默认值：_natural_ | - |
| **individual_document_number** * | string | 债务人 CPF（仅数字） | 11 |
| **document_identification** * | string | 带照片的债务人身份证明文件 PDF 的 **DOCUMENT_KEY**（身份证或驾驶证） | - |
| **document_identification_back** | string | 带照片的身份证明文件背面 PDF 的 DOCUMENT_KEY（身份证或驾驶证）（预先上传）。 | 11 |
| **wedding_certificate** | string | 结婚证 PDF 的 DOCUMENT_KEY（预先上传）。若 marital_status 为 "single"，该字段值应为 NULL。 | 11 |
| **proof_of_residence** * | string | 所提供地址的居住证明 PDF 的 DOCUMENT_KEY（预先上传）。 | 11 |

### Address 对象
| 字段 | 类型 | 描述 | 最大字符数 | 
|--------------------|--------|--------------------------------------------------------------------------|--------------| 
| **city** * | string | 地址所在城市 | 100 |
| **state** * | string | 地址所在州（两位大写字母） | 2 |
| **number** * | string | 门牌号 | 10 |
| **street** * | string | 街道名称 | 100 |
| **complement** * | string | 地址补充信息（自由文本） | 100 |
| **postal_code** * | string | 邮政编码（http://www.buscacep.correios.com.br/sistemas/buscacep/） | 8 |
| **neighborhood** * | string | 社区/街区名称 | 100 |

### Phone 对象
| 字段 | 描述 | 示例 | 最大字符数 | 
|--------------------|-----------|-------------------------------------------------------|--------------| 
| **number** * | string | 电话号码 | 10 |
| **area_code** * | string | 区号（https://ddd.guiamais.com.br/） | 2 |
| **country_code** * | string | 国家代码（https://ddi.guiamais.com.br/） | 3 |

### Disbursement Bank Account 对象

债务发行必须包含放款的银行账户信息，默认情况下为债务人名下的账户。

| 字段 | 类型 | 描述 | 最大字符数 | 
|-----------------------|--------|----------------------------------------------------------------------------------------------------|--------------|
| name | string | 账户持有人姓名 | 50 |
| document_number | string | 账户持有人 CPF | 11 |
| bank_code * | string | 金融机构的 COMPE 代码（https://www.bcb.gov.br/pom/spb/estatistica/port/ASTR003.pdf） | 3 |
| branch_number * | string | 支行号码（请勿填写支行验证位！） | 4 |
| account_number * | string | 账号（不含验证位！） | 10 |
| account_digit * | string | 账户验证位（字母处填写零） | 1 |
| account_type | enum | [账户类型枚举值](#enumerador-account-type) 账户类型 | 1 |

### Financial 对象

Financial 对象描述信贷操作的财务信息。

| 字段 | 类型 | 描述 | 最大字符数 |
|----------------------------|--------|---------------------------------------------------------------------------------------------------------------|--------------|
| **amout** | float | 信贷操作的发行/名义金额 | - |
| **interest_type** | object | **[利率类型枚举值](#enumerador-interest-type)** - 摊销方法和利率计算方式 | - |
| **credit_operation_type** | object | **[信贷操作类型枚举值](#enumerador-credit-operation-type)** - 信贷合同类型 | - |
| **annual_interest_rate** | float | 以年化小数表示的固定利率 | - |
| **disbursement_date** | date | 操作放款日期 | - |
| **interest_grace_period** | int | 利息宽限期（月） | - |
| **principal_grace_period** | int | 本金宽限期 | - |
| **number_of_installments** | int | 信贷操作的分期数 | - |
| **fine_configuration** | object | **[Fine Configuration 对象](#objeto-fine-configuration)** - 逾期利息和罚款配置 | - |

### Fine Configuration 对象

Fine Configuration 对象中填写信贷操作的逾期罚款和利息金额。

| 字段 | 类型 | 描述 | 最大字符数 |
|------------------------|-------|--------------------------------------------------------------------------------------|--------------|
| **contract_fine_rate** | float | 逾期罚款百分比 | - |
| **interest_base** | enum | **[利率基准枚举值](#enumerador-interest-base)** - 利率计算基准 | - |
| **monthly_rate** | float | 月逾期利率 | - |

### Rebates 对象
| 字段 | 类型 | 描述 | 最大字符数 | 
|---------------------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------|
| **fee_type** * | enum | 费用类型。 | - | 
| **amount_type** * | object | 收取金额的类型。 | - |
| **amount** * | object | 费用金额。若费用类型为百分比，则值应在 0 到 100 之间。 | - |

### 响应体
| 字段 | 类型 | 描述 | 最大字符数 |
|----------------------------|--------|----------------------------------------------------------------|--------------|
| **data[n].data** | object | **[Data 对象](#objeto-data)** | - |
| **data[n].event_datetime** | date | 信贷操作生成时刻 | - |
| **data[n].key** | string | **DEBT-KEY** - QI 内信贷操作的唯一密钥 | - |
| **data[n].status** | string | **[债务可能的状态](../status_de_uma_divida)** | - |
| **data[n].type** | string | _debt_ | - |

# 枚举值

### _Person Type_ 枚举值
| 枚举值 | 描述 |
|------------------------|-----------------------|
| **legal** | 法人 |
| **natural** | 自然人 |

### _Amount Type_ 枚举值
| 枚举值 | 描述 |
|------------------------|-----------------------|
| **tac** | 向借款人收取的费用。 |
| **spread** | 向基金收取并加入操作转让价格的费用。 |

### _Account Type_ 枚举值
| 枚举值 | 描述 |
|------------------------|-----------------------|
| **checking_account** | 活期账户 |
| **deposit_account** | 存款账户 |
| **guaranteed_account** | 担保账户 |
| **investment_account** | 投资账户 |
| **payment_account** | 支付账户 |
| **saving_account** | 储蓄账户 |
| **salary_account** | 工资账户 |

### _Interest Type_ 枚举值
| 枚举值 | 描述 |
|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **pre_price_days** | Price 摊销法（等额分期），按日计算固定利率 |
| **pre_price** | Price 摊销法（等额分期），按固定周期（30天）计算固定利率 |
| **pre_sac** | SAC 摊销法（等额本金），按日计算固定利率 |
| **post_sac** | SAC 摊销法（等额本金），按日计算基于固定利率加浮动指数（cdi、ipca 或 igpm）的利率 |
| **post_price** | Price 摊销法（等额分期），按固定周期（30天）计算基于固定利率加浮动指数（cdi、ipca 或 igpm）的利率 |
| **post_price_days** | Price 摊销法（等额分期），按日计算基于固定利率加浮动指数（cdi、ipca 或 igpm）的利率 |

### _Credit Operation Type_ 枚举值
| 枚举值 | 描述 |
|---------------|--------------------------------|
| **ccb** | 银行信贷凭证 |
| **cce** | 出口信贷凭证 |
| **cci** | 房地产信贷凭证 |
| **nce** | 出口信贷票据 |

### _Interest Base_ 枚举值
| 枚举值 | 描述 |
|-----------------------|---------------------------------------------------------------------------|
| **workdays** | 以工作日为基准计算利率，按 252 天/年计算 |
| **calendar_days** | 以自然日为基准计算利率，按 360 天/年计算 |
| **calendar_days_365** | 以自然日为基准计算利率，按 365 天/年计算 |

### _Fee Type_ 枚举值
每种费用类型必须提前由 QI Tech 启用和配置

| 枚举值 | 描述 |
|-----------------------|----------------------------------------------------------------------------|
| **tac** | 开户费 |
| **spread** | 信贷操作收购金额中收取的溢价 |
| **warranty_analysis** | 担保分析费 |
| **ted_fee** | TED 费用 |
| **spread_ted_fee** | 信贷操作收购金额中收取的 TED 费用溢价 |

---

# 企业债务发行

URL: /zh-Hans/documentation/emissao_de_divida/emissao/emissao_de_divida_pj

使用债务发行 API，可以为法人申请发行债务。无需提前注册借款人，只需在申请时提供注册数据即可。

:::danger 注意！

QI Tech 提供新客户入驻和反欺诈解决方案。

[在此查看该服务 API 的文档。](https://www.zaig.com.br/en/devcenter.html)

如需报价，请联系我们的商务团队：

comercial@qitech.com.br 或 (11) 3522-1301
:::

债务 API 设计为只需执行一次请求即可完成，需在提前上传文件（[文档上传](../../upload_de_documentos)）之后执行。
请求头和请求体的签名格式详情请参见[此处](../../primeiros_passos/teste_de_autenticacao)。

## 请求

ENDPOINT /debt
MÉTODO POST

请求体

```json
{
    "borrower": {
        "name": "RAZAO SOCIAL EMPRESA",
        "email": "emailempresa@email.com",
        "phone": {
            "number": "991112222",
            "area_code": "11",
            "country_code": "055"
        },
        "address": {
            "city": "São Paulo",
            "state": "SP",
            "number": "215",
            "street": "Rua Gilberto Sabino",
            "complement": "3 andar",
            "postal_code": "05425020",
            "neighborhood": "Pinheiros"
        },
        "cnae_code": "6822-6/00",
        "role_type": "issuer",
        "person_type": "legal",
        "company_type": "ltda",
        "trading_name": "NOME FANTASIA DA EMPRESA",
        "foundation_date": "2019-07-05",
        "attached_documents_list": [],
        "company_document_number": "80282008000127",
        "company_statute": "aa28e598-55e2-40f1-8884-671772c541a1",
        "company_representatives": [
            {
                "name": "NOME DO REPRESENTANTE",
                "email": "nomedorepresentante@email.com",
                "phone": {
                    "number": "990121234",
                    "area_code": "11",
                    "country_code": "055"
                },
                "is_pep": false,
                "final_beneficiary": true,
                "address": {
                    "city": "São Paulo",
                    "state": "SP",
                    "number": "215",
                    "street": "Rua Gilberto Sabino",
                    "complement": "3 andar",
                    "postal_code": "05425020",
                    "neighborhood": "Pinheiros"
                },
                "role_type": "company_representative",
                "birth_date": "1993-09-10",
                "profession": "DIRETOR",
                "mother_name": "NOME DA MAE DO REPRESENTANTE",
                "nationality": "BRASILEIRO",
                "person_type": "natural",
                "marital_status": "married",
                "property_system": "partial_communion_of_goods",
                "attached_documents_list": [],
                "individual_document_number": "31057466093",
                "document_identification_number": "20202020200"
            }
        ]
    },
    "financial": {
        "disbursed_amount": 10000,
        "interest_type": "pre_price_days",
        "credit_operation_type": "ccb",
        "monthly_interest_rate": 0.03,
        "disbursement_date": "2023-05-04",
        "first_due_date": "2023-06-03",
        "interest_grace_period": 0,
        "principal_grace_period": 0,
        "number_of_installments": 1,
        "fine_configuration": {
            "contract_fine_rate": 0.02,
            "interest_base": "calendar_days",
            "monthly_rate": 0.01
        }
    },
    "disbursement_bank_account": {
        "name": "RAZAO SOCIAL EMPRESA",
        "document_number": "80282008000127",
        "bank_code": "341",
        "branch_number": "8615",
        "account_number": "22110",
        "account_digit": "2",
        "account_type": "checking_account"
    },
    "purchaser_document_number": "32402502000135"
}

```

## 响应

此次债务请求的响应将返回还款计划以及 **DEBT-KEY**，即债务在 QI SCD 中的标识符。

STATUS 200

响应体

```json
{
  "data": {},
  "event_datetime": "2023-05-04 12:28:35",
  "key": "feceb7fe-1305-45eb-899d-c87d36bcc534",
  "status": "waiting_signature",
  "webhook_type": "debt"
}

```

### 请求体对象
| 字段 | 类型 | 描述 | 最大字符数 | 
|---------------------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------|
| **borrower** * | object | **[Borrower 对象](#objeto-borrower)** - 信贷操作的债务人 | - |
| **guarantor** | object | **[Guarantor 对象](#objeto-borrower)** - 信贷操作的担保人 | - |  
| **disbursement_bank_account** * | object | **[Disbursement Bank Account 对象](#objeto-disbursement_bank_accounts)** - 操作放款的银行账户数据 | - |
| **financial** * | object | **[Financial 对象](#objeto-financial)** - 操作放款的银行账户数据，标识所发送的对象为自然人。borrower PF 时必须始终包含 "natural" 值 | - |
| **purchaser_document_number** * | string | 信贷操作受让人（买方）的 CNPJ | - |

### Borrower 对象  
| 字段 | 类型 | 描述 | 最大字符数 | 
|----------------------------------|---------|---------------------------------------------------------------------------------------|--------------|
| **name** * | string | 公司法定名称 | 100 |
| **trading_name** * | string | 商业名称 | |
| **email** * | string | 公司机构电子邮件 | 254 |
| **phone** * | object | **[Phone 对象](#objeto-phone)** - 公司电话 | - | 
| **is_pep** * | boolean | PEP 指示器（http://www.portaldatransparencia.gov.br/download-de-dados/pep） | - |
| **address** * | object | **[Address 对象](#objeto-address)** - 债务人地址 | - | 
| **role_type** * | enum | 默认值：_issuer_ | - |
| **person_type** * | string | 法人标识 - 默认值：_legal_ | - |
| **company_document_number** * | string | CNPJ（仅数字） | - |
| **cnae_code** * | string | 国家经济活动分类代码 | |
| **company_representatives** * | array of objects | 公司法定代表人列表 | **[Company Representatives 对象](#objeto-company_representatives)** |
| **company_type** * | enum | 公司类型："ltda"、"sa"、"micro_enterprise" 或 "freelancer" | - |
| **company_statute** * | string | 公司章程 PDF 的 `document_key` | |
| **directors_election_minute** | string | 公司董事选举会议记录 PDF 的 `document_key`（仅对 company_type 为 "sa" 的公司必填） | |
| **foundation_date** * | date | 公司成立日期（格式 "YYYY-MM-DD"） | |

如上所示，"borrower" 字段和 "guarantors" 字段均可由 PF 对象或 PJ 对象填充。PJ 对象是 QI Tech 中法人实体的描述。

### Company Representatives 对象

| 字段 | 描述 | 示例 | 最大字符数 | 
|---|---|---|---| 
| **person_type** * | string | 标识所发送对象为自然人或法人。 | natural |
| **name** * | string | 法人操作时为公司法定名称，自然人操作时为个人姓名。限 100 个字符。 | |
| **mother_name** * | string | 自然人时为客户母亲姓名。限 100 个字符。 | |
| **birth_date** * | string | 人员出生日期（格式 "YYYY-MM-DD"） | - |
| **profession** * | string | 客户职业。限 64 个字符。 | 64 |
| **nationality** * | string | 客户国籍。 | 50 |
| **marital_status** * | string | 客户婚姻状况。 | |
| **property_system** * | string | 财产分隔制度（仅 marital_status 为 "married" 时必填）。 | **[property_system 枚举值](#enumeradores-property_system)** |
| **wedding_certificate** * | string | 结婚证 PDF 的 DOCUMENT_KEY（预先上传）。若 marital_status 为 "single"，该字段值应为 NULL。 | |
| **spouse** * | string | **[Spouse 对象](#objeto-spouse)**（仅当 "compulsory_separation_of_goods" 为 "total_communion_of_goods"、"partial_communion_of_goods"、"final_participation_of_acquisitions" 或 "compulsory_separation_of_goods" 时必填）。若 marital_status 为 "single"，该字段值应为 NULL。 | **[Spouse 对象](#objeto-spouse)** |
| **is_pep** * | boolean | 声明该人是否为 PEP（http://www.portaldatransparencia.gov.br/download-de-dados/pep）。 | true/false |
| **final_beneficiary** | boolean | 声明该人是否为公司的最终受益人。 | true/false |
| **individual_document_number** * | string | 人员 CPF（仅数字）。 | 10 |
| **document_identification** * | string | 带照片的身份证明文件 PDF 的 DOCUMENT_KEY（身份证或驾驶证）（预先上传） | |
| **document_identification_back** | string | 带照片的身份证明文件背面 PDF 的 DOCUMENT_KEY（身份证或驾驶证）（预先上传）。 | |
| **document_identification_type** * | string | 所提交身份证明文件的类型。 | |
| **document_identification_number** * | string | "document_identification" 中提交的身份证明文件号码。 | 16 |
| **email** * | string | 客户电子邮件。 | 254 | 
| **phone** * | object | 客户电话 | **[Phone 对象](#objeto-phone)** | - |
| **address** | object | 客户地址。 | **[Address 对象](#objeto-address)** | |
| **proof_of_residence** | string | 所提供地址的居住证明 PDF 的 DOCUMENT_KEY（预先上传）。 | - |

### Spouse 对象
| 字段 | 描述 | 示例 | 最大字符数 | 
|---|---|---|---| 
| **person_type** * | string | 标识所发送对象为自然人或法人。 | natural |
| **name** * | string | 法人操作时为公司法定名称，自然人操作时为个人姓名。限 100 个字符。 | |
| **mother_name** * | string | 自然人时为客户母亲姓名。限 100 个字符。 | |
| **birth_date** * | string | 人员出生日期（格式 "YYYY-MM-DD"） | - |
| **profession** * | string | 客户职业。限 64 个字符。 | 64 |
| **is_pep** * | boolean | 声明该人是否为 PEP（http://www.portaldatransparencia.gov.br/download-de-dados/pep）。 | true/false |
| **individual_document_number** * | string | 人员 CPF（仅数字）。 | 10 |
| **document_identification_number** * | string | "document_identification" 中提交的身份证明文件号码。 | 16 |
| **email** * | string | 客户电子邮件。 | 254 | 
| **phone** * | object | 客户电话 | **[phone 对象](#objeto-phone)** | - |
| **address** | object | 客户地址。 | **[address 对象](#objeto-address)** | |

### Address 对象

| 字段 | 类型 | 描述 | 最大字符数 | 
|--------------------|--------|--------------------------------------------------------------------------|--------------| 
| **city** * | string | 地址所在城市 | 100 |
| **state** * | string | 地址所在州（两位大写字母） | 2 |
| **number** * | string | 门牌号 | 10 |
| **street** * | string | 街道名称 | 100 |
| **complement** * | string | 地址补充信息（自由文本） | 100 |
| **postal_code** * | string | 邮政编码（http://www.buscacep.correios.com.br/sistemas/buscacep/） | 8 |
| **neighborhood** * | string | 社区/街区名称 | 100 |

### Phone 对象

| 字段 | 描述 | 示例 | 最大字符数 | 
|--------------------|-----------|-------------------------------------------------------|--------------| 
| **number** * | string | 电话号码 | 10 |
| **area_code** * | string | 区号（https://ddd.guiamais.com.br/） | 2 |
| **country_code** * | string | 国家代码（https://ddi.guiamais.com.br/） | 3 |

### Disbursement Bank Account 对象

债务发行必须包含放款的银行账户信息，默认情况下为债务人名下的账户。

| 字段 | 类型 | 描述 | 最大字符数 | 
|-----------------------|--------|----------------------------------------------------------------------------------------------------|--------------|
| name | string | 账户持有人姓名 | 50 |
| document_number | string | 账户持有人 CPF | 11 |
| bank_code * | string | 金融机构的 COMPE 代码（https://www.bcb.gov.br/pom/spb/estatistica/port/ASTR003.pdf） | 3 |
| branch_number * | string | 支行号码（请勿填写支行验证位！） | 4 |
| account_number * | string | 账号（不含验证位！） | 10 |
| account_digit * | string | 账户验证位（字母处填写零） | 1 |
| account_type | enum | [账户类型枚举值](#enumerador-account-type) 账户类型 | 1 |

### Financial 对象

Financial 对象描述发行的财务信息。其中定义了利率、宽限期和债务金额等。Financial 对象包含以下字段，但需注意某些字段是可选且互斥的（若其中一个可用，则不应发送另一个）。

| 字段 | 类型 | 描述 | 最大字符数 |
|----------------------------|--------|---------------------------------------------------------------------------------------------------------------|--------------|
| **amout** | float | 信贷操作的发行/名义金额 | - |
| **interest_type** | object | **[利率类型枚举值](#enumerador-interest-type)** - 摊销方法和利率计算方式 | - |
| **credit_operation_type** | object | **[信贷操作类型枚举值](#enumerador-credit-operation-type)** - 信贷合同类型 | - |
| **annual_interest_rate** | float | 以年化小数表示的固定利率 | - |
| **disbursement_date** | date | 操作放款日期 | - |
| **interest_grace_period** | int | 利息宽限期（月） | - |
| **principal_grace_period** | int | 本金宽限期 | - |
| **number_of_installments** | int | 信贷操作的分期数 | - |
| **fine_configuration** | object | **[Fine Configuration 对象](#objeto-fine-configuration)** - 逾期利息和罚款配置 | - |

### Fine Configuration 对象

Fine Configuration 对象中填写信贷操作的逾期罚款和利息金额。

| 字段 | 类型 | 描述 | 最大字符数 |
|------------------------|-------|--------------------------------------------------------------------------------------|--------------|
| **contract_fine_rate** | float | 逾期罚款百分比 | - |
| **interest_base** | enum | **[利率基准枚举值](#enumerador-interest-base)** - 利率计算基准 | - |
| **monthly_rate** | float | 月逾期利率 | - |

### Rebates 对象
| 字段 | 类型 | 描述 | 最大字符数 | 
|---------------------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------|
| **fee_type** * | enum | 费用类型。 | - | 
| **amount_type** * | object | 收取金额的类型。 | - |
| **amount** * | object | 费用金额。若费用类型为百分比，则值应在 0 到 100 之间。 | - |

### 响应体
| 字段 | 类型 | 描述 | 最大字符数 |
|----------------------------|--------|----------------------------------------------------------------|--------------|
| **data[n].data** | object | **[Data 对象](#objeto-data)** | - |
| **data[n].event_datetime** | date | 信贷操作生成时刻 | - |
| **data[n].key** | string | **DEBT-KEY** - QI 内信贷操作的唯一密钥 | - |
| **data[n].status** | string | **[债务可能的状态](../status_de_uma_divida)** | - |
| **data[n].type** | string | _debt_ | - |

# 枚举值

### _Person Type_ 枚举值
| 枚举值 | 描述 |
|------------------------|-----------------------|
| **legal** | 法人 |
| **natural** | 自然人 |

### _Amount Type_ 枚举值
| 枚举值 | 描述 |
|------------------------|-----------------------|
| **tac** | 向借款人收取的费用。 |
| **spread** | 向基金收取并加入操作转让价格的费用。 |

### _Account Type_ 枚举值
| 枚举值 | 描述 |
|------------------------|-----------------------|
| **checking_account** | 活期账户 |
| **deposit_account** | 存款账户 |
| **guaranteed_account** | 担保账户 |
| **investment_account** | 投资账户 |
| **payment_account** | 支付账户 |
| **saving_account** | 储蓄账户 |
| **salary_account** | 工资账户 |

### _Interest Type_ 枚举值
| 枚举值 | 描述 |
|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **pre_price_days** | Price 摊销法（等额分期），按日计算固定利率 |
| **pre_price** | Price 摊销法（等额分期），按固定周期（30天）计算固定利率 |
| **pre_sac** | SAC 摊销法（等额本金），按日计算固定利率 |
| **post_sac** | SAC 摊销法（等额本金），按日计算基于固定利率加浮动指数（cdi、ipca 或 igpm）的利率 |
| **post_price** | Price 摊销法（等额分期），按固定周期（30天）计算基于固定利率加浮动指数（cdi、ipca 或 igpm）的利率 |
| **post_price_days** | Price 摊销法（等额分期），按日计算基于固定利率加浮动指数（cdi、ipca 或 igpm）的利率 |

### _Credit Operation Type_ 枚举值
| 枚举值 | 描述 |
|------------|--------------------------------|
| **ccb** | 银行信贷凭证 |
| **cce** | 出口信贷凭证 |
| **cci** | 房地产信贷凭证 |
| **nce** | 出口信贷票据 |
| **ncom** | 商业票据 |

### _Interest Base_ 枚举值
| 枚举值 | 描述 |
|-----------------------|---------------------------------------------------------------------------|
| **workdays** | 以工作日为基准计算利率，按 252 天/年计算 |
| **calendar_days** | 以自然日为基准计算利率，按 360 天/年计算 |
| **calendar_days_365** | 以自然日为基准计算利率，按 365 天/年计算 |

### _Fee Type_ 枚举值
每种费用类型必须提前由 QI Tech 启用和配置

| 枚举值 | 描述 |
|-----------------------|----------------------------------------------------------------------------|
| **tac** | 开户费 |
| **spread** | 信贷操作收购金额中收取的溢价 |
| **warranty_analysis** | 担保分析费 |
| **ted_fee** | TED 费用 |
| **spread_ted_fee** | 信贷操作收购金额中收取的 TED 费用溢价 |

---

# 放款 Payload 示例

URL: /zh-Hans/documentation/emissao_de_divida/emissao/exemplo_payloads_desembolso

### 放款到 QI Tech 内部账户

ENDPOINT /debt
MÉTODO POST

```json title='Request Body'
{
	"disbursement_bank_accounts": [{
		"bank_code": "329",
		"branch_number": "001",
		"account_number": "6947216",
		"account_digit": "4",
		"document_number": "94632180173",
		"name": "Pedro Felipe Henrique Alves",
		"percentage_receivable": 100
	}]
  ...
}
```

--- 

### 使用手动 PIX 放款

ENDPOINT /debt
MÉTODO POST

```json title='Request Body'
{
	"disbursement_bank_accounts": [{
			"document_number": "31233261000185",
			"name": "Jorge Augusto Salgado Salhani",
			"pix_transfer_type": "manual",
			"bank_code": "329",
			"branch_number": "0001",
			"account_number": "62400",
			"account_digit": "6",
			"percentage_receivable": 100
		}]
		...
}
```
:::info PIX 密钥类型
"pix_key" 可以是 CPF、CNPJ、电子邮件、手机号或随机密钥（UUID），格式如下：

CPF：11位整数。

CNPJ：14位整数。

电子邮件：包含至少一个"@"的文本。

手机号：包含以下格式的文本："+55" + "手机区号" + "8至9位整数手机号"。例如："+5511987654321"。

随机密钥：UUID。
:::

---

### 使用 PIX 密钥放款

ENDPOINT /debt
MÉTODO POST

```json title='Request Body'

{
	"disbursement_bank_accounts": [{
			"document_number": "31233261000185",
			"name": "Jorge Augusto Salgado Salhani",
			"pix_key": "2f205c99-3161-4120-badd-854039d12de6",
			"pix_transfer_type": "key"
		}]
		...
}
```
---

### 使用 PIX QR Code 放款

ENDPOINT /debt
MÉTODO POST

```json title='Request Body'

{
	"disbursement_bank_accounts": [{
			"qr_code_key": "b76e436e-4767-4b16-91e6-9bfc794f2510"
		}]
		...
}
```

---

### 使用 TED 放款

ENDPOINT /debt
MÉTODO POST

```json title='Request Body'

{
	"disbursement_bank_accounts": [{
			"transfer_method": "ted",
			"bank_code": "329",
			"branch_number": "0001",
			"account_number": "62400",
			"account_digit": "6",
			"document_number": "31233261000185",
			"name": "Jorge Conta destino de desembolso",
			"percentage_receivable": 100
		}]
		...
}
```

---

### 通过支付 Boleto 放款

ENDPOINT /debt
MÉTODO POST

```json title='Request Body'

{
	"disbursement_bank_accounts": [{
		"digitable_line": "836400000169072200500006763953020230059001020193",
		"amount_receivable": 1607.22
	}]
		...
}
```

---

# 替代签署方式

URL: /zh-Hans/documentation/emissao_de_divida/formalizacao/assinatura_de_contrato

要使用替代签署方式，需要将证明文件压缩为 .zip 文件，并通过 QI TECH 的 /upload 端点发送，这样返回的 document_key 即可在此端点中用作合同签署方式。

替代签署方式示例：

- 录音电话；

- 信用分析；

## 请求

ENDPOINT /debt/ DEBT-KEY /signed
MÉTODO POST

**请求体**

```json
{
    "type": "data-signature",
    "signatures": [
        {
            "signed_object": {
                "raw_text": "Lorem ipsum dolor sit amet, consectetur a....",
                "document_key": "79003de0-2590-455d-9b73-426b8ca284eb",
                "document_md5": "7521bd5621d97af26b2c1721fc4023a8"
            },
            "authenticity": {
                "timestamp": "1970-01-01 00:00:01",
                "document_key": "79003de0-2590-455d-9b73-426b8ca284eb",
                "document_md5": "79003de0-2590-455d-9b73-426b8ca284eb"
            },
            "signer": {
                "name": "IVANILDO DE SENA LIMA",
                "email": "ivanlima2604@gmail.com",
                "phone": {
                    "country_code": "055",
                    "area_code": "11",
                    "number": "999999999"
                },
                "document_number": "61766976204"
            },
            "authentication_type": "zip"
        }
    ]
}
```

## 路径参数

| 字段 | 类型 | 描述 | 字符数 | 
|---|---|---|---|
| `debt_key` * | string | 创建信贷操作时返回的债务密钥。 | - |

## 请求体参数

| 字段 | 类型 | 描述 | 字符数 | 
|---|---|---|---|
| `type` * | string | 将要发送的签署类型。 | - |
| `signatures` * | array of objects | 包含签署证明对象的列表——在签署类型为"data-signature"时发送。 | **[signatures 对象](#objeto-signatures)** |
| `path-pdf-signed` * | string | 已签署 PDF 的 URL——在签署类型为"pdf-signature"时发送。 | - |

### signatures 对象

| 字段 | 类型 | 描述 | 字符数 | 
|---|---|---|---|
| `signed_object` | object | 包含正在签署文件的对象。 | **[signed_object 对象](#objeto-signed_object)** |
| `authenticity` | object | 包含认证数据的对象。 | **[authenticity 对象](#objeto-authenticity)** |
| `signer` | object | 包含签署人数据的对象。 | **[signer 对象](#objeto-signer)** |
| `authentication_type` * | string | 签署类型。 | - |

### signed_object 对象

| 字段 | 类型 | 描述 | 字符数 | 
|---|---|---|---|
| `raw_text` | string | 包含将要签署的合同数据的连续文本（opt-in 类型认证必填）。 | - |
| `document_key` | string | 通过 API 1.1 发送的已签署文件的 DOCUMENT_KEY（仅当未发送"raw_text"字段时必填）。 | - |
| `document_md5` | string | 通过 API 1.1 发送的已签署文件的 DOCUMENT_MD5（仅当未发送"raw_text"字段时必填）。 | - |

### authenticity 对象

| 字段 | 类型 | 描述 | 字符数 | 
|---|---|---|---|
| `timestamp` * | string | 签署日期。 | - |
| `document_key` * | string | 发送签署证据文件后由 API 1.1 返回的 DOCUMENT_KEY。 | - |
| `document_md5` * | string | 发送签署证据文件后由 API 1.1 返回的 DOCUMENT_MD5。 | - |
 
### signer 对象

| 字段 | 类型 | 描述 | 字符数 | 
|---|---|---|---|
| `name` * | string | 签署人姓名。 | - |
| `email` * | string | 签署人电子邮件。 | - |
| `phone` | string | 签署人电话对象。 | **[phone 对象](#objeto-phone)** |
| `document_number` * | string | 签署人证件号码。 | - |

### phone 对象

| 字段 | 类型 | 描述 | 字符数 | 
|---|---|---|---|
| `country_code` * | string | 电话国家代码（https://ddi.guiamais.com.br/） | 3 | 
| `area_code` * | string | 电话区号（https://ddd.guiamais.com.br/） | 2 |
| `number` * | string | 电话号码（仅数字） | 10 |

## 响应

STATUS 200

**响应体**

```json
{
  "data": {},
  "event_datetime": "2022-11-07 15:24:47",
  "key": "\<DEBT-KEY\>",
  "status": "signature_received",
  "webhook_type": "debt"
}

```

STATUS 400

**响应体**

```json
{
  "data": "{\"title\": \"Bad Request\", \"description\": \"Invalid request body.\", \"translation\": \"Corpo da requisição inválido.\", \"extra_fields\": {}, \"code\": \"LEG000069\"}"
}

```

---

# 通过 OPT-IN 签署合同

URL: /zh-Hans/documentation/emissao_de_divida/formalizacao/assinatura_opt_in

## 请求

ENDPOINT /debt/ DEBT-KEY /signed
MÉTODO POST

**请求体**

```json
{
    "type": "data_signature",
    "signatures": [
        {
            "signed_object": {
                "raw_text": "Lorem ipsum dolor sit amet, consectetur a...."
            },
            "authenticity": {
                "timestamp": "1970-01-01 00:00:01",
                "ip_address": "179.104.42.245",
                "session_id": "ddb1d063-4fdf-4330-af9c-3316e9142ff3"
            },
            "signer": {
                "name": "IVANILDO DE SENA LIMA",
                "email": "ivanlima2604@gmail.com",
                "phone": {
                    "country_code": "055",
                    "area_code": "11",
                    "number": "999999999"
                },
                "document_number": "61766976204"
            },
            "authentication_type": "opt-in"
        }
    ]
}
```

## 路径参数

| 字段 | 类型 | 描述 | 字符数 | 
|---|---|---|---|
| `debt_key` * | string | 创建信贷操作时返回的债务密钥。 | - |

## 请求体参数

| 字段 | 类型 | 描述 | 字符数 | 
|---|---|---|---|
| `type` * | string | 将要发送的签署类型。 | - |
| `signatures` * | array of objects | 包含签署证明对象的列表——在签署类型为"data-signature"时发送。 | **[signatures 对象](#objeto-signatures)** |

### signatures 对象

| 字段 | 类型 | 描述 | 字符数 | 
|---|---|---|---|
| `signed_object` | object | 包含正在签署文件的对象。 | **[signed_object 对象](#objeto-signed_object)** |
| `authenticity` | object | 包含认证数据的对象。 | **[authenticity 对象](#objeto-authenticity)** |
| `signer` | object | 包含签署人数据的对象。 | **[signer 对象](#objeto-signer)** |
| `authentication_type` * | string | 签署类型。 | - |

### signed_object 对象

| 字段 | 类型 | 描述 | 字符数 | 
|---|---|---|---|
| `raw_text` * | string | 包含将要签署的合同数据的连续文本。 | - |

### authenticity 对象

| 字段 | 类型 | 描述 | 字符数 | 
|---|---|---|---|
| `timestamp` * | string | 签署日期。 | - |
| `ip_address` | string | 对于"opt-in"认证类型为必填字段，表示收集接受时的 IP 地址。 | - |
| `session_id` | string | 签署时客户的会话标识 ID——必须可查询，会话证据须保存至少 5 年（"opt-in"认证类型必填）。 | - |
| `geolocation` | object | 可选地理位置字段。 | - |
 
### signer 对象

| 字段 | 类型 | 描述 | 字符数 | 
|---|---|---|---|
| `name` * | string | 签署人姓名。 | - |
| `email` * | string | 签署人电子邮件。 | - |
| `phone` | string | 签署人电话对象。 | **[phone 对象](#objeto-phone)** |
| `document_number` * | string | 签署人证件号码。 | - |

### phone 对象

| 字段 | 类型 | 描述 | 字符数 | 
|---|---|---|---|
| `country_code` * | string | 电话国家代码（https://ddi.guiamais.com.br/） | 3 | 
| `area_code` * | string | 电话区号（https://ddd.guiamais.com.br/） | 2 |
| `number` * | string | 电话号码（仅数字） | 10 |

## 响应

STATUS 200

**响应体**

```json
{
  "data": {},
  "event_datetime": "2022-11-07 15:24:47",
  "key": "\<DEBT-KEY\>",
  "status": "signature_received",
  "webhook_type": "debt"
}

```

STATUS 400

**响应体**

```json
{
  "data": "{\"title\": \"Bad Request\", \"description\": \"Invalid request body.\", \"translation\": \"Corpo da requisição inválido.\", \"extra_fields\": {}, \"code\": \"LEG000069\"}"
}

```

---

# 发送已签署 PDF

URL: /zh-Hans/documentation/emissao_de_divida/formalizacao/assinatura_pdf

## 请求

ENDPOINT /debt/ DEBT-KEY /signed
MÉTODO POST

**请求体**

```json
{
    "type": "pdf-signature",
    "path-pdf-signed": "https://www.google.com/"
}
```

## 路径参数

| 字段 | 类型 | 描述 | 字符数 | 
|---|---|---|---|
| `debt_key` * | string | 创建信贷操作时返回的债务密钥。 | - |

## 请求体参数

| 字段 | 类型 | 描述 | 字符数 | 
|---|---|---|---|
| `type` * | string | 将要发送的签署类型。 | - |
| `path-pdf-signed` * | string | 已签署 PDF 的 URL——在签署类型为"pdf-signature"时发送。 | - |

## 响应

STATUS 200

**响应体**

```json
{
  "data": {},
  "event_datetime": "2022-11-07 15:24:47",
  "key": "\<DEBT-KEY\>",
  "status": "signature_received",
  "webhook_type": "debt"
}

```

STATUS 400

**响应体**

```json
{
  "data": "{\"title\": \"Bad Request\", \"description\": \"Invalid request body.\", \"translation\": \"Corpo da requisição inválido.\", \"extra_fields\": {}, \"code\": \"LEG000069\"}"
}

```

---

# 通过自拍签署合同

URL: /zh-Hans/documentation/emissao_de_divida/formalizacao/assinatura_selfie

通过自拍认证适用于使用 QI Tech 信用分析服务的合作方，自拍认证经过验证后会生成证明 ID。

通过 QI Tech 信用分析端点生成的此 ID 可用作合同签署方式。

## 请求

ENDPOINT /debt/ DEBT-KEY /signed
MÉTODO POST

**请求体**

```json
{
    "type": "data-signature",
    "signatures": [
        {
            "signed_object": {
                "raw_text": "Lorem ipsum dolor sit amet, consectetur a....",
                "document_key": "79003de0-2590-455d-9b73-426b8ca284eb",
                "document_md5": "7521bd5621d97af26b2c1721fc4023a8"
            },
            "authenticity": {
                "timestamp": "1970-01-01 00:00:01",
                "facial_recognition_key": "79003de0-2590-455d-9b73-426b8ca284eb"
            },
            "signer": {
                "name": "IVANILDO DE SENA LIMA",
                "email": "ivanlima2604@gmail.com",
                "phone": {
                    "country_code": "055",
                    "area_code": "11",
                    "number": "999999999"
                },
                "document_number": "61766976204"
            },
            "authentication_type": "opt-in"
        }
    ]
}
```

## 路径参数

| 字段 | 类型 | 描述 | 字符数 | 
|---|---|---|---|
| `debt_key` * | string | 创建信贷操作时返回的债务密钥。 | - |

## 请求体参数

| 字段 | 类型 | 描述 | 字符数 | 
|---|---|---|---|
| `type` * | string | 将要发送的签署类型。 | - |
| `signatures` * | array of objects | 包含签署证明对象的列表——在签署类型为"data-signature"时发送。 | **[signatures 对象](#objeto-signatures)** |

### signatures 对象

| 字段 | 类型 | 描述 | 字符数 | 
|---|---|---|---|
| `signed_object` | object | 包含正在签署文件的对象。 | **[signed_object 对象](#objeto-signed_object)** |
| `authenticity` | object | 包含认证数据的对象。 | **[authenticity 对象](#objeto-authenticity)** |
| `signer` | object | 包含签署人数据的对象。 | **[signer 对象](#objeto-signer)** |
| `authentication_type` * | string | 签署类型。 | - |

### signed_object 对象

| 字段 | 类型 | 描述 | 字符数 | 
|---|---|---|---|
| `raw_text` | string | 包含将要签署的合同数据的连续文本（opt-in 类型认证必填）。 | - |
| `document_key` | string | 通过 API 1.1 发送的已签署文件的 DOCUMENT_KEY（仅当未发送"raw_text"字段时必填）。 | - |
| `document_md5` | string | 通过 API 1.1 发送的已签署文件的 DOCUMENT_MD5（仅当未发送"raw_text"字段时必填）。 | - |

### authenticity 对象

| 字段 | 类型 | 描述 | 字符数 | 
|---|---|---|---|
| `timestamp` * | string | 签署日期。 | - |
| `facial_recognition_key` * | string | 必须包含 QI Tech 人脸识别 API 返回的 facial_recognition_key——此字段仅适用于"selfie"认证类型，且排除其他证明文件的强制要求。 | - |
 
### signer 对象

| 字段 | 类型 | 描述 | 字符数 | 
|---|---|---|---|
| `name` * | string | 签署人姓名。 | - |
| `email` * | string | 签署人电子邮件。 | - |
| `phone` | string | 签署人电话对象。 | **[phone 对象](#objeto-phone)** |
| `document_number` * | string | 签署人证件号码。 | - |

### phone 对象

| 字段 | 类型 | 描述 | 字符数 | 
|---|---|---|---|
| `country_code` * | string | 电话国家代码（https://ddi.guiamais.com.br/） | 3 | 
| `area_code` * | string | 电话区号（https://ddd.guiamais.com.br/） | 2 |
| `number` * | string | 电话号码（仅数字） | 10 |

## 响应

STATUS 200

**响应体**

```json
{
  "data": {},
  "event_datetime": "2022-11-07 15:24:47",
  "key": "\<DEBT-KEY\>",
  "status": "signature_received",
  "webhook_type": "debt"
}

```

STATUS 400

**响应体**

```json
{
  "data": "{\"title\": \"Bad Request\", \"description\": \"Invalid request body.\", \"translation\": \"Corpo da requisição inválido.\", \"extra_fields\": {}, \"code\": \"LEG000069\"}"
}

```

---

# 合同签署

URL: /zh-Hans/documentation/emissao_de_divida/formalizacao/introducao_formalizacao

默认情况下，QI Tech 通过 QI Sign 收集签名，合同在发行时发送给签署人。不过，合作方也可以独立收集签名，然后将已签署的文件或签署证据发送给 QI Tech 以继续操作。

:::caution **注意**

如需由合作方收集签名后通过 API 发送已签署文件，必须向 QI Tech 支持团队申请配置此流程。
:::

签署流程可以通过以下 2 种方式进行：

1 - 通过 QI Tech 平台收集签名；

2 - 合作方独立收集签名，然后将已签署合同发送给 QI Tech——此方式既支持发送已签署 PDF，也支持发送签名哈希；

调用流程因所选方式不同而有所变化，可遵循以下调用流程：

## 流程 1
向 QI Tech 支持团队申请配置签名流程 1 后，完成债务发行所需的唯一调用是根据操作的信贷借款人进行第 3 组调用。

QI Tech 将发行预配置的信贷合同并发送以进行签署——可通过 API 5.1 或发送的回调跟踪操作进度。

文件签署通过 QI Sign 平台完成，可在合同发行后的 7 天内通过电子邮件、WhatsApp 或短信完成。

由于签署的异步性，当借款人签署合同后，系统将通过 webhook 向发起方触发事件。

## 流程 2
向 QI Tech 支持团队申请配置签名流程 2 后，需要执行一系列调用。

第一个调用必须是第 3 组 API（根据操作的信贷借款人）以生成合同 PDF，最后一个调用是 API 4.1 以提交已签署合同；

如果通过认证机构签署文件，需要在 API 4.1 中发送带有已签署 PDF 的 URL；

如果是通过前端 opt-in 方式签署，则在 API 4.1 中发送的是客户接受证据。

QI Tech 将随后进行放款流程——可通过 API 5.1 或发送的 webhook 跟踪操作进度。

## 支持的签署类型

### **pdf-signature**
此类型表示通过 "/debt" 生成的 PDF 将被签署，已签署 PDF 的链接将通过 API 4.1 作为认证方式发送。

### **data-signature**
此类型表示通过 "/debt" 生成的 PDF 将通过附在最后一页的哈希值进行签署。

数据认证有 3 种类型：

#### **Opt-in**
通过 opt-in 签署意味着客户将通过前端接受合同。

为使此签署有效，必须强制发送某些数据。

#### **Zip**
通过 zip 签署包括发送证明文件，如录音电话。

#### **Selfie**
通过自拍认证适用于使用 QI Tech CaaS 服务的合作方，自拍认证经过验证后会生成证明 ID。

---

# 为分期付款生成 Boleto 或 PIX

URL: /zh-Hans/documentation/emissao_de_divida/gerar_boleto_ou_pix_para_uma_parcela

允许为信贷操作的特定分期生成银行 Boleto 或 PIX 付款码。

:::caution 付款方式替换
如果该分期已有有效的 Boleto/PIX 用于付款，该 Boleto/PIX 将被停用并由新的付款方式替换。
:::

## 端点

### 请求

ENDPOINT /debt/ DEBT-KEY /installment/ INSTALLMENT-KEY / PAYMENT-TYPE
MÉTODO POST
路径参数
| 参数 | 类型 | 描述 |
|-----------|------|-----------|
| DEBT-KEY | string | 债务的标识密钥 |
| INSTALLMENT-KEY | string | 分期的标识密钥 |
| PAYMENT-TYPE | string | 所需付款类型：bankslip（Boleto）或 pix（PIX QR Code） |
请求体
```json
{}
```
响应
响应体
```json
{
  "installment_key": "installment_key",
  "due_date": "2022-09-08",
  "business_due_date": "2022-09-09",
  "pre_fixed_amount": 70.0,
  "principal_amortization_amount": 1000.0,
  "total_amount": 1070.0,
  "bank_slip_key": "bank_slip_key",
  "qr_code_key": "qr_code_key",
  "qr_code_url": "qr_code_url",
  "digitable_line": "digitable_line"
}
```
响应体对象
| 字段 | 类型 | 描述 |
|-------|------|-----------|
| installment_key | string | UUID 格式的分期唯一标识符 |
| due_date | string | 分期到期日，格式为 YYYY-MM-DD |
| business_due_date | string | 分期工作日到期日，格式为 YYYY-MM-DD |
| pre_fixed_amount | number | 利息金额 |
| principal_amortization_amount | number | 待摊还的本金金额 |
| total_amount | number | 分期总金额（利息 + 本金） |
| bank_slip_key | string | 银行 Boleto 的标识密钥 |
| qr_code_key | string | PIX QR Code 的标识密钥 |
| qr_code_url | string | PIX QR Code 付款 URL |
| digitable_line | string | 银行 Boleto 的可输入行 |

---

# 简介

URL: /zh-Hans/documentation/emissao_de_divida/introducao

本节将介绍信贷合同的发行、正式化、放款及取消所需的步骤。

## 1. 提交债务发行所需文件

要发行债务，需满足某些监管标准。其中之一是发行信贷的金融机构对债务人的身份识别。为满足这一要求，至少需要提交以下文件：

- **个人债务人**：附有照片的官方证件（身份证或驾驶证）；
- **法人债务人**：公司章程/社会合同、选举会议记录（股份公司情况下）、代表人附照片的官方证件以及授权书（如存在代理人）；

发送文件时，请使用我们的[文件上传端点](../upload_de_documentos)。

:::danger 注意！

QI Tech 提供入职、OCR 文件验证和反欺诈解决方案。

[点击此处查看该服务的 API 文档。](/documentation/caas/onboarding/natural_person)

如需报价，请联系我们的商务团队：

comercial@qitech.com.br 或 (11) 2339-4763
:::

## 2. 债务模拟

QI Tech 为客户提供了在实际发行前[模拟信贷操作金额](simulacao_de_divida_novo)的功能。模拟遵循与债务发行请求相同的模式，但无需提供债务人的注册信息和放款账户信息。此外，我们还支持通过单次请求进行多次模拟。

## 3. 债务发行
确定信贷操作草案后，QI Tech 支持团队将在平台上配置合同参数，之后可通过债务发行端点生成 PDF，具体情况如下：
- [个人债务发行。](emissao/emissao_de_divida_pf)
- [法人债务发行。](emissao/emissao_de_divida_pj)

## 4. 签署信贷合同
签署流程因可用产品而异。
如需了解签署配置，[请点击此处](formalizacao/introducao_formalizacao)。

## 5. 向债务人放款
放款是自动进行的，可通过两种方式配置。
如需了解放款配置，[请点击此处](emissao/exemplo_payloads_desembolso)。

---
## 转让流程
完成上述所有步骤后，进入债务转让流程，该流程 100% 由 QI Tech 主导。

如需了解放款的更多详情，[请点击此处](desembolso_da_operacao)。

---

# Metadata

URL: /zh-Hans/documentation/emissao_de_divida/metadata

允许通过自定义键值对查询信贷操作的对象。

## 1. 创建 Metadata

### 请求体对象
| 字段 | 类型 | 描述 | 最大字符数 | 
|---------------------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------|
| **metadata_key** * | string | Metadata 键 | 100 |
| **metadata_value** * | string | Metadata 值 | 100 |

### 请求

ENDPOINT /credit_operation/[CREDIT-OPERATION-KEY]/metadata
MÉTODO POST

请求体

```json
{
    "metadata_key": "key",
    "metadata_value": "value"
}
```

## 2. 删除 Metadata

### 请求

ENDPOINT /credit_operation/[CREDIT-OPERATION-KEY]/metadata
MÉTODO DELETE

请求体

```json
{
    "metadata_key": "key",
    "metadata_value": "value"
  }
```

## 3. 通过 Metadata 查询信贷操作

:::caution 
通过 metadata 查询时，必须同时提供"metadata_key"和"metadata_value"两个字段。
:::

### 请求

ENDPOINT /credit_operations
MÉTODO GET
<div className='badge
badge--primary'>PARAMETERS page, page_size, metadata_key, metadata_value, credit_operation_status

### 响应

响应体
```json
{
    "data": [
        {
            "credit_operation_key": "cc217253-e89f-4d14-bf89-fb29afaa2895",
            "contract_number": "0000000007/WO",
            "credit_operation_status": "waiting_signature",
            "installments": [],
            "disbursement_options": [],
            "related_parties": []
        }
    ],
    "pagination": {
        "current_page": 1,
        "next_page": 2,
        "rows_per_page": 10,
        "total_pages": 1,
        "total_rows": 1,
        "contain_last_page": true
    }
}

```

---

# 简介

URL: /zh-Hans/documentation/emissao_de_divida/reapresentacao_de_conta_bancaria

本页将帮助您在放款失败后重新提交银行账户信息

### 1 - 更新银行账户

首先，您需要更新借款人的银行账户信息

#### 请求

ENDPOINT /debt/DEBT/disbursement_bank_accounts
MÉTODO PUT

请求体

**使用银行账户信息**

```json
{
	"disbursement_bank_accounts": [{
			"document_number": "31233261000185",
			"name": "Jorge Augusto Salgado Salhani",
			"pix_transfer_type": "manual",
			"bank_code": "329",
			"branch_number": "0001",
			"account_number": "62400",
			"account_digit": "6",
			"percentage_receivable": 100
		}]
}
```

**使用 PIX 密钥**

```json
{
	"disbursement_bank_accounts": [{
			"document_number": "31233261000185",
			"name": "Jorge Augusto Salgado Salhani",
			"pix_key": "2f205c99-3161-4120-badd-854039d12de6",
			"pix_transfer_type": "key"
		}]
}
```

### 2 - 更新放款日期

然后，您需要更新放款日期

#### 请求

ENDPOINT /debt/DEBT/disbursement_option
MÉTODO PATCH

请求体

**更新放款日期**

```json
{
    "disbursement_date": "2025-11-28",
    "status": "active"
}
```

---

# 重新发送信贷合同关联方文件

URL: /zh-Hans/documentation/emissao_de_divida/reenviar_documentos_das_partes_relacionadas

## 请求

ENDPOINT /debt/ DEBT-KEY /related_party/ RELATED-PARTY-KEY /attached_document
MÉTODO POST

**请求体**

```json
{
    "document_identification": "2893fc74-88fd-4cc9-a5c6-8a63d9d00f41",
    "document_identification_back": "e881ddf4-bc9a-48e0-9555-cac979f65431",
    "wedding_certificate": "955a0e36-1abd-4efd-868a-f0b3d53bc585",
    "proof_of_residence": "ea5f7b08-77fd-4adb-8bf5-f86379c28ee3",
    "company_statute": "150292ad-be66-4ba0-a306-0ceda20616f0",
    "directors_election_minute": "ca37979e-6f11-4465-bf3b-69cd8307549c",
    "insurance_agreement":"4be38197-e8a9-4c96-882d-99e38a7199a7"
}

```

### 路径参数

| 字段 | 类型 | 描述 |
|---|---|---|
| `debt_key` * | string | 操作的 debt_key。 |
| `related_party_key` * | string | 需要发送文件的关联方的密钥。 |

### 请求体参数

| 字段 | 类型 | 描述 | 字符数 | 
|---|---| ---| ---|
| `document_identification` | string | person_type 为"natural"时的身份证或驾驶证正面。 | uuid 密钥 | 
| `document_identification_back` | string | person_type 为"natural"时的身份证或驾驶证背面。 | uuid 密钥 | 
| `wedding_certificate` | string | person_type 为"natural"时的结婚证。 | uuid 密钥 | 
| `proof_of_residence` | string | person_type 为"natural"时的居住证明。 | uuid 密钥 | 
| `company_statute` | string | person_type 为"legal"时的公司章程。 | uuid 密钥 | 
| `insurance_agreement` | string | 信贷操作保险合同证据。 | uuid 密钥 | 

## 响应

STATUS 201

**响应体**

```json
"
{}
"
```

STATUS 400

**响应体**

```json
{
  "data": "{\"title\": \"Bad Request\", \"description\": \"Invalid request body.\", \"translation\": \"Corpo da requisição inválido.\", \"extra_fields\": {}, \"code\": \"LEG000069\"}"
}
```

---

# 放款后操作

URL: /zh-Hans/documentation/emissao_de_divida/reprocessar_acao_pos_desembolso

## 1. 放款后操作执行成功或失败的 Webhooks

:::info 提示
*action_key* 是放款后操作的标识密钥。

:::

### 成功

WEBHOOK_TYPE debt_actions
STATUS success

**Boleto**

```json title='Webhook Body'
{
    "key": "19dee101-a781-4308-b7d1-f4426c2df111",
    "data": [
        {
            "status": "done",
            "action_key": "02f6392b-65d3-4f3e-ae91-cd5b371c7111",
            "action_data": {
                "digitable_line": "11193708089000014656468000284304297860007686111"
            },
            "action_type": "bankslip_payment",
            "action_error": null,
            "execution_data": {}
        }
    ],
    "webhook_type": "debt_actions",
    "event_datetime": "2024-07-23 21:31:18"
}
```

**TED**

```json title='Webhook Body'
{
    "key": "25f14329-3734-40d8-bc5a-c5349b3cd111",
    "data": [
        {
            "status": "done",
            "action_key": "650e9041-65ec-4fd8-9b11-01e37316cf94",
            "action_data": {
                "qr_code": null,
                "destination": {
                    "name": "TOMAR DIVIDA",
                    "account_digit": "1",
                    "account_branch": "0001",
                    "account_number": "12214111",
                    "document_number": "61359908021",
                    "financial_institution_code_number": "380"
                },
                "digitable_line": null,
                "pix_transfer_type": null,
                "transaction_amount": 500
            },
            "action_type": "funds_transfer",
            "action_error": null,
            "execution_data": {}
        }
    ],
    "webhook_type": "debt_actions",
    "event_datetime": "2024-07-04 10:03:33"
}
```

  

### 放款后操作错误

如果放款后操作付款发生错误，合作方将通过以下 webhook 收到通知：

WEBHOOK_TYPE after_disbursement_action_update
STATUS error

**Boleto**

```json title='Webhook Body'
{
	"key": "e358e7e3-17b8-4aab-9da1-92f6b78dea00",
	"data": {
		"status": "error",
		"action_key": "e2495e5a-df32-4826-b6f0-419014d3c35a",
		"error_data": {
			"error_code": "QIT000007",
			"description": "Account blocked balance cannot be negative."
		},
		"action_data": {
            "digitable_line": "10495419967200010004900031456924592920008049295"
		},
		"action_type": "bankslip_payment",
		"execution_data": null
	},
	"webhook_type": "after_disbursement_action_update",
	"event_datetime": "2023-03-22 12:06:38"
}
```

**TED**

```json title='Webhook Body'
{
	"key": "e358e7e3-17b8-4aab-9da1-92f6b78dea00",
	"data": {
		"status": "error",
		"action_key": "e2495e5a-df32-4826-b6f0-419014d3c35a",
		"error_data": {
			"error_code": "QIT000007",
			"description": "Account blocked balance cannot be negative."
		},
		"action_data": {
			"destination": {
			    "name": "Nome Credor Original",
				"account_digit": "0",
				"account_branch": "0897",
				"account_number": "20001",
				"document_number": "87163234000138",
				"financial_institution_code_number": "341"
			},
			"transaction_amount": 1000
		},
		"action_type": "funds_transfer",
		"execution_data": null
	},
	"webhook_type": "after_disbursement_action_update",
	"event_datetime": "2023-03-22 12:06:38"
}
```

### 放款后操作 TED 冲销

如果放款后操作中执行的 TED 被目标金融机构退回，合作方将通过以下 webhook 收到通知：

WEBHOOK_TYPE after_disbursement_action_update
STATUS refused

```json title='Webhook Body'
{
	"key": "f4b5c36a-2aa1-4865-9678-e5a6fa585845",
	"data": {
		"status": "refused",
		"action_key": "cf3b8809-36dc-4574-8763-3600e413cf5c",
		"error_data": {
			"code": "agencia_conta_invalida",
			"description": "Agência ou Conta Destinatária do Crédito Inválida"
		},
		"action_data": {
			"destination": {
				"name": "SILVANA RAMOS DOS SANTOS",
				"account_digit": "1",
				"account_branch": "0150",
				"account_number": "301771620",
				"document_number": "30874011884",
				"financial_institution_code_number": "237"
			},
			"transaction_amount": 3200
		},
		"action_type": "funds_transfer",
		"action_amount": 3200.0
	},
	"webhook_type": "after_disbursement_action_update",
	"event_datetime": "2023-03-23 14:46:39"
}
```

## 2. 更改操作数据后重新处理放款后操作

如果放款后操作付款发生错误/冲销，可通过以下端点重试：

### 路径参数

| 字段 | 类型 | 描述 |
|---|---| ---|
| `action_key` * | string | 创建信贷操作时返回的操作密钥。 | 

### 请求

ENDPOINT /baas/action/ ACTION-KEY
MÉTODO PATCH

请求体

**TED**

```json
{
    "destination": {
        "name": "Nome Credor Original",
        "account_digit": "0",
        "account_branch": "0897",
        "account_number": "20001",
        "document_number": "87163234000138",
        "financial_institution_code_number": "341"
    },
    "transaction_amount": 4736.07
}
```
  
  
**Boleto 可输入行**

```json
{
    "digitable_line": "10495419967200010004900031456924592920008041111"
}
```

**PIX 复制粘贴**

```json
{
    "qr_code": "00020126930014br.gov.bcb.pix2571qrcode-h.sandbox.qitech.app/bacen/cobv/66e9a02c1c304b1eacf7ba984eea19ce5204000053039865802BR5925BANKSOFTTECNOLOGIALTDA(EB6008SaoPaulo61080145200062070503***6304E27B",
    "pix_transfer_type": "qr_code",
    "transaction_amount": "299.00"
}
```

## 3. 不更改数据重新处理放款后操作

### 请求

ENDPOINT /baas/action/action_retry/ ACTION-KEY
MÉTODO PATCH

:::info 信息
两个端点的响应相同。
:::

### 响应

STATUS 200

响应体

```json
{
	"action_data": {
		"origin_key": "8b8742f0-0b7c-4939-bfcf-9bae8c60c088",
		"pdf_encoded_string": "\<BASE 64 DO PDF DO COMPROVANTE\>",
		"source_account": {
			"account_branch": "0001",
			"account_digit": "1",
			"account_number": "2788652",
			"financial_institution_compe_number": 329,
			"financial_institution_name": "QI SCD S.A.",
			"owner_document_number": "12345678911",
			"owner_document_number_formatted": "123.456.789-11",
			"owner_name": "Nome do titular da conta"
		},
		"source_subtype": "withdrawal",
		"source_subtype_translation_ptbr": "Transferência",
		"target_account": {
			"account_branch": "1012",
			"account_digit": "1",
			"account_number": "12345",
			"account_type": "checking_account",
			"account_type_str": "Conta Corrente",
			"financial_institution_compe_number": "341",
			"financial_institution_name": "ITAÚ UNIBANCO S.A.",
			"owner_document_number": "12345678911",
			"owner_document_number_formatted": "125.220.107-94",
			"owner_name": "Nome do titular da conta destino"
		},
		"transacted_at": "2023-03-14 17:57:20",
		"transacted_at_br": "2023-03-14 14:57:20",
		"transacted_at_br_formatted": "14/03/2023, 14:57:20",
		"transacted_at_formatted": "14/03/2023, 17:57:20",
		"transaction_amount": 2000,
		"transaction_amount_formatted": "R$ 2.000,00",
		"transaction_key": "ae139d20-396e-4c7e-a675-a8cb01160f5d"
	},
	"action_key": "fe3f251d-6b85-4d35-96dd-08fc37d09a82"
}
```

STATUS 400

响应体

```json
{
  "data": "{\"title\": \"Bad Request\", \"description\": \"Invalid request body.\", \"translation\": \"Corpo da requisição inválido.\", \"extra_fields\": {}, \"code\": \"LEG000069\"}"
}

```

STATUS 402

响应体

```json
{
  "data": "{\"title\": \"Block Balance Error\", \"description\": \"Impossible to block an amount greater than account balance\", \"translation\": \"Não é possível blockear uma quantidade maior do que o saldo na conta\", \"extra_fields\": {}, \"code\": \"ACC000018\"}"
}

```

---

# 更改放款数据

URL: /zh-Hans/documentation/emissao_de_divida/reprocessar_multiplas_datas/trocar_conta

## 请求

ENDPOINT /debt/ DEBT-KEY /disbursement_bank_accounts
MÉTODO PUT

### 路径参数

| 字段 | 类型 | 描述 |
|---|---| ---|
| `debt_key` *（必填）* | string | 已发行债务的 ID。 |

**请求体**

```json
{
	"disbursement_bank_accounts": [{
		"bank_code": "329",
		"branch_number": "001",
		"account_number": "6947216",
		"account_digit": "4",
		"account_type": "checking_account",
		"document_number": "946321801",
		"name": "Pedro Felipe Henrique Alves",
		"percentage_receivable": 100
	}]
}
```

### 请求体参数

债务发行必须包含放款的银行账户信息，默认情况下为债务人名下的账户。

| 字段 | 类型 | 描述 | 最大字符数 | 
|-----------------------|--------|----------------------------------------------------------------------------------------------------|--------------|
| name * | string | 账户持有人姓名 | 50 |
| document_number * | string | 账户持有人 CPF | 11 |
| bank_code * | string | 金融机构的 COMPE 代码（https://www.bcb.gov.br/pom/spb/estatistica/port/ASTR003.pdf） | 3 |
| branch_number * | string | 支行号码（请勿填写支行验证位！） | 4 |
| account_number * | string | 账号（不含验证位！） | 10 |
| account_digit * | string | 账户验证位（字母处填写零） | 1 |
| account_type | enum | [账户类型枚举值](#enumerador-account-type) 账户类型 | 1 |

## 响应

STATUS 200

**响应体**

```json
{}
```

STATUS 400

**响应体**

```json
{
  "data": "{\"title\": \"Bad Request\", \"description\": \"Invalid request body.\", \"translation\": \"Corpo da requisição inválido.\", \"extra_fields\": {}, \"code\": \"LEG000069\"}"
}
```

---

# 更改放款日期

URL: /zh-Hans/documentation/emissao_de_divida/reprocessar_multiplas_datas/trocar_data

## 请求

ENDPOINT /debt/ DEBT-KEY /disbursement_option
MÉTODO PATCH

### 路径参数

| 字段 | 类型 | 描述 |
|---|---| ---|
| `debt_key` *（必填）* | string | 已发行债务的 ID。 |

**请求体**

```json
{
    "disbursement_date": "2023-06-30",
    "status": "active"
}
```

### 请求体参数

| 字段 | 类型 | 描述 |
|---|---| ---|
| `disbursement_date` | string | 操作的放款日期。 |
| `status` | string | 表示日期是否应被配置或删除。 |

## 响应

STATUS 200

**响应体**

```json
{
	"data": {
		"additional_iof": 17.770586,
		"annual_cet": 31.682,
		"assignment_amount": 4676.97,
		"base_iof": 127.71954759,
		"borrower": {
			"document_number": "88229032939",
			"name": "Teste",
			"related_party_key": "13d210c8-d39a-40f9-bd16-b6ab81d35fa8"
		},
		"cet": 2.32,
		"collaterals": [],
		"contract": {
			"number": "0000051370/TG",
			"urls": []
		},
		"contract_fee_amount": 0.5,
		"contract_fees": [],
		"disbursed_issue_amount": 4530.98,
		"installments": [],
		"issue_amount": 4676.47,
		"net_external_contract_fee_amount": 0.0,
		"number_of_installments": 36,
		"prefixed_interest_rate": {
			"annual_rate": 0.28777498,
			"created_at": "2023-07-07T18:13:42",
			"daily_rate": 0.00069316,
			"interest_base": "calendar_days_365",
			"monthly_rate": 0.0213
		},
		"requester_identifier_key": "7d174b91-e411-4375-b788-9ced9b941cd0",
		"total_iof": 145.49,
		"total_pre_fixed_amount": 2163.53022742
	},
	"event_datetime": "2023-07-07 19:04:20",
	"key": "7d174b91-e411-4375-b788-9ced9b941cd0",
	"status": "waiting_signature",
	"webhook_type": "debt"
}
```

STATUS 400

**响应体**

```json
{
  "data": "{\"title\": \"Bad Request\", \"description\": \"Invalid request body.\", \"translation\": \"Corpo da requisição inválido.\", \"extra_fields\": {}, \"code\": \"LEG000069\"}"
}
```

---

# 保险

URL: /zh-Hans/documentation/emissao_de_divida/seguro

QI Tech 为客户提供在信贷操作中附加保险的可能性，本文将帮助您了解如何在我们的 API 中使用该产品并深入了解该新产品。

:::caution 注意
该产品仅对已注册的合作方开放，请咨询我们的商务团队了解更多详情。
:::

## 如何使用

要订购保险或模拟含保险的债务，应在回扣列表中添加类型为 "insurance_premium_qi" 的回扣，无需声明任何金额，因为金额将根据提案的发行金额和所订购的保险产品计算。

:::caution 注意
不能将 tac 或 **insurance_premium** 类型的回扣与 **insurance_premium_qi** 一起使用。
:::

回扣对象

```json
{
  "rebates": [
    {
      "fee_type": "insurance_premium_qi",
      "description": "insurance_premium_plus"
    }
  ]
}
```

## 债务模拟

### 请求

下面的示例描述了一次包含保险报价的债务模拟请求。

ENDPOINT /fgts_simulation
MÉTODO POST

请求体

```json
{
  "borrower": {
    "person_type": "natural",
    "individual_document_number": "46338864879",
    "birth_date": "1996-03-20"
  },
  "financial": {
    "desired_installments": [
      {
        "total_amount": 200,
        "due_date": "2023-10-01"
      }
    ],
    "interest_type": "pre_price_days",
    "disbursement_date": "2023-03-03",
    "fine_configuration": {
      "monthly_rate": 0,
      "interest_base": "calendar_days",
      "contract_fine_rate": 0
    },
    "monthly_interest_rate": 0.018,
    "credit_operation_type": "ccb",
    "interest_grace_period": 0,
    "number_of_installments": 1,
    "principal_grace_period": 0,
    "rebates": [
      {
        "fee_type": "insurance_premium_qi",
        "description": "insurance_premium_plus"
      }
    ]
  }
}
```

### 响应

STATUS 200

响应体

```json
{
    "type": "debt",
    "key": "a445c71c-d752-4159-82bf-097d8125b66c",
    "status": "finished",
    "event_datetime": "2024-10-03 00:26:26",
    "data": {}
}
```

:::danger 警告
可以在模拟阶段验证保险收费的资格。\
为此，必须提供出生日期（**birth_date**）、债务人的 CPF（**document_number**）以及回扣 "**insurance_premium_qi**"。\
如果 CPF 符合资格，将返回成功响应；如果不符合资格，模拟请求将返回错误。
:::

:::danger 警告
提交出生日期（**birth_date**）**在含保险的模拟中不是必填项**。但在债务发行时，若订购了该产品，则该字段为必填项。
:::

## 查询 CPF 的保险资格

持有 **CPF** 数据后，可以查询该 CPF 的资格。

### 请求

ENDPOINT /debts/borrower/[document_number]/insurance_premium_eligibility?birth_date=1994-06-11&issue_amount=150
METHOD GET

### 参数

| 字段 | 描述 |
|-------------------|-----------------------------------------|
| `document_number` | 债务人的 CPF 号码 |
| `birth_date` | 出生日期 |
| `issue_amount` | 信贷操作的发行金额 |

### 响应

STATUS 200

响应体

```json
{
    "eligible": true
}
```

### 描述
| 字段 | 类型 |
|------------------------------|--------|
| `elegible` | boolean |

:::caution 注意
对于返回 **"elegible": false** 的 CPF，含 **insurance_premium_qi** 的模拟和债务发行都将不可能执行。
:::

## 创建债务

要创建含保险的债务，需要借款人的一些必填数据，如**地址、电话、电子邮件和出生日期**。如果省略其中任何数据，债务将无法发行。

### 请求

ENDPOINT /debt
MÉTODO POST

请求体

```json
{
  "borrower": {
    "person_type": "natural",
    "individual_document_number": "46338864879",
    "name": "PATRICIA APARECIDA DO NASCIMENTO PEREIRA DA SILVA",
    "is_pep": false,
    "mother_name": "HELENA DO NASCIMENTO PEREIRA DA SILVA",
    "email": "email@email.com",
    "birth_date": "1994-06-11",
    "phone": {
      "number": "900000000",
      "area_code": "11",
      "country_code": "055"
    },
    "address": {
      "city": "São Paulo",
      "state": "SP",
      "number": "215",
      "street": "Gilberto Sabino",
      "complement": "s/c",
      "postal_code": "12345012",
      "neighborhood": "Pinheiros"
    }
  },
  "financial": {
    "desired_installments": [
      {
        "total_amount": 200,
        "due_date": "2023-10-01"
      }
    ],
    "interest_type": "pre_price_days",
    "disbursement_date": "2023-03-03",
    "fine_configuration": {
      "monthly_rate": 0,
      "interest_base": "calendar_days",
      "contract_fine_rate": 0
    },
    "monthly_interest_rate": 0.018,
    "credit_operation_type": "ccb",
    "interest_grace_period": 0,
    "number_of_installments": 1,
    "principal_grace_period": 0,
    "rebates": [
      {
        "fee_type": "insurance_premium_qi",
        "description": "insurance_premium_plus"
      }
    ]
  },
  "disbursement_bank_account": {
    "ispb_number": "18236120",
    "branch_number": "1",
    "account_number": "87823171",
    "account_digit": "0",
    "document_number": "46338864879",
    "name": "PATRICIA APARECIDA DO NASCIMENTO PEREIRA DA SILVA",
    "percentage_receivable": 1
  },
  "purchaser_document_number": "32402502000135"
}
```

### 响应

STATUS 201

响应体

```json
{
  "webhook_type": "debt",
  "key": "7a9bb512-7b38-4dbc-a109-1bc122b67a4a",
  "status": "waiting_signature",
  "event_datetime": "2023-03-03 18:06:18",
  "data": {}
}
```

## Webhooks

### 保险已发行

保险将在操作放款后发行，当保险发行完成时，将发送以下包含保险数据的 webhook。

:::caution 注意
收到保险票据已发行的 webhook 时，必须将生成的票据文件传送给信贷借款人。
:::

Webhook Body

```json
{
  "data": {
    "credit_operation_key": "5ae2c008-44c1-4435-bbfa-094a4b11d962",
    "insurance_policy_document_key": "9990ce22-aeac-4728-82da-d1f22c33873f",
    "insurance_date": "2024-09-11",
    "term_start_date": "2024-09-11",
    "term_end_date": "2025-09-11",
    "insurance_amount": 1600,
    "operation_amount": 6400,
    "covers": [
      {
        "cover_amount": 200,
        "cover_type": "permanent_disability",
        "cover_prize_amount": 572.82
      },
      {
        "cover_amount": 100,
        "cover_type": "accidental_death",
        "cover_prize_amount": 572.82
      },
      {
        "capitalcover_amount_segurado": 300,
        "cover_type": "unemployment",
        "cover_prize_amount": 572.82
      }
    ],
    "policy_number": "1098200000008",
    "prize_number": "3907",
    "insurance_premium_net_amount": 1145.63,
    "iof_amount": 4.37
  },
  "event_datetime": "2023-03-03 22:39:39",
  "key": "dc575950-dcce-48e1-99a6-5fb0ada63d86",
  "status": "active",
  "webhook_type": "insurance_premium.status_change"
}
```

### 保险已取消

当信贷借款人希望放弃信贷操作且操作被撤销、超过某个承保限额（导致不符合保险资格），或借款人仅放弃保险时，保险可被取消。

:::caution 注意
保险票据只能在信贷操作放款后 7 个自然日内全额取消；如果在此之后取消，退还金额将按保险期限比例计算。
:::

Webhook Body

```json
{
    "key": "dc575950-dcce-48e1-99a6-5fb0ada63d86",
    "data": {
        "cancel_reason": "reversed_operation",
        "credit_operation_key": "2fbd6613-3228-5gdg-9377-93db394bf2d4"
    },
    "status": "canceled",
    "webhook_type": "insurance_premium.status_change",
    "event_datetime": "2023-03-03 22:39:39"
}
```

### 取消原因

| cancel_reason | 描述 |
|-------------------------------|----------------------------------------|
| `reversed_operation` | 操作已撤销，保险已取消 |
| `cover_limit_amount_exceeded` | 仅保险被取消。某个承保限额被超过，无法发行保险 |
| `insurance_premium_cancel` | 仅保险被取消。借款人直接与保险公司取消 |

## 保险查询

### 请求

ENDPOINT /debt/[debt_key]/insurance_premiums
METHOD GET

### 响应

STATUS 200

响应体

```json
{
  "data": [],
  "pagination": {
    "current_page": 0,
    "next_page": 0,
    "rows_per_page": 1
  }
}
```

### 请求

ENDPOINT /debt/[DEBT-KEY]/insurance_premium/[INSURANCE-PREMIUM-KEY]
METHOD GET

### 响应

STATUS 200

响应体

```json
{
  "insurance_premium_key": "e4fe84e3-cc71-481b-87ea-8a07f7d69079",
  "status": "active",
  "credit_operation_key": "5ae2c008-44c1-4435-bbfa-094a4b11d962",
  "disbursement_key": "bd0ea133-ff47-4a21-a3e6-24186e5e2fc1",
  "contract_number": "4069550961/QIT",
  "requester_key": "1040ce22-aeac-4728-82da-d1f22c33873f",
  "insurance_policy_document_key": "9990ce22-aeac-4728-82da-d1f22c33873f",
  "insurance_date": "2024-09-11",
  "term_start_date": "2024-09-11",
  "term_end_date": "2025-09-11",
  "insurance_amount": 1600,
  "operation_amount": 6400,
  "covers": [],
  "policy_number": "1098200000008",
  "prize_number": "3907",
  "insurance_premium_net_amount": 1145.63,
  "iof_amount": 4.37
}
```

## 查询票据文件

:::caution 注意
文件链接有效期为 15 分钟。
:::

### 请求

ENDPOINT /document/[DOCUMENT-KEY]/url
METHOD GET

### 响应

STATUS 200

响应体

```json
{
    "document_key": "a11dc0fe-51ed-41aa-bb40-bca80d6e515b",
    "signed_document_url": null,
    "document_url": "https://storage.googleapis.com/dev-doc-api-private/documents/...",
    "expiration_datetime": "2023-03-03T19:08:53.000Z"
}
```

---

# 债务模拟（旧版）

URL: /zh-Hans/documentation/emissao_de_divida/simulacao_de_divida_antigo

QI Tech 为客户提供在实际发行前模拟信贷操作金额的功能。模拟遵循与债务发行请求相同的模式，但无需提供债务人的注册信息和放款账户数据。

## 请求

以下示例描述了一次债务模拟请求。

ENDPOINT /debt_simulation
MÉTODO POST

请求体

**到期日和分期金额**

```json
{
    "borrower": {
        "person_type": "natural"
    },
    "financial": {
        "desired_installments": [
            {
                "total_amount": 578.69,
                "due_date": "2027-04-01"
            },
            {
                "total_amount": 304.25,
                "due_date": "2028-04-01"
            }
        ],
        "interest_type": "pre_price_days",
        "disbursement_date": "2026-09-06",
        "fine_configuration": {
            "monthly_rate": 0.0,
            "interest_base": "calendar_days",
            "contract_fine_rate": 0.0
        },
        "annual_interest_rate": 0.2387205,
        "credit_operation_type": "ccb",
        "interest_grace_period": 0,
        "number_of_installments": 2,
        "principal_grace_period": 0,
        "rebates": [
            {
                "amount": 10,
                "fee_type": "tac",
                "amount_type": "absolute",
                "rebate_bank_account": {
                    "name": "CONTA BANCARIA",
                    "bank_code": "329",
                    "account_digit": "1",
                    "branch_number": "0001",
                    "account_number": "00003",
                    "document_number": "32402502000135"
                }
            }
        ]
    }
}
```

**利率和分期日期**
```json
{
  "borrower": {
    "person_type": "natural"
  },
  "financial": {
    "interest_type": "pre_price_days",
    "disbursement_start_date": "2025-09-03",
    "disbursement_end_date": "2025-09-03",
    "issue_date": "2025-09-03",
    "fine_configuration": {
        "monthly_rate": 0,
        "contract_fine_rate": 0,
        "interest_base": "calendar_days"
      },
    "monthly_interest_rate": 0.1929244498,
    "disbursed_amount": 10000.00,
    "credit_operation_type": "ccb",
    "interest_grace_period": 0,
    "number_of_installments": 18,
    "principal_grace_period": 0,
    "due_dates": [
      "2025-09-28",
      "2025-10-28",
      "2025-11-28",
      "2025-12-28",
      "2026-01-28",
      "2026-02-28",
      "2026-03-28",
      "2026-04-28",
      "2026-05-28",
      "2026-06-28",
      "2026-07-28",
      "2026-08-28",
      "2026-09-28",
      "2026-10-28",
      "2026-11-28",
      "2026-12-28",
      "2027-01-28",
      "2027-02-28"
    ]
  }
}
```

## 响应

STATUS 200

响应体

```json
{
    "type": "debt",
    "key": "bf84379c-d4cf-4f16-a63c-865c129e6fce",
    "status": "finished",
    "event_datetime": "2025-03-27 22:28:37",
    "data": {}
}

```

## 定义

### 请求体

### Borrower 对象
| 字段 | 类型 | 描述 | 枚举值 |
|---|---|---|---|
| **person_type** | object | 操作债务人的法律性质 | natural 或 legal |

### Financial 对象
| 字段 | 类型 | 描述 | 最大字符数 |
|---|--- |---|---|
| **amout** | float | 信贷操作的发行/名义金额 | - |
| **interest_type** | object | **[利率类型枚举值](#enumerador-interest-type)** - 摊销方法和利率计算方式 | - |
| **credit_operation_type** | object | **[信贷操作类型枚举值](#enumerador-credit-operation-type)** - 信贷合同类型 | - |
| **annual_interest_rate** | float | 以年化小数表示的固定利率 | - |
| **disbursement_date** | date | 操作放款日期 | - |
| **interest_grace_period** | int | 利息宽限期（月） | - |
| **principal_grace_period** | int | 本金宽限期 | - |
| **number_of_installments** | int | 信贷操作的分期数 | - |
| **fine_configuration** | object | **[fine_configuration 对象](#objeto-fine-configuration)** - 逾期利息和罚款配置 | - |

### Fine Configuration 对象
| 字段 | 类型 | 描述 | 最大字符数 |
|---|---|---|---|
| **contract_fine_rate** | float | 以小数表示的逾期罚款百分比 | - |
| **interest_base** | enum | **[利率基准枚举值](#enumerador-interest-base)** - 利率计算基准 | - |
| **monthly_rate** | float | 以小数表示的月逾期利率 | - |

### 响应体
| 字段 | 类型 | 描述 | 最大字符数 |
|----------------------------|--------|---------------------------------|--------------|
| **data.data** | object | **[Data 对象](#objeto-data)** | - |
| **data.event_datetime** | date | 模拟生成时刻 | - |
| **data.key** | string | 模拟的唯一密钥 | - |
| **data.status** | string | _finished_ | - |
| **data.type** | string | _debt_ | - |

### Data 对象
| 字段 | 类型 | 描述 | 最大字符数 |
|-----------------------------------------|--------|-------------------------------------------------------------------------------------------------------------------------------|--------------|
| **annual_cet** | float | 以年化小数表示的总有效成本 | - |
| **assignment_amount** | float | 信贷操作的收购金额 | - |
| **cet** | float | 以月度小数表示的总有效成本 | - |
| **contract_fee_amount** | float | QI Tech 在操作中收取的费用 | - |
| **contract_fees** | object | **[Contract Fees 对象](#objeto-contract-fees)** - QI Tech 在操作中收取的费用列表 | - |
| **credit_operation_type** | enum | **[信贷操作类型枚举值](#enumerador-credit-operation-type)** - 信贷合同类型 | - |
| **disbursed_issue_amount** | float | 信贷操作的放款金额 | - |
| **disbursement_date** | date | 操作放款日期 | - |
| **disbursement_options** | list | 操作的放款选项列表（操作的财务金额可能因放款日期而有所不同） | - |
| **external_contract_fee_amount** | float | QI Tech 向合作方回扣的操作费用金额 | - |
| **external_contract_fees** | list | **[Contract Fees 对象](#objeto-contract-fees)** - QI Tech 向合作方回扣的操作费用列表 | - |
| **final_disbursement_amount** | float | 实际放款给债务人的金额 | - |
| **installments** | list | **[Installments 对象](#objeto-installments)** - 操作分期 | - |
| **interest_grace_period** | int | 利息宽限期（月） | - |
| **interest_payment_month_period** | int | 分期利率收取频率（月） | - |
| **interest_type** | enum | **[利率类型枚举值](#enumerador-interest-type)** - 摊销方法和利率计算方式 | - |
| **iof_amount** | float | IOF 总金额（基础 IOF 和附加 IOF 之和） | - |
| **issue_amount** | float | 信贷操作的发行/名义金额 | - |
| **issue_date** | date | 操作合同发行日期 | - |
| **net_external_contract_fee_amount** | float | QI Tech 向合作方回扣的操作净费用金额 | - |
| **operation_type** | enum | **[操作类型枚举值](#enumerador-operation-type)** | - |
| **post_fixed_interest_base** | enum | **[利率基准枚举值](#enumerador-interest-base)** - 利率计算基准 | - |
| **post_fixed_interest_rate** | object | **[Interest Rate 对象](#objeto-interest-rate)** - 合同浮动利率指数 | - |
| **prefixed_interest_rate** | object | **[Interest Rate 对象](#objeto-interest-rate)** - 合同名义固定利率 | - |
| **principal_amortization_month_period** | int | 分期本金收取频率（月） | - |
| **principal_grace_period** | int | 本金宽限期（月） | - |
| **requester_key** | string | 合作方在 QI 内的唯一标识密钥 | - |
| **total_pre_fixed_amount** | float | 债务人在信贷操作中支付的利息总额 | - |

### Contract Fees 对象
| 字段 | 类型 | 描述 | 最大字符数 |
|-----------------|-------|-----------------------------------------------------------------------------------------------------|--------------|
| **amount** | float | 费用金额（以百分比或绝对值表示，取决于 _amount_type_ 字段的值） | - |
| **amount_type** | enum | **[amount_type 枚举值](#enumerador-amount-type)** - 费用金额单位 | - |
| **fee_amount** | float | 操作中收取的绝对费用金额 | - |
| **fee_type** | enum | **[费用类型枚举值](#enumerador-fee-type)** - 操作中收取的费用类型 | - |

### Installments 对象
| 字段 | 类型 | 描述 | 最大字符数 |
|-----------------------------------|---------|--------------------------------------------------------------------------------|--------------|
| **business_due_date** | date | 分期在工作日的到期日 | - |
| **calendar_days** | int | 分期之间的自然日数 | - |
| **due_date** | date | 分期的自然日到期日 | - |
| **due_principal** | float | 分期到期日付款前的剩余本金 | - |
| **has_interest** | boolean | _true_ - 分期计息指示器 | - |
| **installment_number** | int | 分期编号 | - |
| **post_fixed_amount** | float | 分期支付的浮动利息金额 | - |
| **pre_fixed_amount** | float | 分期支付的固定利息金额 | - |
| **principal_amortization_amount** | float | 分期支付的摊销金额 | - |
| **tax_amount** | float | 分期的基础 IOF | - |
| **total_amount** | float | 分期总金额 | - |
| **workdays** | int | 分期之间的工作日数 | - |

### Interest Rate 对象
| 字段 | 描述 | 最大字符数 |
|-------------------|---------------------------------------------------------------------------------------|--------------|
| **annual_rate** | 以年化小数表示的固定/浮动利率 | - |
| **daily_rate** | 以日度小数表示的固定/浮动利率 | - |
| **interest_base** | **[利率基准枚举值](#enumerador-interest-base)** - 利率计算基准 | - |
| **monthly_rate** | 以月度小数表示的固定/浮动利率 | - |

# 枚举值

### _Person Type_ 枚举值
| 枚举值 | 描述 |
|------------------------|-----------------------|
| **legal** | 法人 |
| **natural** | 自然人 |

### _Account Type_ 枚举值
| 枚举值 | 描述 |
|------------------------|-----------------------|
| **checking_account** | 活期账户 |
| **deposit_account** | 存款账户 |
| **guaranteed_account** | 担保账户 |
| **investment_account** | 投资账户 |
| **payment_account** | 支付账户 |
| **saving_account** | 储蓄账户 |
| **salary_account** | 工资账户 |

### _Amount Type_ 枚举值
| 枚举值 | 描述 |
|------------------------|-----------------------|
| **absolute** | 绝对值 |
| **percentage** | 百分比值 |

### _Interest Type_ 枚举值
| 枚举值 | 描述 |
|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **pre_price_days** | Price 摊销法（等额分期），按日计算固定利率 |
| **pre_price** | Price 摊销法（等额分期），按固定周期（30天）计算固定利率 |
| **pre_sac** | SAC 摊销法（等额本金），按日计算固定利率 |
| **post_sac** | SAC 摊销法（等额本金），按日计算基于固定利率加浮动指数（cdi、ipca 或 igpm）的利率 |
| **post_price** | Price 摊销法（等额分期），按固定周期（30天）计算基于固定利率加浮动指数（cdi、ipca 或 igpm）的利率 |
| **post_price_days** | Price 摊销法（等额分期），按日计算基于固定利率加浮动指数（cdi、ipca 或 igpm）的利率 |

### _Credit Operation Type_ 枚举值
| 枚举值 | 描述 |
|---------------|--------------------------------|
| **ccb** | 银行信贷凭证 |
| **cce** | 出口信贷凭证 |
| **cci** | 房地产信贷凭证 |
| **nce** | 出口信贷票据 |

### _Interest Base_ 枚举值
| 枚举值 | 描述 |
|-----------------------|---------------------------------------------------------------------------|
| **workdays** | 以工作日为基准计算利率，按 252 天/年计算 |
| **calendar_days** | 以自然日为基准计算利率，按 360 天/年计算 |
| **calendar_days_365** | 以自然日为基准计算利率，按 365 天/年计算 |

### _Fee Type_ 枚举值
每种费用类型必须提前由 QI Tech 启用和配置

| 枚举值 | 描述 |
|-----------------------|----------------------------------------------------------------------------|
| **tac** | 开户费 |
| **spread** | 信贷操作收购金额中收取的溢价 |
| **warranty_analysis** | 担保分析费 |
| **ted_fee** | TED 费用 |
| **spread_ted_fee** | 信贷操作收购金额中收取的 TED 费用溢价 |

---

# 债务模拟（新版）

URL: /zh-Hans/documentation/emissao_de_divida/simulacao_de_divida_novo

QI Tech 为客户提供在实际发行前模拟信贷操作金额的功能。模拟遵循与债务发行请求相同的模式，但无需提供债务人的注册信息和放款账户数据。

## 请求

以下示例描述了一次债务模拟请求。

ENDPOINT /v2/credit_operation/simulation
MÉTODO POST

请求体

**到期日和分期金额**

```json
{
    "credit_operation_type": "ccb",
    "disbursed_issue_amount": 2800,
    "disbursement_date": "2025-09-24",
    "first_due_date": "2025-10-24",
    "force_installments_on_workdays": true,
    "interest_type": "pre_price_days",
    "issuer_person_type": "natural",
    "monthly_interest_rate": 0.04488,
    "number_of_installments": 12,
    "principal_amortization_month_period": 1
}
```

**放款金额和分期**

 ```json
{
    "credit_operation_type": "ccb",
    "disbursed_issue_amount": 460,
    "disbursement_date": "2025-09-24",
    "first_due_date": "2025-10-24",
    "force_installments_on_workdays": true,
    "interest_type": "pre_price_days",
    "issuer_person_type": "natural",
    "number_of_installments": 3,
    "principal_amortization_month_period": 1,
    "interest_base": "calendar_days_365",
    "installments": [
      {
        "due_date": "2026-02-26",
        "amount": 137.48
      },
      {
        "due_date": "2026-03-26",
        "amount": 180.56
      },
      {
        "due_date": "2026-04-27",
        "amount": 180.56
      }
    ]
  }
 ```

## 响应

STATUS 200

响应体

```json
{
  "additional_iof": 0.14,
  "annual_cet": 145.08,
  "assignment_amount": 36.21,
  "base_iof": 0.1,
  "cet": 7.76,
  "disbursed_amount": 35.9,
  "disbursement_date": "2024-09-06",
  "fees": [],
  "first_due_date": "2024-09-25",
  "installments": [],
  "interest_type": "pre_price_days",
  "issue_amount": 36.14,
  "prefixed_interest_rate": {
    "interest_base": "calendar_days",
    "annual_rate": 1.25219159,
    "daily_rate": 0.00225783,
    "monthly_rate": 0.07
  },
  "tax_configuration": {
    "additional_rate": 0.0038,
    "base_rate": 0.000082
  },
  "total_iof": 0.24
}

```

## 定义

### 请求体

### Payload
| 字段 | 类型 | 描述 | 最大字符数 |
|---|--- |---|---|
| **credit_operation_type** | enum | **[信贷操作类型枚举值](#enumerador-credit-operation-type)** - 信贷合同类型 | - |
| **disbursed_issue_amount** | float | 信贷操作的发行/名义金额 | - |
| **disbursement_date** | date | 操作放款日期 | - |
| **first_due_date** | date | 第一期分期到期日 | - |
| **force_installments_on_workdays** | boolean | _true_ - 分期安排在工作日的指示器 | - |
| **interest_type** | enum | **[利率类型枚举值](#enumerador-interest-type)** - 摊销方法和利率计算方式 | - |
| **issuer_person_type** | enum | **[Person Type 枚举值](#enumerador-person-type)** | - |
| **monthly_interest_rate** | float | 合同的月固定利率 | - |
| **number_of_installments** | int | 信贷操作的分期数 | - |
| **principal_amortization_month_period** | int | 本金摊销月数 | - |
| **installments** | list | **[Installments 对象](#objeto-installments)** - 操作分期 | - |

### 响应体

### Payload
| 字段 | 类型 | 描述 | 最大字符数 |
|-----------------------------------------|--------|-------------------------------------------------------------------------------------------------------------------------------|--------------|
| **annual_cet** | float | 以年化小数表示的总有效成本 | - |
| **assignment_amount** | float | 信贷操作的收购金额 | - |
| **cet** | float | 以月度小数表示的总有效成本 | - |
| **fees** | object | **[Fees 对象](#objeto-fees)** - QI Tech 在操作中收取的费用列表 | - |
| **disbursed_amount** | float | 信贷操作的放款金额 | - |
| **disbursement_date** | date | 操作放款日期 | - |
| **installments** | list | **[Installments Response 对象](#objeto-installments-response)** - 操作分期 | - |
| **interest_type** | enum | **[利率类型枚举值](#enumerador-interest-type)** - 摊销方法和利率计算方式 | - |
| **additional_iof** | float | 附加 IOF 金额 | - |
| **base_iof** | float | 基础 IOF 金额 | - |
| **total_iof** | float | 总 IOF 金额 | - |
| **issue_amount** | float | 信贷操作的发行/名义金额 | - |
| **tax_configuration** | object | **[Tax Configuration 对象](#objeto-tax-configuration)** - 税率值 | - |
| **first_due_date** | date | 第一期分期到期日 | - |
| **prefixed_interest_rate** | object | **[Interest Rate 对象](#objeto-interest-rate)** - 合同名义固定利率 | - |

### Fees 对象
| 字段 | 类型 | 描述 | 最大字符数 |
|-----------------|-------|-----------------------------------------------------------------------------------------------------|--------------|
| **amount** | float | 费用金额（以百分比或绝对值表示，取决于 _amount_type_ 字段的值） | - |
| **amount_type** | enum | **[amount_type 枚举值](#enumerador-amount-type)** - 费用金额单位 | - |
| **fee_amount** | float | 操作中收取的绝对费用金额 | - |
| **fee_type** | enum | **[费用类型枚举值](#enumerador-fee-type)** - 操作中收取的费用类型 | - |
| **type** | enum | **[来源类型枚举值](#enumerador-origin-type)** - 操作中收取的费用来源 | - |

### Installments Request 对象
| 字段 | 类型 | 描述 | 最大字符数 |
|-----------------------------------|---------|--------------------------------------------------------------------------------|--------------|
| **due_date** | date | 分期的自然日到期日 | - |
| **total_amount** | float | 分期总金额 | - |

### Installments Response 对象
| 字段 | 类型 | 描述 | 最大字符数 |
|-----------------------------------|---------|--------------------------------------------------------------------------------|--------------|
| **calendar_days** | int | 分期之间的自然日数 | - |
| **due_date** | date | 分期的自然日到期日 | - |
| **due_principal** | float | 分期到期日付款前的剩余本金 | - |
| **has_interest** | boolean | _true_ - 分期计息指示器 | - |
| **installment_number** | int | 分期编号 | - |
| **prefixed_amount** | float | 分期支付的固定利息金额 | - |
| **principal_amortization_amount** | float | 分期支付的摊销金额 | - |
| **tax_amount** | float | 分期的基础 IOF | - |
| **amount** | float | 分期总金额 | - |
| **due_interest** | float | 分期到期日付款前的剩余利息 | - |
| **period** | float | 分期周期 | - |
| **period_workdays** | float | 分期工作日周期 | - |
| **period_to_disbursement** | float | 到放款的周期 | - |
| **period_workdays_to_disbursement** | float | 到放款的工作日周期 | - |
| **calendar_days_to_disbursement** | int | 到放款的自然日数 | - |
| **workdays** | int | 分期之间的工作日数 | - |
| **workdays_to_disbursement** | int | 到放款的工作日数 | - |

### Interest Rate 对象
| 字段 | 描述 | 最大字符数 |
|-------------------|---------------------------------------------------------------------------------------|--------------|
| **annual_rate** | 以年化小数表示的固定/浮动利率 | - |
| **daily_rate** | 以日度小数表示的固定/浮动利率 | - |
| **interest_base** | **[利率基准枚举值](#enumerador-interest-base)** - 利率计算基准 | - |
| **monthly_rate** | 以月度小数表示的固定/浮动利率 | - |

### Tax Configuration 对象
| 字段 | 描述 | 最大字符数 |
|-----------------------|---------------------------------------------------------------------------------------|--------------|
| **base_rate** | 基础税率值 | - |
| **additional_rate** | 附加税率值 | - |

# 枚举值

### _Person Type_ 枚举值
| 枚举值 | 描述 |
|------------------------|-----------------------|
| **legal** | 法人 |
| **natural** | 自然人 |

### _Account Type_ 枚举值
| 枚举值 | 描述 |
|------------------------|-----------------------|
| **checking_account** | 活期账户 |
| **deposit_account** | 存款账户 |
| **guaranteed_account** | 担保账户 |
| **investment_account** | 投资账户 |
| **payment_account** | 支付账户 |
| **saving_account** | 储蓄账户 |
| **salary_account** | 工资账户 |

### _Amount Type_ 枚举值
| 枚举值 | 描述 |
|------------------------|-----------------------|
| **absolute** | 绝对值 |
| **percentage** | 百分比值 |

### _Interest Type_ 枚举值
| 枚举值 | 描述 |
|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **pre_price_days** | Price 摊销法（等额分期），按日计算固定利率 |
| **pre_price** | Price 摊销法（等额分期），按固定周期（30天）计算固定利率 |
| **pre_sac** | SAC 摊销法（等额本金），按日计算固定利率 |
| **post_sac** | SAC 摊销法（等额本金），按日计算基于固定利率加浮动指数（cdi、ipca 或 igpm）的利率 |
| **post_price** | Price 摊销法（等额分期），按固定周期（30天）计算基于固定利率加浮动指数（cdi、ipca 或 igpm）的利率 |
| **post_price_days** | Price 摊销法（等额分期），按日计算基于固定利率加浮动指数（cdi、ipca 或 igpm）的利率 |

### _Credit Operation Type_ 枚举值
| 枚举值 | 描述 |
|---------------|--------------------------------|
| **ccb** | 银行信贷凭证 |
| **cce** | 出口信贷凭证 |
| **cci** | 房地产信贷凭证 |
| **nce** | 出口信贷票据 |

### _Interest Base_ 枚举值
| 枚举值 | 描述 |
|-----------------------|---------------------------------------------------------------------------|
| **workdays** | 以工作日为基准计算利率，按 252 天/年计算 |
| **calendar_days** | 以自然日为基准计算利率，按 360 天/年计算 |
| **calendar_days_365** | 以自然日为基准计算利率，按 365 天/年计算 |

### _Fee Type_ 枚举值
每种费用类型必须提前由 QI Tech 启用和配置

| 枚举值 | 描述 |
|-----------------------|----------------------------------------------------------------------------|
| **tac** | 开户费 |
| **spread** | 信贷操作收购金额中收取的溢价 |
| **warranty_analysis** | 担保分析费 |
| **ted_fee** | TED 费用 |
| **spread_ted_fee** | 信贷操作收购金额中收取的 TED 费用溢价 |

### _Origin Type_ 枚举值
每种费用类型必须提前由 QI Tech 启用和配置

| 枚举值 | 描述 |
|-----------------------|----------------------------------------------------------------------------|
| **internal** | 内部来源费用 |
| **external** | 外部来源费用 |

---

# 在沙盒中模拟错误

URL: /zh-Hans/documentation/emissao_de_divida/simulando_erros

本页将帮助您在沙盒环境中模拟错误。

# 用于模拟放款错误的数据

使用以下银行数据，您可以模拟操作放款失败，以用于重新提交银行账户数据。

```json
account_digit: 0
account_number: 11581339
bank_code: 001
branch_number: 2874
document_number: 根据借款人文件调整
Nome: 根据借款人姓名调整
```

# 使用 QI Sign 签署时模拟错误的数据

在借款人文件的 开头 使用以下数字，您可以模拟 QI Sign 签署流程中的错误。

文件开头数字：
```json
0: 签署时检测到欺诈
8: 人脸活体验证失败
9: 人脸验证未达到最低允许分数
```

---

# 债务的可能状态

URL: /zh-Hans/documentation/emissao_de_divida/status_de_uma_divida

## 状态机
发行信贷合同后，可通过 QI Tech 平台的 Webhook 跟踪合同状态。

合同所经历的状态如下所述：

**waiting_signature**

合同发行后，首先处于"等待签署"状态，该状态持续到签署流程完成为止。

**signature_finished**

这是一个过渡状态，在收到最后一个签名后，合同会短暂进入"signature_finished"状态，此时 webhook 触发，随即转入下一状态。

**signed** 

签署完成后，合同状态变为"已签署"。

**issued**

这是一个过渡状态，在合同的放款日期当天，合同进入"issued"状态，等待放款后转入下一状态。

**disbursed**

这是一个过渡状态，放款完成后，合同会短暂进入"disbursed"状态，此时 webhook 触发，随即转入下一状态。

**opened**

放款后，合同状态变为"未结"——如果 QI Tech 不是该操作的催收代理，这将是最终状态。

**settled**

当 QI Tech 是信贷操作的催收代理时，合同将持续跟踪直至结清。最后一期还款完成后，状态变为"settled"，并触发 Webhook。

**canceled**

该状态表示操作流程中发生了某些错误，例如向债务人放款失败，或合同未在规定时间内完成签署。

**canceled_permanently**

当合同附有担保/背书时，这将是最终状态，表示担保/背书已释放，合同已被永久取消。

---

# 重发 Webhook

URL: /zh-Hans/documentation/notificacoes/reenvio_de_notificacoes

## 查询可重发的事件

ENDPOINT /webhook/event
方法 GET

### Query Params

| 字段 | 类型 | 描述 |
|---|---|---|
| `event_type` | string | 事件类型 |
| `callback_status` | string | 回调状态 |
| `origin_key` | string | 事件来源 key |
| `start_datetime` | string | 查询开始时间 |
| `end_datetime` | string | 查询结束时间（与开始时间的间隔不超过 14 天）|

## 重发特定 Webhook

ENDPOINT /webhook/event/EVENT_KEY
方法 PATCH

此操作将重新发送指定的 webhook 回调。

---

# 债务 Webhook

URL: /zh-Hans/documentation/webhooks/dividas

:::info 提示
我们 webhook 的响应超时时间为 5 秒。
:::

:::danger 注意！
QI Tech 的 webhooks 不应以严格方式进行映射。
API 返回的 webhook payload 中可能会添加额外字段。
:::

:::info Webhook 重发
您可以按照文档中的详细说明查询并重发 webhooks：[Webhook 重发](/documentation/notificacoes/reenvio_de_notificacoes)。
:::

## 签署完成 Webhook

Response Body

```json
{
    "key": "ebe12ca1-ec34-4674-bd62-24c0bc204e81",
    "status": "signature_finished",
    "webhook_type": "debt",
    "event_datetime": "2024-09-02 18:39:49",
    "signed_contract_url": "https://storage.googleapis.com/live-doc-api/documents/6099edd7-1c83-4890-998e-ce60e218523cb/S_signed.pdf"
}

```

## 发放 Webhook

Response Body

```json
{
    "key": "bb81d525s-aa4b-4ddf-81d6-aa4b41fd04nb",
    "data": {
        "installments": [...],
        "ted_receipt_list": [...],
        "requester_identifier_key": null
    },
    "status": "disbursed",
    "webhook_type": "debt",
    "event_datetime": "2025-10-26 17:00:52"
}
```

:::info 重要
当债务的银行划款生成后，会发送另一个 webhook：[分期 Webhook](/documentation/webhooks/parcelas)
:::

## 取消 Webhook

Response Body

```json
{
     "webhook_type": "debt",
     "key":"27a099df-4688-43cb-87fa-515b1cf343a5",
     "event_datetime": "2022-09-27 07:03:49",
    "data": {
        "cancel_reason": "Operacao cancelada manualmente",
        "cancel_reason_enumerator": "manual"
    },
     "status":"canceled "
  }

```

## 合同结清 Webhook

Response Body

```json
{
    "key": "27a099df-4688-43cb-87fa-515b1cf343a5",
    "data": {
        "settlement_amount": 3429.38
    },
    "status": "settled",
    "webhook_type": "debt",
    "event_datetime": "2022-09-27 07:03:49"
}
```

----

### 取消原因

| cancel_reason_enumerator | 描述 |
|---|---|
| disbursing_error | 发放时发生错误，操作被取消 |
| waiting_signature | 因缺少签名，操作被取消 |
| is_portability | 操作被取消，因为这是一个未完成的可携性操作 |
| not_collateral_constituted | 操作被取消，因为担保未构成 |
| entry_not_paid | 操作被取消，因为首付款未支付 |
| not_assigned | 操作被取消，因为转让流程未完成 |
| pix_max_retry | 操作被取消，因为接收银行无法收到发放款项 |
| lack_of_resource | 操作因资源不足被取消 |
| manual | 操作被手动取消 |
| kyc_not_accepted | 操作被取消，因为未通过合规审查 |
| not_collateral_fgts | 操作因 FGTS 错误被取消 |
| agencia_conta_invalida | 收款银行支行或账户无效 |
| invalid_account | 目标账号不存在或无效 |
| invalid_document_number | 目标账户的 CPF/CNPJ 不正确 |
| unsupported_transaction | 目标账户不支持此类交易 |
| bank_slip_payment | 因划款支付错误，操作被取消 |
| bank_slip_paid | 操作被取消，因为划款已支付 |
| bank_slip_written_off | 操作被取消，因为划款已核销 |
| invalid_ispb | ISPB 号码无效或不存在 |
| rejected_payment | 支付指令被接收银行拒绝 |
| disbursed_amount_refunded | 操作因发放金额退回而被取消 |

---

# Webhooks de gestão de risco

URL: /zh-Hans/documentation/webhooks/gestao_de_risco

O `risk_amount` corresponde ao saldo devedor das operações ainda **não cedidas** — ou seja, a exposição em aberto da carteira que permanece sob risco e que consome o limite (`limit_amount`) disponível para novos desembolsos. Conforme as operações são cedidas ou quitadas, elas deixam de compor o `risk_amount` e liberam limite para novos desembolsos.

:::danger Regra de desembolso
Se `risk_amount + issue_amount > limit_amount`, a operação não será desembolsada.
:::

:::tip Habilitação
Entre em contato com o time da QI Tech para configurarmos o envio!
:::

## Webhook de atualização de risco

Enviado periodicamente, **a cada hora**, com a atualização do valor de risco acumulado do cliente.

Response Body

```json
{
    "key": "b3a7e2c4-9d1f-4e8a-a456-2c3d4e5f6a7b",
    "data": {
        "risk_amount": 1500000,
        "limit_amount": 9000000,
        "reconciled_at": "2025-09-15T20:24:41"
    },
    "status": "completed",
    "webhook_type": "risk_management.risk_updated",
    "event_datetime": "2025-09-15T20:24:41Z"
}
```

## Webhook de atualização de limite

Enviado quando o limite de emissão de dívidas do cliente é atualizado.

Response Body

```json
{
    "key": "c4b8f3d5-0e2a-5f9b-b567-3d4e5f6a7b8c",
    "data": {
        "risk_amount": 0,
        "limit_amount": 9000000,
        "reconciled_at": "2025-09-15T18:03:54"
    },
    "status": "completed",
    "webhook_type": "risk_management.limit_updated",
    "event_datetime": "2025-09-15T18:03:54Z"
}
```

## Definições

### Objeto callback

| Campo | Tipo | Descrição | Obrigatório |
|-------|------|-----------|-------------|
| **event_datetime** | string | Data e hora do evento no formato ISO 8601 UTC | Sim |
| **key** | string | Chave única do evento | Sim |
| **status** | string | Status do evento | Sim |
| **webhook_type** | string | Tipo do webhook (`risk_management.risk_updated` ou `risk_management.limit_updated`) | Sim |
| **data** | object | Dados específicos do evento de gestão de risco | Sim |

### Objeto data

| Campo | Tipo | Descrição | Obrigatório |
|-------|------|-----------|-------------|
| **risk_amount** | number | Saldo devedor das operações ainda não cedidas — exposição em aberto da carteira que consome o limite disponível | Sim |
| **limit_amount** | number | Limite total disponível para emissão de novas dívidas | Sim |
| **reconciled_at** | string | Data e hora da última reconciliação no formato ISO 8601 | Sim |

---

# 不当款项 Webhook

URL: /zh-Hans/documentation/webhooks/indevidos

:::info 提示
我们 webhook 的响应超时时间为 5 秒。
:::

:::danger 注意！
QI Tech 的 webhooks 不应以严格方式进行映射。
API 返回的 webhook payload 中可能会添加额外字段。
:::

:::info Webhook 重发
您可以按照文档中的详细说明查询并重发 webhooks：[Webhook 重发](/documentation/notificacoes/reenvio_de_notificacoes)。
:::

## 简介

当 QI Tech 识别并处理不当款项退款时，此 webhook 会自动触发。验证完成后，系统将使用系统中注册的发放账户，通过 PIX 向借款人进行转账。此事件仅在退款成功完成时发送。

## 不当款项退款 Webhook

Response Body

```json
{
    "callback": {
        "event_datetime": "2024-01-15T14:30:00.000Z",
        "key": "fb34e0ac-2c98-47e7-9040-406b8c3d80e7",
        "status": "refunded",
        "webhook_type": "laas.devolution.refund_receipt",
        "data": {
            "devolution_key": "fb34e0ac-2c98-47e7-9040-406b8c3d80e7",
            "devolution_amount": 150.75,
            "devolution_status": "refunded",
            "devolution_reason_description": "The payment arrived earlier than expected. The difference between the paid amount and the present value should be refund",
            "receipt_url": "https://storage.googleapis.com/receipts/devolution_receipt_12345.pdf",
            "document_key": "cd27a0c3-630d-4682-81b2-71b5b325bcde",
            "transacted_at": "2024-01-15T14:25:30.000Z"
        }
    }
}
```

## 字段定义

### callback 对象

| 字段 | 类型 | 描述 | 必填 |
|-------|------|-----------|-------------|
| **event_datetime** | string | ISO 8601 UTC 格式的事件日期和时间 | 是 |
| **key** | string | 退款的唯一 key | 是 |
| **status** | string | 退款状态 | 是 |
| **webhook_type** | string | webhook 类型 | 是 |
| **data** | object | 退款的具体数据 | 是 |

### data 对象

| 字段 | 类型 | 描述 | 必填 |
|-------|------|-----------|-------------|
| **devolution_key** | string | 退款的唯一 key | 是 |
| **devolution_amount** | number | 退款金额（巴西雷亚尔）| 是 |
| **devolution_status** | string | 退款当前状态 | 是 |
| **devolution_reason_description** | string | 退款原因描述 | 是 |
| **receipt_url** | string | 退款凭证 URL | 是 |
| **document_key** | string | 相关文件的 key | 是 |
| **transacted_at** | string | ISO 8601 UTC 格式的交易日期和时间 | 是 |

## 可能的状态

| 状态 | 描述 |
|--------|-----------|
| **refunded** | 退款已成功处理 |

## 使用示例

当您收到此 webhook 时，表示已成功处理了一笔 PIX 退款。您可以：

1. 通过 `devolution_status` 字段验证退款状态
2. 通过 `receipt_url` 提供的 URL 访问凭证
3. 通过 `devolution_amount` 字段确认退款金额
4. 通过 `devolution_reason_description` 字段了解退款原因

---

# 分期支付 Webhook

URL: /zh-Hans/documentation/webhooks/pagamento_de_parcela

:::info 提示
我们 webhook 的响应超时时间为 10 秒。
:::

:::danger 注意！
QI Tech 的 webhooks 不应以严格方式进行映射。
API 返回的 webhook payload 中可能会添加额外字段。
:::

:::info Webhook 重发
您可以按照文档中的详细说明查询并重发 webhooks：[Webhook 重发](/documentation/notificacoes/reenvio_de_notificacoes)。
:::

----
### 分期支付 Webhook 示例

```json
{
    "key": "4219cb7b-32b9-45d1-b19c-24fbca04ca02",
    "webhook_type": "laas.credit_operation.installment.payment",
    "event_datetime": "2026-01-14 04:08:30",
    "data": {
        "installment_key":"1234cb7b-3329-12d1-429c-24f84975ca02",
        "reference_date":"2026-02-13",
        "paid_at":"2026-02-13 20:38:07",
        "paid_method_type":"pix",
        "installment_status":"paid_early",
        "installment_payment_key":"2accee19-ed22-43f9-9573-3b6232658337",
        "paid_amount":567.73,
        "total_amount":567.73,
        "present_total_amount":567.73,
        "prefixed_interest_payment_amount":556.73948769,
        "principal_amortization_payment_amount":10.99051231,
        "resource_account_key":"422cee19-ed22-43f9-9573-3b6111658337",
        "batch_renegotiation_proposal_key":null,
        "renegotiation_proposal_key":null,
        "received_portability_key":null,
        "refinancing_credit_operation_key":null,
        "bank_slip_key":null,
        "pix_qrcode_key":"3b61ee19-ed22-6119-9573-3b6119573337",
        "paid_in":{
                "name": "ITAÚ UNIBANCO S.A.",
                "code_number": 341,
                "ispb": 60701190
            }
    },
}
```

## 附录

### 字段说明 {#paid_method}

| 字段 | 类型 | 描述 |
|-------------------------------------- |------ |-----          |
| key | UUID | 债务标识 key（credit_operation_key 或 DEBT_KEY）|
| installment_key | UUID | 分期标识 key |
| reference_date | Date | 计算分期未偿余额的参考日期 |
| paid_at | DateTime | 支付日期 |
| paid_method_type | string | 支付方式，请参阅[paid_method_type 枚举值](#paid_method)表 |
| installment_status | string | 分期状态，请参阅[installment_status 枚举值](#installment_status)表 |
| installment_payment_key | UUID | 支付的唯一 key |
| paid_amount | decimal | 已支付金额 |
| total_amount | decimal | 分期总金额，部分支付时更新为未付余额 |
| present_total_amount | decimal | 参考日期（reference_date）的现值 |
| prefixed_interest_payment_amount | decimal | 利息摊销的支付金额 |
| principal_amortization_payment_amount | decimal | 本金摊销的支付金额 |
| resource_account_key | UUID | 用于结算的余额来源账户 |
| batch_renegotiation_proposal_key | UUID | 批量重组 key（如适用）|
| renegotiation_proposal_key | UUID | 重组方案 key（如适用）|
| refinancing_credit_operation_key | UUID | 再融资操作 key（如适用）|
| received_portability_key | UUID | 收到的可携性 key（如适用）|
| bank_slip_key | UUID | 与分期关联的已登记划款 key（如适用）|
| pix_qrcode_key | UUID | 与分期关联的 Pix QR Code key（如适用）|
| paid_in | 对象 | 付款银行信息，适用于通过 Pix 或划款支付的情况 |

:::warning 罚款和滞纳金
支付的罚款+滞纳金（fine_amount）可通过以下公式计算：

fine_amount = paid_amount - prefixed_interest_payment_amount - principal_amortization_payment_amount.
:::

### paid_method_type 枚举值 {#paid_method}

| 枚举值 | 描述 |
|-----------------------|--------|
| bankslip | 银行划款 |
| ted | TED |
| pix | Pix |
| refinancing | 再融资 |
| portability | 可携性 |
| unmonitored | 手动核销 |
| collateral | 担保 |

### installment_status 枚举值 {#installment_status}

| 枚举值 | 描述 |
|-----------------------|---------|
| created | 待处理 |
| opened | 待处理 |
| waiting_payment | 待处理，等待到期日支付 |
| paid_partial | 部分支付 |
| paid | 已支付 |
| paid_early | 已提前支付 |
| overdue | 已逾期 |
| paid_partial_overdue | 逾期后部分支付 |
| paid_overdue | 逾期后已支付 |
| canceled | 已取消 |
| unmonitored | 待处理 |
| waiting_payment_confirmation | 等待再融资结算 |

:::warning 部分提前支付
请注意，不存在"部分提前支付"状态。如果在分期到期日前发生部分核销，之前的状态（unmonitored 或 opened）将保持不变。
:::

---

# 分期 Webhook

URL: /zh-Hans/documentation/webhooks/parcelas

:::info 提示
我们 webhook 的响应超时时间为 10 秒。
:::

:::danger 注意！
QI Tech 的 webhooks 不应以严格方式进行映射。
API 返回的 webhook payload 中可能会添加额外字段。
:::

:::info Webhook 重发
您可以按照文档中的详细说明查询并重发 webhooks：[Webhook 重发](/documentation/notificacoes/reenvio_de_notificacoes)。
:::

当 QI Tech 为操作的收款代理时，可启用此配置，启用后您将收到操作分期的状态变更通知。

可配置的状态有：

- **opened**（待处理）
- **paid**（已支付）
- **waiting_payment**（等待支付）
- **paid_early**（已提前支付）
- **paid_partial**（部分支付）
- **overdue**（已逾期）
- **paid_partial_overdue**（逾期后部分支付）
- **paid_overdue**（逾期后已支付）

----
### 分期支付 Webhook 示例

Body.json

```json
{
    "key": "92a05d9c-e457-4f28-9fa8-86be638ee2d0",
    "data": {
        "status": "paid",
        "installment": {
            "events": [{
                "amount": 1009.68,
                "created_at": "2022-09-27T07:03:35",
                "event_date": "2022-09-27T07:03:34",
                "old_due_date": null,
                "installment_event_type": {
                    "enumerator": "payment",
                    "translation_path": "co.InstallmentEventType.payment"
                },
                "installment_old_status": {
                    "enumerator": "opened",
                    "translation_path": "co.InstallmentStatus.opened"
                }
            }],
            "paid_at": "2022-09-27T07:03:34",
            "due_date": "2022-10-28",
            "installment_key": "92a05d9c-e457-4f28-9fa8-86be638ee2d0",
            "installment_status": {
                "enumerator": "paid",
                "translation_path": "co.InstallmentStatus.paid"
            },
            "installment_payment": [{
                "installment_payment_key": "f03e1fbc-6d7a-456b-bd6a-db0faac1b481",
                "paid_at": "2026-02-10T11:39:07",
                "paid_amount": 1009.68,
                "paid_method_type": {
                    "enumerator": "pix",
                    "translation_path": "co.PaymentType.pix"
                }
            }]
        },
        "is_finished": true
    },
    "webhook_type": "installment.status_change"
}

```

### 为分期支付创建银行划款的 Webhook 示例

Body.json

```json
{
    "key": "96015228-4905-42fc-bda6-e70e0e552b6b",
    "webhook_type": "installment.status_change",
    "data": {
        "status": "update",
        "installments": [
            {
                "installment_key": "bc60ad8e-4dc1-4edc-8c5b-6df1b5c9415d",
                "digitable_line": "32990001455000000000503007797909797660000100000",
                "qr_code_key": "7d20015e-c4ed-4290-b255-33c1c5b56362",
                "qr_code_url": "00020126580014br.gov.bcb.pix0136dc4a27db-2fe1-474d-aa02-88d6fffb8d0d5204000053039865802BR5921NeymarSportEMarketing6008saopaulo62070503***63040EB2",
                "principal_amortization_amount": 141.07452576,
                "pre_fixed_amount": 72.89547424,
                "bank_slip_key": "5f25e9fd-f612-47a3-acff-be9f29d87f6c",
                "due_date": "2024-07-17",
                "total_amount": 216.97
            }
        ]
    }
}

```

## 字段定义

### Request Body 对象

| 字段 | 类型 | 描述 | 最大字符 |
|---------------------------------|--------|---------|--------------|
| **key** * | object | 信贷操作的 DEBT-KEY | - |
| **data** * | object | webhook 数据 | - |
| **webhook_type** * | object | 发送的 webhook 类型 | - |

### data 对象

| 字段 | 类型 | 描述 | 最大字符 |
|---------------------------------|--------|---------|--------------|
| **status** * | object | 分期状态 | - |
| **installment** * | object | 分期数据 | - |
| **is_finished** * | boolean | 布尔字段，表示分期是否还有新状态或已完成 | - |